/* calendar-camera.css */
/* Gesture frames stay on the compositor. All non-sticky date-axis layers use
   one focal-date origin, so headers, Staff lanes and property rows stay
   together while the exact React geometry remains settled. */
.property-calendar-grid-scroll.is-camera-preview
  :is(
    .property-calendar-header-month-row > .property-calendar-month-strip,
    .property-calendar-header-day-row > .property-calendar-day-strip,
    .property-calendar-unassigned-lane,
    .property-calendar-rows
  ) {
  transform: scaleX(var(--calendar-preview-scale, 1));
  transform-origin: var(--calendar-preview-origin, 0px) center;
  will-change: transform;
}

.property-calendar-rows.is-row-windowed {
  gap: 0;
  padding-top: 0;
}

.property-calendar-row-spacer {
  flex: 0 0 auto;
  width: 100%;
  pointer-events: none;
}

/* Do not counter-scale every label and chip. A portfolio month can contain
   hundreds of those descendants, and promoting each one to its own layer is
   what made the slider stutter and then settle in several visible jumps. The
   four shared layers above preview together; exact geometry replaces them on
   the next frame. */

/* calendar-clarity.css */
/* The Calendar resource rail owns row order. Its measured band identity is
   mirrored onto the grid so group headers, filters and hidden rows can never
   make the two panes shade different listings. Keep the contrast restrained:
   this is a tracking aid, not another content state. */
.workspace-list-scroll--calendar
  .workspace-list-card--property[data-calendar-row-band="alternate"]:not(.is-active):not(.is-selected):not(.is-multi-selected):not(:hover):not(:focus-within) {
  background: color-mix(in srgb, var(--text-primary) 3%, var(--table-surface));
  border-color: color-mix(in srgb, var(--text-primary) 10%, var(--border-subtle));
}
.property-calendar-row[data-calendar-row-band="alternate"] {
  background: color-mix(in srgb, var(--cal-surface-3) 58%, transparent);
}

/* This is a real footer, not an overlay. Keeping it in the flex flow makes
   the grid's scroll viewport end above the planner, so the final resource row
   can always be scrolled fully into view and clicked. */
.clean-schedule-decision.is-calendar {
  position: relative;
  order: 1;
  inset: auto;
  z-index: 18;
  margin: 8px;
}

/* Calm structural availability: stay identity remains on the booking bar. */
.property-calendar-day-cell:not(.is-rate-view)[data-availability="booked"] {
  background-image: linear-gradient(
    color-mix(in srgb, var(--status-confirmed) 9%, transparent),
    color-mix(in srgb, var(--status-confirmed) 9%, transparent)
  );
  box-shadow: inset 0 2px 0
    color-mix(in srgb, var(--status-confirmed) 46%, transparent);
}
.property-calendar-day-cell:not(.is-rate-view)[data-availability="blocked"] {
  background-image: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--cal-muted) 10%, transparent) 0 5px,
    transparent 5px 10px
  );
  box-shadow: inset 0 2px 0
    color-mix(in srgb, var(--cal-muted) 40%, transparent);
}

/* A Task always exposes its owner; an empty assignment is a visible state. */
.task-assignee-facepile > .task-assignee-facepile-unassigned {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: color-mix(in srgb, var(--state-warning) 62%, var(--bg-elevated));
  border-radius: 50%;
  background: color-mix(in srgb, var(--state-warning) 18%, var(--bg-elevated));
  color: var(--state-warning);
  font-weight: 800;
  line-height: 1;
}
.task-assignee-facepile > .task-assignee-facepile-label {
  position: static;
  min-width: 0;
  max-width: 118px;
  margin-left: 5px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: color-mix(in srgb, var(--text-primary) 88%, var(--text-muted));
  font-size: 0.62rem;
  font-weight: 720;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-assignee-facepile.is-unassigned > .task-assignee-facepile-label {
  color: var(--state-warning);
}
.property-calendar-task-assignees .task-assignee-facepile-label {
  max-width: 104px;
}
@container task-chip (max-width: 176px) {
  .property-calendar-task-assignees .task-assignee-facepile-label {
    display: none;
  }
}

/* Compact real-time marks keep identity, while true slivers stay uncluttered. */
.property-calendar-grid-shell
  .property-calendar-task-chip[data-time-compact="true"]
  > .property-calendar-task-assignees {
  display: inline-flex;
  margin-left: 3px;
}
.property-calendar-task-chip[data-time-sliver="true"]
  > .property-calendar-task-assignees {
  display: none;
}

/* Exact Task times can occupy only a few pixels at portfolio zoom. A
   presentation card is a labelled Task control inside the relevant date cell,
   while the accessible label and hover details retain the exact schedule and
   full ownership and status context. */
.property-calendar-grid-shell
  .property-calendar-task-chip[data-calendar-task-card="true"] {
  justify-content: flex-start;
  gap: 0;
  padding-inline: 6px;
}
.property-calendar-grid-shell
  .property-calendar-task-chip[data-calendar-task-card="true"]
  > :is(
    .property-calendar-task-chip-typeicon,
    .property-calendar-task-chip-flag,
    .property-calendar-task-chip-time,
    .property-calendar-task-chip-num,
    .property-calendar-task-flip
  ) {
  display: none;
}
.property-calendar-grid-shell
  .property-calendar-task-chip[data-calendar-task-card="true"]
  > .property-calendar-task-chip-title {
  display: block;
  min-width: 0;
  max-width: none;
  font-weight: 650;
}
@container task-chip (max-width: 64px) {
  .property-calendar-grid-shell
    .property-calendar-task-chip[data-calendar-task-card="true"]
    > .property-calendar-task-assignees {
    display: none;
  }
}
.property-calendar-unassigned-chip[data-time-compact="true"][data-assignment-state]
  > .property-calendar-task-assignees {
  display: inline-flex;
}
.property-calendar-unassigned-chip[data-time-compact="true"][data-assignment-state]
  > :is(.property-calendar-task-chip-typeicon, .property-calendar-task-chip-flag),
.property-calendar-unassigned-chip[data-time-geometry="date"][data-assignment-state]
  > :is(.property-calendar-task-chip-typeicon, .property-calendar-task-chip-flag) {
  display: none;
}

/* Keep a blocked period keyboard reachable without wrapping its task/event
   controls in another button. The semantic target owns the quiet card area;
   folded work remains an independent layer above it. */
.property-calendar-block-strip-target {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}
.property-calendar-block-strip-target:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.property-calendar-block-strip
  > :is(.property-calendar-block-strip-icon, .property-calendar-block-strip-label) {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.property-calendar-block-strip > .property-calendar-res-stack {
  z-index: 3;
  pointer-events: auto;
}

/* Keyboard focus follows the same temporary lift as pointer hover without
   leaving a clicked reservation above later Calendar interactions. These live
   here rather than in the global sheet because they are Calendar layer policy. */
.property-calendar-grid-shell .property-calendar-res-chip:has(:focus-visible) {
  background: color-mix(in srgb, var(--res-tint) 12%, var(--cal-surface));
  border-color: color-mix(in srgb, var(--res-tint) 38%, var(--cal-line-strong));
  filter: none;
  transform: none;
  box-shadow: none;
  z-index: 35;
}
.property-calendar-grid-shell .property-calendar-res-chip[data-overlap-tail="true"]:has(:focus-visible) {
  opacity: 1;
  border-style: solid;
  border-color: color-mix(in srgb, var(--res-tint) 40%, rgba(255, 255, 255, 0.28));
  border-left: 3px solid color-mix(in srgb, var(--res-tint) 75%, transparent);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.06) 100%
    ),
    color-mix(in srgb, var(--res-tint) 18%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 8px 20px -10px rgba(0, 0, 0, 0.5);
}

/* Owner rows keep one semantic hit target beneath their controls. A shared
   portfolio opens from the card, while each visible person remains selectable. */
.workspace-owner-group-link {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.workspace-list-property-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.workspace-list-card--owner .workspace-owner-expand,
.workspace-list-card--joint-owner .workspace-owner-name-link {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}
.workspace-owner-name-link {
  color: inherit;
  font-weight: 650;
  text-decoration: none;
}
.workspace-owner-name-link:hover,
.workspace-owner-name-link:focus-visible {
  color: var(--text-primary);
  text-decoration: underline;
}
.property-calendar-res-chip-checkin {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--state-success);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--state-success) 48%, transparent));
}

.property-calendar-res-chip-checkin svg {
  width: 16px;
  height: 16px;
}

.property-calendar-res-hover-checkin > span:last-child {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  color: var(--state-success);
  font-weight: 650;
}

.property-calendar-res-hover-checkin svg {
  flex: 0 0 auto;
}

.ph-cal-bar-checkin {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-left: auto;
  color: var(--state-success);
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--state-success) 50%, transparent));
}

/* inbox-staff-areas.css */
.workspace-inbox-lens {
  width: fit-content;
  display: grid;
  grid-template-columns: repeat(2, minmax(64px, auto));
  gap: 2px;
  padding: 2px;
  border: 0.5px solid var(--glass-capsule-border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
  box-shadow: var(--glass-capsule-rim);
  pointer-events: auto;
}
.workspace-inbox-lens button {
  min-height: 25px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 720;
  cursor: pointer;
}
.workspace-inbox-lens button.is-active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 5px color-mix(in srgb, #000 12%, transparent);
}
.workspace-inbox-lens button:disabled {
  cursor: default;
  opacity: 0.58;
}
.workspace-peoplechips .workspace-quickchip-count {
  color: color-mix(in srgb, var(--state-warning) 76%, var(--text-primary));
}
.workspace-thread-menu {
  max-height: calc(100dvh - var(--thread-menu-top, 0px) - 8px);
  overflow-y: auto;
}

.inbox-ownership-picker {
  min-width: 220px;
  display: grid;
  gap: 5px;
  padding: 4px;
}

.inbox-ownership-picker-label {
  padding: 0 4px;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 760;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.inbox-ownership-picker-options {
  display: grid;
  max-height: 210px;
  overflow-y: auto;
}

.workspace-thread-menu .inbox-ownership-picker-options > button,
.ph-thread-sheet .inbox-ownership-picker-options > button {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.workspace-thread-menu .inbox-ownership-picker-options > button:hover,
.ph-thread-sheet .inbox-ownership-picker-options > button:hover,
.inbox-ownership-picker-options > button.is-selected {
  background: color-mix(in srgb, var(--accent) 11%, var(--bg-elevated));
}

.inbox-ownership-picker-options > button:disabled { opacity: 0.56; cursor: default; }

.inbox-ownership-picker-avatar {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
}

.inbox-ownership-picker-avatar.is-unassigned {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.inbox-ownership-picker-check { color: var(--accent); font-weight: 900; }

.inbox-ownership-picker-status,
.inbox-ownership-picker-error {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.inbox-ownership-picker-error { color: var(--state-error); }

.wl2-assignee,
.ph-row-assignee {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 118px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.wl2-assignee > span:last-child,
.ph-row-assignee > span:last-child { overflow: hidden; text-overflow: ellipsis; }

.wl2-assignee-avatar,
.ph-row-assignee-avatar {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  overflow: hidden;
  border-radius: 50%;
}

.ph-row-assignee { color: var(--ph-text-3); }

.staff-service-areas-editor {
  display: grid;
  gap: 0.68rem;
  padding: 0.78rem;
  border: 1px solid color-mix(in srgb, #14b8a6 27%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, #14b8a6 5%, var(--bg-elevated));
}

.staff-service-areas-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.staff-service-areas-heading > div > span,
.staff-service-areas-heading > div > strong { display: block; }

.staff-service-areas-heading > div > span {
  color: var(--text-muted);
  font-size: 0.61rem;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.staff-service-areas-heading > div > strong { margin-top: 0.15rem; font-size: 0.8rem; }
.staff-service-area-add { display: grid; gap: 0.48rem; }

.staff-service-area-add > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 710;
}

.staff-service-area-distance {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.staff-service-area-distance input {
  width: 72px;
  height: 31px;
  padding: 0 0.4rem;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.68rem;
  outline: 0;
}

.staff-service-area-distance em {
  padding: 0 0.48rem 0 0.2rem;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-style: normal;
}

.staff-service-area-add > .btn,
.staff-service-area-actions .btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  padding: 0 0.65rem;
  font-size: 0.65rem;
}

.staff-service-area-list { display: grid; gap: 0.32rem; }

.staff-service-area-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 0.42rem;
  padding: 0.42rem;
  border: 1px solid color-mix(in srgb, var(--border) 76%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}

.staff-service-area-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: color-mix(in srgb, #14b8a6 13%, var(--bg));
  color: #0f9488;
}

.staff-service-area-row > span:nth-child(2) { min-width: 0; }
.staff-service-area-row strong,
.staff-service-area-row small { display: block; }

.staff-service-area-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-service-area-row small { margin-top: 0.1rem; color: var(--text-muted); font-size: 0.6rem; }

.staff-service-area-row > button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.staff-service-area-row > button:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.staff-service-area-actions { display: flex; justify-content: flex-end; }

.ph-staff-schedule-sheet .staff-service-areas-editor {
  margin: -12px 8px 22px;
  --bg: var(--ph-bg);
  --bg-elevated: var(--ph-surface);
  --text: var(--ph-text);
  --text-muted: var(--ph-text-2);
  --border: var(--ph-border);
  --accent: var(--ph-accent);
}

/* inbox-stay-tasks.css */
.inbox-flip-pop {
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.inbox-turn-tasks {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle);
}
.inbox-turn-tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 28px;
  margin-bottom: 0.3rem;
}
.inbox-turn-tasks-head > span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.inbox-turn-tasks-head strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  color: var(--accent);
  font-size: 0.62rem;
  letter-spacing: 0;
}
.inbox-turn-task-add,
.inbox-turn-task-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 32px;
  padding: 0.25rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}
.inbox-turn-task-add:hover,
.inbox-turn-task-add:focus-visible,
.inbox-turn-task-retry:hover,
.inbox-turn-task-retry:focus-visible {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}
.inbox-turn-task-list {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
}
.inbox-turn-task-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  padding: 0.34rem 0.38rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
}
.inbox-turn-task-row:hover {
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.inbox-turn-task-check {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--text-muted) 65%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--bg-elevated);
  cursor: pointer;
}
.inbox-turn-task-check:hover,
.inbox-turn-task-check:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.inbox-turn-task-check:disabled {
  cursor: wait;
  opacity: 0.68;
}
.inbox-turn-task-check.is-readonly,
.inbox-turn-task-check.is-readonly:hover {
  cursor: default;
  box-shadow: none;
}
.inbox-turn-task-row.is-done .inbox-turn-task-check,
.inbox-turn-task-check.is-readonly-done {
  border-color: color-mix(in srgb, var(--state-success) 70%, transparent);
  background: var(--state-success);
  color: var(--bg-elevated);
}
.inbox-turn-task-open {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.inbox-turn-task-contexts {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.18rem;
  margin-bottom: 0.08rem;
}
.inbox-turn-task-context {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.25;
}
.inbox-turn-task-context strong {
  flex: 0 0 auto;
  padding: 0.08rem 0.28rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  color: var(--text-soft);
  font-size: 0.64rem;
  font-weight: 760;
}
.inbox-turn-task-context.is-stay strong {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.inbox-turn-task-context > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-turn-task-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.79rem;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-turn-task-row.is-done .inbox-turn-task-title {
  color: var(--text-muted);
  text-decoration: line-through;
}
.inbox-turn-task-meta {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-turn-task-assignees {
  display: flex;
  min-width: 0;
  align-items: center;
  margin-top: 0.12rem;
}
.inbox-turn-task-assignees .task-assignee-facepile {
  min-width: 0;
  flex: 1 1 auto;
}
.inbox-turn-task-assignees .task-assignee-facepile-label {
  max-width: none;
  overflow: hidden;
  color: color-mix(in srgb, var(--text-primary) 82%, var(--text-muted));
  font-size: 0.68rem;
  font-weight: 680;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-turn-task-assignees .task-assignee-facepile.is-unassigned .task-assignee-facepile-label {
  color: var(--state-warning);
}
.inbox-turn-task-empty,
.inbox-turn-task-error,
.inbox-turn-task-notice {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.inbox-turn-task-error {
  margin-top: 0.32rem;
  color: var(--state-danger);
}
.inbox-turn-task-notice {
  margin: 0.32rem 0 0;
  color: color-mix(in srgb, var(--state-warning) 78%, var(--text-primary));
}
.inbox-turn-task-retry {
  width: 100%;
}
.inbox-turn-task-loading {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.inbox-turn-task-loading span {
  display: block;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--text-primary) 4%, transparent) 15%,
    color-mix(in srgb, var(--text-primary) 9%, transparent) 35%,
    color-mix(in srgb, var(--text-primary) 4%, transparent) 55%
  );
  background-size: 220% 100%;
  animation: inbox-turn-task-shimmer 1.25s ease-in-out infinite;
}
@keyframes inbox-turn-task-shimmer {
  to { background-position-x: -220%; }
}

/* phone-home-alert-delivery.css */
/* Phone Home's Stavros composer owns the complete strip above the tab bar.
   Keep the same direct Availability action in Home's existing header instead
   of overlaying or shrinking the composer. Other screens retain the labelled
   bottom pill because their compact Stavros presence leaves room for it. */
.ph-alert-delivery-header {
  width: auto;
  min-width: 44px;
  max-width: 118px;
  gap: 7px;
  padding: 0 12px;
  color: var(--state-warning);
  border-color: color-mix(in srgb, var(--state-warning) 52%, var(--ph-tabbar-border));
  background: color-mix(in srgb, var(--state-warning) 16%, var(--ph-tabbar-bg));
  font: inherit;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1;
}
.ph-alert-delivery-header > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-alert-delivery-header.is-paused {
  color: var(--state-error);
  border-color: color-mix(in srgb, var(--state-error) 58%, var(--ph-tabbar-border));
  background: color-mix(in srgb, var(--state-error) 17%, var(--ph-tabbar-bg));
}
.ph-alert-delivery-header.is-unknown {
  color: var(--ph-text-2);
  border-color: color-mix(in srgb, var(--ph-text-2) 45%, var(--ph-tabbar-border));
  background: var(--ph-tabbar-bg);
}
@media (max-width: 420px) {
  .ph-home-canvas-header:has(.ph-alert-delivery-header) .ph-subtitle {
    display: none;
  }
  .ph-home-canvas-header .ph-header-actions:has(.ph-alert-delivery-header) {
    gap: 6px;
  }
  .ph-alert-delivery-header {
    max-width: 104px;
    gap: 5px;
    padding-inline: 8px;
  }
}

/* phone-inbox-verification-code.css */
.ph-copy-verification-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--ph-accent) 38%, var(--ph-hairline));
  border-radius: 9px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
}

/* phone-route-loading.css */
/* A route chunk may arrive after phone navigation. Its loading frame preserves
   the destination's header, content and navigation geometry so replacing the
   fallback cannot move the whole visible screen. Calendar has its own frame
   because its command and date rows intentionally differ from list screens. */
.ph-route-loading {
  pointer-events: none;
}
.ph-route-loading .ph-screen-scroll {
  padding-top: 0;
}
.ph-route-loading-header {
  min-height: 52px;
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.ph-route-loading-actions {
  display: flex;
  gap: 10px;
}
.ph-route-loading-actions > span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.ph-route-loading-header.is-inbox {
  min-height: 86px;
  justify-content: flex-start;
}
.ph-route-loading-header.is-inbox .ph-header-row {
  min-height: 44px;
}
.ph-route-loading-inbox-navigation {
  height: 34px;
  margin-top: 4px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 6px;
}
.ph-route-loading-inbox-navigation > span {
  height: 34px;
  border: 0.5px solid var(--ph-tabbar-border);
  border-radius: 11px;
  background: var(--ph-tabbar-bg);
}
.ph-route-loading-inbox-navigation > span:last-child {
  height: 30px;
  border-radius: 10px;
}
.ph-route-loading.is-inbox .ph-route-loading-search {
  height: 38px;
  border-radius: 19px;
}
.ph-route-loading.is-inbox .ph-route-loading-chips {
  min-height: 42px;
  padding-bottom: 11px;
}
.ph-route-loading-search {
  height: 44px;
  margin: 8px 8px 7px;
  border-radius: 16px;
}
.ph-route-loading-chips {
  min-height: 34px;
  padding: 0 8px 7px;
  display: flex;
  gap: 7px;
}
.ph-route-loading-chips > span {
  width: 82px;
  height: 27px;
  border-radius: 999px;
}
.ph-route-loading-chips > span:nth-child(2) { width: 68px; }
.ph-route-loading-chips > span:nth-child(3) { width: 94px; }
.ph-route-loading-list {
  overflow: hidden;
  border-top: 1px solid var(--ph-hairline);
}
.ph-route-loading-row {
  min-height: 72px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--ph-hairline);
  display: flex;
  align-items: center;
  gap: 11px;
}
.ph-route-loading-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
}
.ph-route-loading-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 8px;
}
.ph-route-loading-copy > i,
.ph-route-loading-copy > b {
  display: block;
  height: 12px;
}
.ph-route-loading-copy > i { width: 48%; }
.ph-route-loading-copy > b { width: 78%; height: 10px; }

@media (max-width: 359px) {
  .ph-route-loading-inbox-navigation {
    grid-template-columns: minmax(0, 1fr);
  }
  .ph-route-loading-inbox-navigation > span:last-child { display: none; }
}

/* Tasks cards are roughly three times taller than a generic list row. Each
   slot owns the virtual list's 150px fallback advance, while `.ph-task-row`
   supplies the exact loaded-card margin, padding, border and radius. Keeping
   the slot as a formatting context prevents its child margins from collapsing
   outside that reserved advance. */
.ph-task-loading-rows {
  overflow: hidden;
}
.ph-task-loading-slot {
  display: flow-root;
  overflow: hidden;
}
.ph-task-loading-row {
  height: calc(100% - 12px);
  cursor: default;
  pointer-events: none;
}
.ph-task-loading-top,
.ph-task-loading-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-task-loading-check {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
}
.ph-task-loading-type {
  width: 78px;
  height: 11px;
}
.ph-task-loading-due {
  width: 48px;
  height: 11px;
  margin-left: auto;
}
.ph-task-loading-title {
  width: 68%;
  height: 14px;
  margin-left: 32px;
}
.ph-task-loading-tags {
  display: flex;
  gap: 5px;
  margin-left: 32px;
}
.ph-task-loading-tags > span {
  width: 58px;
  height: 21px;
  border-radius: 999px;
}
.ph-task-loading-tags > span + span {
  width: 72px;
}
.ph-task-loading-bottom {
  margin-left: 32px;
  margin-top: auto;
}
.ph-task-loading-property {
  width: 92px;
  height: 21px;
  border-radius: 6px;
}
.ph-task-loading-status {
  width: 70px;
  height: 22px;
  margin-left: auto;
  border-radius: 999px;
}
.ph-route-loading-tabbar {
  position: absolute;
  left: 50%;
  bottom: var(--ph-tabbar-lift);
  z-index: 6;
  width: min(336px, calc(100% - 24px));
  height: var(--ph-tabbar-height);
  padding: 0 8px;
  border: 0.5px solid var(--ph-tabbar-border);
  border-radius: 29px;
  transform: translateX(-50%);
  background: var(--ph-tabbar-bg);
  box-shadow: var(--ph-tabbar-shadow);
  display: grid;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
  align-items: center;
}
.ph-route-loading-tabbar > span {
  display: grid;
  place-items: center;
  gap: 4px;
}
.ph-route-loading-tabbar i,
.ph-route-loading-tabbar b {
  display: block;
  background: var(--ph-hairline);
  animation: ph-skeleton-pulse 1.4s ease-in-out infinite;
}
.ph-route-loading-tabbar i {
  width: 23px;
  height: 23px;
  border-radius: 8px;
}
.ph-route-loading-tabbar b {
  width: 30px;
  height: 7px;
  border-radius: 999px;
}
.ph-route-loading-calendar-command {
  padding-inline: 7px;
}
.ph-route-loading-calendar-scope {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 5px;
}
.ph-route-loading-calendar-scope > i,
.ph-route-loading-calendar-scope > b {
  display: block;
  height: 10px;
}
.ph-route-loading-calendar-scope > i { width: 74px; }
.ph-route-loading-calendar-scope > b { width: min(118px, 82%); height: 8px; }
.ph-route-loading-calendar-action {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
}
.ph-route-loading-calendar-nav {
  min-height: 42px;
}
.ph-route-loading-calendar-step {
  width: 30px;
  height: 30px;
  border-radius: 10px;
}
.ph-route-loading-calendar-month {
  width: 72px;
  height: 12px;
}
.ph-route-loading-calendar-today {
  width: 52px;
  height: 30px;
  border-radius: 11px;
}
.ph-route-loading-calendar-grid {
  min-height: 0;
  flex: 1;
  overflow: hidden;
  border-top: 1px solid var(--ph-hairline);
}
.ph-route-loading-calendar-days {
  height: 34px;
  padding-left: 96px;
  border-bottom: 1px solid var(--ph-hairline);
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: center;
  gap: 4px;
}
.ph-route-loading-calendar-days > span {
  width: 14px;
  height: 8px;
  justify-self: center;
}
.ph-route-loading-calendar-row {
  position: relative;
  height: 62px;
  border-bottom: 1px solid var(--ph-hairline);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
}
.ph-route-loading-calendar-row::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 96px;
  width: 1px;
  background: var(--ph-hairline);
}
.ph-route-loading-calendar-row > span {
  width: 58px;
  height: 10px;
  margin-left: 14px;
}
.ph-route-loading-calendar-row > i {
  width: 36%;
  height: 26px;
  margin-left: 14px;
  border-radius: 7px;
}

/* The Task association map arrives before its separate tag catalogue. Reserve
   the final tag row from those ids so the card and every row below it stay put
   while the labels and colours resolve. */
.ph-task-tags {
  min-height: 21px;
}
.ph-task-tag.is-loading {
  width: 58px;
  height: 21px;
  box-sizing: border-box;
  border-color: transparent;
  background: var(--ph-hairline);
  color: transparent;
  animation: ph-skeleton-pulse 1.4s ease-in-out infinite;
}
.ph-task-tag.is-loading[data-slot="2"] {
  width: 72px;
}
.ph-task-tag.is-loading[data-slot="3"] {
  width: 46px;
}

/* phone-staff-calendar.css */
/* Compact mobile Calendar chrome. Scope and its short summary share one line;
   a selected person still keeps the two-line context needed to clear it. */
.phone-app .ph-cal-command-row {
  min-height: 44px;
}

.phone-app .ph-cal-scope-trigger,
.phone-app .ph-cal-command-clear,
.phone-app .ph-cal-command-icon {
  min-height: 36px;
  height: 36px;
}

.phone-app .ph-cal-command-icon {
  width: 36px;
  flex-basis: 36px;
}

.phone-app .ph-cal-scope-trigger.is-compact {
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.phone-app .ph-cal-scope-trigger.is-compact .ph-cal-command-summary::before {
  content: "·";
  margin-right: 5px;
}

.phone-app .ph-cal-nav {
  min-height: 36px;
  padding-top: 0;
}

.phone-app .ph-cal-nav-btn {
  width: 36px;
  height: 36px;
}

.phone-app .ph-cal-today {
  min-height: 30px;
}

.phone-app .ph-cal-filter-chips {
  gap: 5px;
  padding-block: 0 2px;
}

/* The broad Property Calendar expands its single Staff coverage row into a
   normal, horizontally aligned working-week matrix. It is not sticky and does
   not impersonate property inventory. */
.ph-cal-staff-summary-label[aria-expanded="true"] .ph-cal-staff-summary-chevron {
  transform: rotate(180deg);
}

.ph-cal-staff-summary-chevron {
  flex: none;
  color: var(--ph-text-3);
  transition: transform 140ms ease;
}

.ph-cal-staff-people {
  width: max-content;
  min-width: 100%;
  border-bottom: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
  background: color-mix(in srgb, var(--ph-accent-wash) 13%, var(--ph-bg));
}

.ph-cal-staff-person-row {
  height: 38px;
  display: flex;
  border-bottom: 1px solid var(--ph-cal-grid-line, var(--ph-hairline));
}

.ph-cal-staff-person-row:last-child {
  border-bottom: 0;
}

.ph-cal-staff-person-label {
  position: sticky;
  left: 0;
  z-index: 7;
  width: var(--ph-prop-col, 128px);
  flex: none;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 0;
  border-right: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
  border-radius: 0;
  background: color-mix(in srgb, var(--ph-accent-wash) 24%, var(--ph-bg));
  color: var(--ph-text);
  font: inherit;
  text-align: left;
}

.ph-cal-staff-person-label > span:last-child {
  min-width: 0;
  overflow: hidden;
  font-size: 9px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-cal-staff-person-avatar {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 7px;
  object-fit: cover;
}

.ph-cal-staff-person-track {
  position: relative;
  height: 38px;
  flex: none;
}

.ph-cal-staff-person-day {
  position: absolute;
  inset-block: 0;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0 2px;
  border: 0;
  border-right: 1px solid var(--ph-cal-grid-line, var(--ph-hairline));
  border-radius: 0;
  background: transparent;
  color: var(--ph-text-2);
  font: inherit;
}

.ph-cal-staff-person-day:active {
  background: var(--ph-accent-wash);
}

.ph-cal-staff-person-status {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ph-cal-staff-person-status i {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--ph-text-3);
}

.ph-cal-staff-person-status strong {
  overflow: hidden;
  font-size: 8px;
  font-weight: 800;
  line-height: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-cal-staff-person-day > small {
  max-width: 100%;
  overflow: hidden;
  font-size: 7px;
  line-height: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-cal-staff-person-day[data-state="working"] .ph-cal-staff-person-status i {
  background: #2dd4bf;
}

.ph-cal-staff-person-day[data-state="leave"] .ph-cal-staff-person-status i {
  background: #c084fc;
}

.ph-cal-staff-person-day[data-state="sick"] .ph-cal-staff-person-status i {
  background: #fb7185;
}

.ph-cal-staff-person-day[data-state="unset"] .ph-cal-staff-person-status i {
  background: #fbbf24;
}

.ph-cal-staff-person-activity {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, #3b82f6 28%, var(--ph-bg));
  color: #93c5fd;
  font-size: 7px;
  font-weight: 850;
}

/* The dedicated Staff screen keeps one compact selected-day summary but adds
   a seven-day status strip to every person. Tapping a cell opens that date's
   actions, so sickness and working-hour exceptions are one gesture away. */
.ph-staff-calendar .ph-staff-date-strip {
  padding: 0.3rem 0.45rem;
}

.ph-staff-calendar .ph-staff-date-strip button {
  min-height: 38px;
}

.ph-staff-calendar .ph-staff-cal-list {
  gap: 6px;
  padding-top: 6px;
}

.ph-staff-calendar .ph-staff-day-summary {
  min-height: 34px;
  padding-bottom: 4px;
}

.ph-staff-calendar .ph-staff-roster-summary {
  min-height: 60px;
}

.ph-staff-week-status {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem;
  padding: 0 30px 7px;
}

.ph-staff-week-status > button {
  position: relative;
  min-width: 0;
  min-height: 29px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1px;
  padding: 0 2px;
  border: 1px solid var(--ph-border);
  border-radius: 7px;
  background: color-mix(in srgb, var(--ph-bg) 72%, var(--ph-surface));
  color: var(--ph-text-2);
  font: inherit;
  font-size: 8px;
  font-weight: 780;
}

.ph-staff-week-day {
  color: var(--ph-text-3);
  font-size: 7px;
  font-weight: 720;
  line-height: 8px;
  text-transform: uppercase;
}

.ph-staff-week-status > button > strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 8px;
  line-height: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-staff-week-status > button.is-active {
  border-color: var(--ph-accent-soft);
  box-shadow: inset 0 0 0 1px var(--ph-accent-soft);
}

.ph-staff-week-status > button[data-state="working"] {
  border-color: color-mix(in srgb, #2dd4bf 38%, var(--ph-border));
  color: #5eead4;
}

.ph-staff-week-status > button[data-state="away"] {
  border-color: color-mix(in srgb, #c084fc 42%, var(--ph-border));
  color: #d8b4fe;
}

.ph-staff-week-status > button[data-state="unconfigured"] {
  border-color: color-mix(in srgb, #fbbf24 42%, var(--ph-border));
  color: #fde68a;
}

.ph-staff-week-status small {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #315ebd;
  color: #fff;
  font-size: 7px;
  line-height: 1;
}

@media (max-width: 380px) {
  .ph-cal-staff-person-label {
    padding-inline: 6px;
  }

  .ph-cal-staff-person-day > small {
    display: none;
  }

  .ph-staff-week-status {
    gap: 2px;
    padding-inline: 30px;
  }
}

/* adjustment-composer.css */
/* Adjustment composer disclosure controls shared by desktop and phone. */
.charges-legacy-destination > div {
  flex: 1;
}

.charges-legacy-destination .btn {
  margin-top: 0.5rem;
}

.charges-date-field {
  max-width: 13rem;
}

.charges-line-options,
.charges-more {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.45rem;
}

.charges-line-options > summary,
.charges-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.charges-line-options > summary::-webkit-details-marker,
.charges-more > summary::-webkit-details-marker {
  display: none;
}

.charges-line-options > summary::after,
.charges-more > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--accent-primary);
  font-size: 1rem;
  line-height: 1;
}

.charges-line-options[open] > summary::after,
.charges-more[open] > summary::after {
  content: "−";
}

.charges-line-options > summary > span:last-child {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.charges-line-options-body,
.charges-more-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.65rem;
}

.charges-option-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.charges-more-body .charges-field {
  max-width: 18rem;
}

.ph-billable-more {
  margin: 0 2px;
  border: 1px solid var(--ph-border, rgba(255, 255, 255, 0.1));
  border-radius: 12px;
  background: var(--ph-surface-2, #17171a);
}

.ph-billable-more > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px;
  padding: 10px 12px;
  color: var(--ph-text, #ededee);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.ph-billable-more > summary::-webkit-details-marker {
  display: none;
}

.ph-billable-more > summary::after {
  content: "+";
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--ph-text-dim, rgba(237, 237, 238, 0.55));
  font-size: 19px;
  font-weight: 500;
}

.ph-billable-more[open] > summary::after {
  content: "−";
}

.ph-billable-more > summary > span {
  grid-column: 1;
}

.ph-billable-more > summary > span:last-child {
  color: var(--ph-text-dim, rgba(237, 237, 238, 0.55));
  font-size: 12px;
  font-weight: 550;
}

.ph-billable-more-body {
  display: grid;
  gap: 14px;
  padding: 2px 12px 12px;
  border-top: 1px solid var(--ph-border, rgba(255, 255, 255, 0.1));
}

/* globals.css */
/* —— Properties (workspace: list | editor | right nav) —— */
.properties-editor {
  position: relative;
  min-height: min(70vh, calc(100vh - 7rem));
  padding-bottom: 4.5rem;
}

.tasks-product-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 18px 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
  font-size: 12px;
}

.tasks-product-note a {
  flex: none;
  color: var(--link, var(--accent));
  font-weight: 650;
}

@media (max-width: 720px) {
  .tasks-product-note {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ── Staff self-service inside the existing Stavros work surface ────────────
   This is deliberately a live card, never a Home canvas block: payroll and HR
   payloads stay in component memory and are re-fetched after every open. */
.staff-card {
  width: min(100%, 720px);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 14px 36px color-mix(in srgb, #0f172a 10%, transparent);
}
.staff-card[data-compact] {
  width: 100%;
  border-radius: 13px;
  box-shadow: none;
}
.staff-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--accent) 11%, transparent), transparent 46%),
    var(--bg-elevated);
}
.staff-card-icon {
  width: 35px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border-radius: 11px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.staff-card-head > span:nth-child(2) {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  line-height: 1.15;
}
.staff-card-head > span:nth-child(2) small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}
.staff-card-head > span:nth-child(2) strong {
  margin-top: 3px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-card-private {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.staff-card-refresh {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  border: 0;
  border-radius: 9px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}
.staff-card-refresh:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--surface-muted);
}
.staff-card-loading,
.staff-card-alert,
.staff-card-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  color: var(--text-muted);
  background: var(--surface-muted);
  font-size: 12.5px;
}
.staff-card-alert[data-tone="bad"] {
  border-color: color-mix(in srgb, var(--state-error) 35%, var(--border-subtle));
  color: var(--state-error);
  background: color-mix(in srgb, var(--state-error) 8%, var(--bg-elevated));
}
.staff-card-alert[data-tone="good"],
.staff-card-empty {
  border-color: color-mix(in srgb, var(--state-success) 30%, var(--border-subtle));
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 7%, var(--bg-elevated));
}
.staff-card-spin {
  animation: staffCardSpin 0.8s linear infinite;
}
@keyframes staffCardSpin { to { transform: rotate(360deg); } }
.staff-card-body {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 13px;
}
.staff-card-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: color-mix(in srgb, var(--text-primary) 2.5%, var(--bg-elevated));
}
.staff-card-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.staff-card-field[data-wide],
.staff-card-primary {
  grid-column: 1 / -1;
}
.staff-card-field > span {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
}
.staff-card-field input,
.staff-card-field select,
.staff-card-field textarea,
.staff-card-slip-select select {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 10px;
  outline: none;
  color: var(--text-primary);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 14px;
}
.staff-card-field textarea { resize: vertical; }
.staff-card-field input:focus,
.staff-card-field select:focus,
.staff-card-field textarea:focus,
.staff-card-slip-select select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}
.staff-card-check {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  min-height: 38px;
  color: var(--text-soft);
  font-size: 12.5px;
}
.staff-card-check input { accent-color: var(--accent); }
.staff-card-route {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 42px;
  justify-content: center;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-soft);
  background: var(--bg-elevated);
}
.staff-card-route > span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
}
.staff-card-route small { color: var(--text-muted); font-size: 10px; }
.staff-card-route a { color: inherit; text-underline-offset: 2px; }
.staff-card-route small[data-tone="bad"] { color: var(--state-error); }
.staff-card-route .staff-card-link { align-self: flex-start; }
.staff-card-primary,
.staff-card-secondary {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
}
.staff-card-primary {
  color: var(--accent-foreground, #fff);
  background: var(--accent);
}
.staff-card-primary:hover:not(:disabled) { filter: brightness(1.04); }
.staff-card-primary:disabled,
.staff-card-secondary:disabled { cursor: default; opacity: 0.55; }
.staff-card-secondary {
  align-self: flex-start;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: var(--surface-muted);
}
.staff-card-days {
  display: flex;
  align-items: baseline;
  justify-content: center;
  align-self: end;
  gap: 5px;
  min-height: 38px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
}
.staff-card-days strong { font-size: 17px; }
.staff-card-days span { color: var(--text-muted); font-size: 11px; }
.staff-card-leave-days {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
}
.staff-card-leave-days > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.staff-card-leave-days > summary::-webkit-details-marker { display: none; }
.staff-card-leave-days[open] > summary svg { transform: rotate(180deg); }
.staff-card-leave-days > small {
  display: block;
  padding: 0 10px 8px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}
.staff-card-leave-days > div {
  max-height: 190px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: auto;
  border-top: 1px solid var(--border-subtle);
  background: var(--border-subtle);
}
.staff-card-leave-days label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--text-soft);
  background: var(--bg-elevated);
  font-size: 10.5px;
}
.staff-card-leave-days input { accent-color: var(--accent); }
.staff-card-history {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}
.staff-card-history > summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  color: var(--text-soft);
  background: var(--surface-muted);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.staff-card-history > summary::-webkit-details-marker { display: none; }
.staff-card-history[open] > summary svg { transform: rotate(180deg); }
.staff-card-requests { display: flex; flex-direction: column; }
.staff-card-request {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 11px;
  border-top: 1px solid var(--border-subtle);
}
.staff-card-request-date { color: var(--text-muted); font-size: 10.5px; }
.staff-card-request-main,
.staff-card-request-side { display: flex; flex-direction: column; min-width: 0; }
.staff-card-request-main { gap: 2px; }
.staff-card-request-main strong { font-size: 12.5px; }
.staff-card-request-main small { overflow-wrap: anywhere; color: var(--text-muted); font-size: 11px; line-height: 1.35; }
.staff-card-request-main .staff-card-request-note { margin-top: 3px; color: var(--text-soft); }
.staff-card-request-side { align-items: flex-end; gap: 5px; }
.staff-card-request-side > strong { font-size: 12px; white-space: nowrap; }
.staff-card-status {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 12%, transparent);
  font-size: 10px;
  font-weight: 750;
  text-transform: capitalize;
}
.staff-card-status[data-tone="good"] { color: var(--state-success); background: color-mix(in srgb, var(--state-success) 12%, transparent); }
.staff-card-status[data-tone="muted"] { color: var(--text-muted); background: color-mix(in srgb, var(--text-primary) 6%, transparent); }
.staff-card-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  font-size: 10.5px;
  cursor: pointer;
}
.staff-card-link:hover:not(:disabled) { color: var(--state-error); }
.staff-card-metrics,
.staff-card-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.staff-card-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.staff-card-metrics > span,
.staff-card-details > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
}
.staff-card-metrics small,
.staff-card-details small,
.staff-payslip small { color: var(--text-muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.035em; }
.staff-card-metrics strong,
.staff-card-details strong { overflow-wrap: anywhere; font-size: 12px; }
.staff-card-slip-select {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 12px 0;
}
.staff-card-slip-select > span { color: var(--text-muted); font-size: 10.5px; font-weight: 700; }
.staff-card-slip-select select { flex: 1; appearance: none; padding-right: 30px; }
.staff-card-slip-select svg { position: absolute; right: 10px; pointer-events: none; }
.staff-payslip {
  margin: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: var(--bg-elevated);
}
.staff-card-body .staff-payslip { margin: 0; }
.staff-payslip > header,
.staff-payslip-meta,
.staff-payslip-ytd {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.staff-payslip > header > span,
.staff-payslip-meta > span,
.staff-payslip-ytd > span { display: flex; flex-direction: column; gap: 2px; }
.staff-payslip > header > span:last-child { text-align: right; }
.staff-payslip > header strong { font-size: 13px; }
.staff-payslip-meta { justify-content: flex-start; background: var(--surface-muted); }
.staff-payslip-meta strong,
.staff-payslip-ytd strong { font-size: 11.5px; }
.staff-payslip-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--border-subtle);
}
.staff-payslip-columns > section { padding: 12px 14px; }
.staff-payslip-columns > section + section { border-left: 1px solid var(--border-subtle); }
.staff-payslip-columns h4 { margin: 0 0 7px; color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.staff-payslip-columns p { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; padding: 4px 0; font-size: 11.5px; }
.staff-payslip-columns p span { display: flex; flex-direction: column; }
.staff-payslip-columns p small { margin-top: 1px; font-size: 8.5px; text-transform: none; }
.staff-payslip-columns p strong { white-space: nowrap; }
.staff-payslip-net {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
}
.staff-payslip-net span { display: flex; flex-direction: column; }
.staff-payslip-net b { font-size: 22px; }
.staff-payslip-ytd { justify-content: flex-start; }
.staff-payslip footer { padding: 9px 14px; color: var(--text-muted); font-size: 10.5px; }
.staff-card-footnote { margin: 0 12px 12px; color: var(--text-muted); font-size: 10.5px; line-height: 1.4; }
.staff-card-body > .staff-card-footnote { margin: 0; }
.staff-card-calendar,
.staff-card-reimbursements,
.staff-card-approvals { display: flex; flex-direction: column; }
.staff-card-calendar { overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 12px; }
.staff-card-calendar > span {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 11px;
  border-top: 1px solid var(--border-subtle);
}
.staff-card-calendar > span:first-child { border-top: 0; }
.staff-card-calendar strong { font-size: 12px; }
.staff-card-calendar small { color: var(--text-muted); font-size: 10.5px; }
.staff-card-approvals { padding: 12px; gap: 8px; }
.staff-card-approvals > article,
.staff-card-reimbursements > article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--surface-muted);
}
.staff-card-approvals > article > span,
.staff-card-reimbursements > article > span { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; }
.staff-card-approvals small,
.staff-card-reimbursements small { color: var(--text-muted); font-size: 10px; }
.staff-card-approvals strong,
.staff-card-reimbursements strong { font-size: 12.5px; }
.staff-card-approvals p { margin: 2px 0 0; color: var(--text-soft); font-size: 11px; }
.staff-card-approvals em,
.staff-card-reimbursements em { margin-top: 3px; color: var(--state-warning); font-size: 10px; font-style: normal; }
.staff-card-approval-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0 0;
}
.staff-card-approval-facts > div {
  min-width: 110px;
  max-width: 100%;
  padding: 6px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-elevated);
}
.staff-card-approval-facts dt {
  color: var(--text-muted);
  font-size: 8.5px;
  font-weight: 750;
  text-transform: uppercase;
}
.staff-card-approval-facts dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: var(--text-soft);
  font-size: 10px;
}
.staff-card-approvals > article > div { display: flex; gap: 6px; }
.staff-card-approvals button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 8px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.staff-card-approvals button:first-child { border-color: color-mix(in srgb, var(--state-success) 38%, var(--border-subtle)); color: var(--state-success); }
.staff-card-approvals button:last-child { color: var(--state-error); }
.staff-card-reimbursements { gap: 7px; }
.staff-card-reimbursements b { white-space: nowrap; font-size: 15px; }
.staff-card-batch-head {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: center;
}
.staff-card-batch-head > span:not(.staff-card-status) {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
}
.staff-card-batch-head small { color: var(--text-muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; }
.staff-card-batch-head strong { font-size: 12.5px; }
.staff-card-reconcile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}
.staff-card-reconcile .staff-card-primary,
.staff-card-reconcile .staff-card-secondary { min-height: 38px; }

@media (max-width: 640px) {
  .staff-card { width: 100%; border-radius: 13px; }
  .staff-card-private { display: none; }
  .staff-card-form { grid-template-columns: 1fr; }
  .staff-card-field[data-wide], .staff-card-primary, .staff-card-route, .staff-card-leave-days { grid-column: auto; }
  .staff-card-leave-days > div { grid-template-columns: 1fr; }
  .staff-card-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-card-details { grid-template-columns: 1fr; }
  .staff-card-request { grid-template-columns: 1fr auto; }
  .staff-card-request-date { grid-column: 1 / -1; }
  .staff-payslip-columns { grid-template-columns: 1fr; }
  .staff-payslip-columns > section + section { border-top: 1px solid var(--border-subtle); border-left: 0; }
  .staff-card-calendar > span { grid-template-columns: 1fr auto; }
  .staff-card-calendar small { grid-column: 1 / -1; }
  .staff-card-approvals > article { align-items: stretch; flex-direction: column; }
  .staff-card-approvals > article > div { justify-content: flex-end; }
  .staff-card-reconcile { grid-template-columns: 1fr; }
  .staff-card-reconcile .staff-card-secondary { justify-self: stretch; }
}

/* Staff calendar -----------------------------------------------------------
   Staff are Contact resources, not User accounts. Pane 2 is the one resource
   axis; pane 3 now uses the canonical Calendar/Agenda renderer and syncs its
   rows to these cards exactly like Listings. */
.workspace-staff-calendar-list {
  display: grid;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem 1rem;
}

.workspace-list-card--staff {
  width: 100%;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* A Staff row is a schedule resource, not a compressed property shortcut.
   The generic Calendar skin collapses property cards to 50px and hides their
   subtitle; doing that here left enough height for only one 16px work lane and
   removed the job/Group context needed to follow the row across the grid. */
.workspace-list-scroll--staff.workspace-list-scroll--calendar
  .workspace-list-card--staff {
  min-height: 78px !important;
  padding: 0.62rem 0.58rem;
  gap: 0.62rem;
}

.workspace-list-scroll--staff.workspace-list-scroll--calendar
  .workspace-list-card--staff
  .workspace-list-avatar-wrap,
.workspace-list-scroll--staff.workspace-list-scroll--calendar
  .workspace-list-card--staff
  .workspace-list-thumb,
.workspace-list-scroll--staff.workspace-list-scroll--calendar
  .workspace-list-card--staff
  .workspace-list-avatar-fallback {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px;
  border-radius: 10px;
}

.workspace-list-scroll--staff.workspace-list-scroll--calendar
  .workspace-list-card--staff
  .workspace-list-subtitle {
  display: block !important;
  margin-top: 0.18rem;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-list-scroll--staff.workspace-list-scroll--calendar-minimal
  .workspace-list-card--staff {
  min-height: 64px !important;
}

.workspace-staff-shared-avatar {
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
  color: var(--accent);
}

.workspace-staff-no-login {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--border) 75%, transparent);
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.staff-calendar-shell {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  background: var(--bg);
}

.staff-calendar-shell .property-calendar-grid-shell,
.staff-calendar-shell .property-calendar-agenda {
  min-height: 0;
  flex: 1 1 auto;
}

/* Make each person read as one continuous schedule row. Property rows can
   survive on hairlines because their cards and reservation bars are dense;
   Staff rows need a calm alternating band so a name in pane 2 can be followed
   across a wide date range without losing the row. */
.staff-calendar-shell .property-calendar-row {
  background: color-mix(in srgb, var(--cal-surface-2) 34%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--cal-line-strong) 42%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--cal-line-strong) 52%, transparent);
}

.staff-calendar-shell .property-calendar-row:nth-of-type(even) {
  background: color-mix(in srgb, var(--cal-surface-3) 58%, transparent);
}

.staff-calendar-shell .property-calendar-row.is-active {
  background: color-mix(in srgb, var(--cal-accent) 13%, var(--cal-surface));
}

.staff-calendar-sync-link {
  text-decoration: none;
  white-space: nowrap;
}

.staff-calendar-create-hint {
  margin: 0;
  padding: 0.5rem 0.65rem 0.35rem;
  color: var(--cal-muted);
  font-size: 0.68rem;
}

.staff-calendar-shell .property-calendar-create-item:disabled {
  cursor: default;
  opacity: 0.45;
}

.staff-calendar-shell .property-calendar-create-item:disabled:hover {
  background: transparent;
}

.staff-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
}

.staff-calendar-toolbar h2 {
  margin: 0.12rem 0 0;
  font-size: 1rem;
}

.staff-calendar-eyebrow {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.staff-calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.staff-calendar-controls .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  text-decoration: none;
}

.staff-calendar-filter {
  min-width: 145px;
}

.staff-calendar-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
}

.staff-calendar-grid {
  display: grid;
  width: max-content;
  min-width: 100%;
  align-items: stretch;
}

.staff-calendar-corner,
.staff-calendar-date {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: 62px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.staff-calendar-corner {
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.65rem 0.85rem;
}

.staff-calendar-corner small,
.staff-calendar-person small,
.staff-calendar-date small {
  color: var(--text-muted);
}

.staff-calendar-date {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  gap: 0 0.35rem;
  padding: 0.45rem 0.55rem;
}

.staff-calendar-date span {
  color: var(--text-muted);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
}

.staff-calendar-date strong {
  grid-row: span 2;
  font-size: 1.15rem;
}

.staff-calendar-date.is-today,
.staff-calendar-cell.is-today {
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
}

.staff-calendar-person {
  position: sticky;
  left: 0;
  z-index: 5;
  min-height: 116px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-content: start;
  gap: 0.65rem;
  padding: 0.7rem 0.75rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.staff-calendar-person.is-active {
  box-shadow: inset 3px 0 var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-elevated));
}

.staff-calendar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
}

.staff-calendar-person > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.staff-calendar-person > span strong,
.staff-calendar-person > span small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-calendar-person-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.3rem;
}

.staff-calendar-person-actions button,
.staff-calendar-cell-add {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.67rem;
  font-weight: 700;
}

.staff-calendar-person-actions button {
  padding: 0.25rem 0.4rem;
}

.staff-calendar-cell {
  position: relative;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.42rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.staff-calendar-cell:hover .staff-calendar-cell-add,
.staff-calendar-cell-add:focus-visible {
  opacity: 1;
}

.staff-calendar-cell-add {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 21px;
  height: 21px;
  padding: 0;
  opacity: 0;
  background: var(--bg-elevated);
}

.staff-calendar-chip,
.staff-calendar-task {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 7px;
  padding: 0.3rem 0.38rem;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  text-align: left;
  text-decoration: none;
}

.staff-calendar-chip span,
.staff-calendar-task span {
  color: var(--text-muted);
  font-size: 0.61rem;
  font-weight: 750;
}

.staff-calendar-chip strong,
.staff-calendar-task {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-calendar-chip.is-leave {
  border-color: color-mix(in srgb, #a855f7 38%, var(--border));
  background: color-mix(in srgb, #a855f7 13%, var(--bg-elevated));
}

.staff-calendar-chip.is-duty {
  border-color: color-mix(in srgb, #f59e0b 38%, var(--border));
  background: color-mix(in srgb, #f59e0b 13%, var(--bg-elevated));
}

.staff-calendar-chip.is-cancelled,
.staff-calendar-chip.is-declined,
.staff-calendar-task.is-done {
  opacity: 0.52;
  text-decoration: line-through;
}

.staff-calendar-task {
  grid-template-columns: auto minmax(0, 1fr);
  border-style: dashed;
}

.staff-calendar-loading,
.staff-calendar-empty {
  margin: auto;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}

.staff-calendar-empty h3 {
  color: var(--text);
}

.staff-calendar-empty > svg {
  margin-bottom: 0.35rem;
}

.staff-calendar-right-panel {
  display: grid;
  align-content: start;
  gap: 0.9rem;
  padding: 1rem;
  color: var(--text);
}

.staff-calendar-right-panel p {
  margin: 0.28rem 0 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.staff-calendar-right-summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.staff-calendar-right-summary > div {
  min-width: 0;
}

.staff-calendar-right-summary strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-calendar-right-kicker {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--text-muted);
  font-size: 0.63rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.staff-calendar-right-avatar {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  object-fit: cover;
}

.staff-calendar-right-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-elevated));
  color: var(--accent);
}

.staff-calendar-right-icon.is-muted {
  color: var(--text-muted);
}

.staff-calendar-right-key {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}

.staff-calendar-right-section-head {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-size: 0.76rem;
}

.staff-calendar-right-key-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0;
}

.staff-calendar-right-key-row + .staff-calendar-right-key-row {
  border-top: 1px solid color-mix(in srgb, var(--border) 68%, transparent);
}

.staff-calendar-right-key-row > span:last-child {
  min-width: 0;
}

.staff-calendar-right-key-row strong,
.staff-calendar-right-key-row small {
  display: block;
}

.staff-calendar-right-key-row strong {
  font-size: 0.73rem;
}

.staff-calendar-right-key-row small {
  margin-top: 0.1rem;
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.staff-calendar-right-swatch {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--text-muted);
}

.staff-calendar-right-swatch[data-kind="task"] { background: #64748b; }
.staff-calendar-right-swatch[data-kind="event"] { background: #2563eb; }
.staff-calendar-right-swatch[data-kind="leave"] { background: #a855f7; }
.staff-calendar-right-swatch[data-kind="duty"] { background: #f59e0b; }

.staff-calendar-right-help {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 0.5rem;
  padding: 0.7rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
  color: var(--text-muted);
}

.staff-calendar-right-help p {
  margin: 0;
}

.staff-calendar-right-help strong {
  color: var(--text);
}

.staff-calendar-right-error {
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--danger) 44%, var(--border));
  border-radius: 10px;
  color: var(--danger) !important;
}

.staff-calendar-right-actions {
  display: grid;
  gap: 0.5rem;
}

.staff-calendar-right-actions .btn {
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}

.staff-calendar-right-link {
  justify-content: center;
  text-decoration: none;
}

.staff-event-modal {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(860px, calc(100vh - 2rem));
}

.staff-event-section {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-elevated) 84%, transparent);
}

.staff-event-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.staff-event-section-head span,
.staff-event-person small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.staff-event-picker {
  max-height: 168px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  overflow: auto;
}

.staff-event-person {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.4rem;
  border-radius: 8px;
}

.staff-event-person:hover {
  background: var(--bg-hover);
}

.staff-event-person > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.staff-event-meet-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
}

.staff-event-meet-link {
  display: inline-flex;
  margin-top: 0.4rem;
}

.staff-event-conflicts {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.65rem;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, #f59e0b 55%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, #f59e0b 9%, var(--bg-elevated));
  font-size: 0.75rem;
}

.staff-event-conflicts .properties-res-action-btn {
  justify-self: start;
}

@media (max-width: 760px) {
  .staff-calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .staff-event-picker {
    grid-template-columns: 1fr;
  }
}

/* Cockpit-parity Staff mini-apps. These live inside Home's existing card seam;
   none of the private data below is a canvas block or persistent browser state. */
.staff-cockpit-app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 13px;
}
.staff-cockpit-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--text-primary) 3%, var(--bg-elevated));
}
.staff-cockpit-tabs button,
.staff-cockpit-button,
.staff-cockpit-primary,
.staff-mileage-map-tools button,
.staff-history-actions button,
.staff-expense-meta button,
.staff-team-calendar button,
.staff-approvals-cockpit button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 9px;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.staff-cockpit-tabs button[data-active],
.staff-mileage-map-tools button[data-active] {
  color: var(--text-primary);
  background: var(--surface-muted);
  box-shadow: 0 1px 2px color-mix(in srgb, #0f172a 10%, transparent);
}
.staff-cockpit-primary {
  min-height: 38px;
  border-color: var(--accent);
  color: var(--accent-contrast, white);
  background: var(--accent);
}
.staff-cockpit-button {
  min-height: 38px;
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
}
.staff-cockpit-primary:disabled,
.staff-cockpit-button:disabled,
.staff-cockpit-tabs button:disabled { cursor: default; opacity: .52; }
.staff-cockpit-field {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.staff-cockpit-field > span,
.staff-claim-edit label > span {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: .025em;
}
.staff-cockpit-field > span em {
  font-weight: 500;
  font-style: normal;
  text-transform: none;
}
.staff-cockpit-field input,
.staff-cockpit-field select,
.staff-claim-edit input,
.staff-claim-edit select {
  width: 100%;
  min-height: 39px;
  box-sizing: border-box;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 10px;
  outline: none;
  color: var(--text-primary);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 13px;
}
.staff-cockpit-field input:focus,
.staff-cockpit-field select:focus,
.staff-claim-edit input:focus,
.staff-claim-edit select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}
.staff-cockpit-toggle {
  display: inline-flex;
  align-items: center;
  align-self: end;
  min-height: 39px;
  cursor: pointer;
}
.staff-cockpit-toggle > input { position: absolute; opacity: 0; pointer-events: none; }
.staff-cockpit-toggle > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  box-sizing: border-box;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 7px 10px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 700;
}
.staff-cockpit-toggle > input:checked + span {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
}
.staff-cockpit-success {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 24px 14px;
  border: 1px solid color-mix(in srgb, var(--state-success) 32%, var(--border-subtle));
  border-radius: 13px;
  text-align: center;
  background: color-mix(in srgb, var(--state-success) 6%, var(--bg-elevated));
}
.staff-cockpit-success > span {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 14%, transparent);
}
.staff-cockpit-success > strong { margin-top: 9px; font-size: 14px; }
.staff-cockpit-success > p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.staff-cockpit-success > div { display: flex; gap: 7px; margin-top: 13px; }
.staff-cockpit-success button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.staff-cockpit-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 24px 12px;
  border: 1px dashed var(--border-subtle);
  border-radius: 11px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Mileage: old-Cockpit address search, pinning, live road map and history. */
.staff-mileage-new { display: flex; flex-direction: column; gap: 10px; }
.staff-mileage-addresses,
.staff-mileage-fields,
.staff-expense-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.staff-address-field > div:first-of-type,
.staff-receipt-input,
.staff-mileage-purpose > div,
.staff-money-input {
  position: relative;
  display: flex;
  align-items: center;
}
.staff-address-field > div:first-of-type > svg:first-child,
.staff-receipt-input > svg,
.staff-money-input > b {
  position: absolute;
  left: 10px;
  z-index: 1;
  color: var(--text-muted);
  font-size: 12px;
}
.staff-address-field > div:first-of-type input,
.staff-receipt-input input { padding-left: 31px; padding-right: 31px; }
.staff-address-field > div:first-of-type > svg:last-child { position: absolute; right: 10px; color: var(--accent); }
.staff-address-results {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 1200;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: 0 16px 38px color-mix(in srgb, #0f172a 20%, transparent);
}
.staff-address-results button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  padding: 9px 10px;
  color: var(--text-primary);
  text-align: left;
  background: var(--bg-elevated);
  cursor: pointer;
}
.staff-address-results button:first-child { border-top: 0; }
.staff-address-results button:hover { background: var(--surface-muted); }
.staff-address-results button > svg { flex: none; margin-top: 2px; color: var(--accent); }
.staff-address-results button > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staff-address-results strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.staff-address-results small { color: var(--text-muted); font-size: 10px; }
.staff-mileage-map-tools { display: flex; flex-wrap: wrap; gap: 5px; }
.staff-mileage-map-tools button { min-height: 29px; border-color: var(--border-subtle); background: var(--bg-elevated); }
.staff-mileage-location-note { margin: -3px 0 0; color: var(--text-muted); font-size: 10.5px; }
.staff-route-map {
  position: relative;
  height: 224px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-muted);
  isolation: isolate;
}
.staff-route-map[data-compact] { height: 170px; }
.staff-route-map[data-expanded] {
  position: fixed;
  inset: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  z-index: 10050;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 0 0 100vmax color-mix(in srgb, #0f172a 68%, transparent), 0 24px 70px #0f172a80;
}
.staff-route-map-canvas { width: 100%; height: 100%; }
.staff-route-map .leaflet-container { width: 100%; height: 100%; font: inherit; }
.staff-route-map .leaflet-control-attribution { font-size: 8px; }
.staff-route-map-loading,
.staff-route-map-pick {
  position: absolute;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  box-shadow: 0 4px 16px #0f172a20;
  font-size: 10.5px;
  font-weight: 700;
}
.staff-route-map-loading { top: 50%; left: 50%; padding: 6px 9px; transform: translate(-50%, -50%); }
.staff-route-map-pick { top: 8px; left: 50%; padding: 6px 10px; color: white; background: var(--accent); transform: translateX(-50%); }
.staff-route-map-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 950;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  box-shadow: 0 4px 16px #0f172a20;
  cursor: pointer;
}
.staff-route-pin-shell { background: none; border: 0; }
.staff-route-pin {
  width: 14px;
  height: 14px;
  display: block;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px #0f172a55;
}
.staff-route-pin[data-tone="finish"] { background: var(--state-error); }
.staff-mileage-route-readout {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.staff-mileage-route-readout > svg { flex: none; color: var(--accent); }
.staff-mileage-route-readout > span { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; }
.staff-mileage-route-readout strong { font-size: 11.5px; }
.staff-mileage-route-readout small { color: var(--text-muted); font-size: 9.5px; }
.staff-mileage-route-readout[data-error] { border-color: color-mix(in srgb, var(--state-error) 35%, var(--border-subtle)); }
.staff-mileage-route-readout[data-error] small { color: var(--state-error); }
.staff-mileage-route-readout > button {
  border: 0;
  padding: 4px;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.staff-mileage-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
.staff-mileage-purpose > div input { padding-right: 88px; }
.staff-mileage-purpose > div button {
  position: absolute;
  right: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  border-radius: 7px;
  padding: 5px 7px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  font: inherit;
  font-size: 10.5px;
  font-weight: 750;
  cursor: pointer;
}
.staff-mileage-submit,
.staff-expense-submit,
.staff-leave-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 2px;
}
.staff-mileage-submit > span,
.staff-expense-submit > span { min-width: 0; display: flex; flex-direction: column; }
.staff-mileage-submit small,
.staff-expense-submit small,
.staff-leave-submit small { color: var(--text-muted); font-size: 10.5px; }
.staff-mileage-submit strong,
.staff-expense-submit strong { font-size: 19px; line-height: 1.1; }
.staff-mileage-submit em,
.staff-expense-submit em { color: var(--text-muted); font-size: 9.5px; font-style: normal; }

/* Claim history shared by mileage and expenses. */
.staff-claim-history { display: flex; flex-direction: column; gap: 8px; }
.staff-history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.staff-history-summary > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--surface-muted);
}
.staff-history-summary small { color: var(--text-muted); font-size: 9.5px; font-weight: 700; text-transform: uppercase; }
.staff-history-summary strong { font-size: 14px; }
.staff-history-months {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.staff-history-months > strong { margin-bottom: 3px; color: var(--text-muted); font-size: 9.5px; text-transform: uppercase; }
.staff-history-months > span { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(120px, 1fr) auto; gap: 8px; padding: 5px 4px; border-top: 1px solid var(--border-subtle); font-size: 10.5px; }
.staff-history-months > span:nth-child(2) { border-top: 0; }
.staff-history-months small { color: var(--text-muted); }
.staff-history-months em { font-weight: 750; font-style: normal; }
.staff-history-row {
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.staff-history-row[data-open] { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle)); }
.staff-history-row-main {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  border: 0;
  padding: 10px;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
  font: inherit;
}
button.staff-history-row-main { cursor: pointer; }
.staff-history-row-main > span { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staff-history-row-main > span:last-child { align-items: flex-end; flex: none; }
.staff-history-row-main strong { font-size: 12px; }
.staff-history-row-main small { color: var(--text-muted); font-size: 10.5px; }
.staff-history-row-main em { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 10px; font-style: normal; }
.staff-history-row-main small[data-status],
.staff-leave-history-row b[data-status] {
  align-self: flex-end;
  border-radius: 999px;
  padding: 3px 6px;
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 11%, transparent);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.staff-history-row-main small[data-status="approved"],
.staff-history-row-main small[data-status="paid"],
.staff-leave-history-row b[data-status="approved"] { color: var(--state-success); background: color-mix(in srgb, var(--state-success) 11%, transparent); }
.staff-history-row-main small[data-status="declined"],
.staff-history-row-main small[data-status="cancelled"],
.staff-leave-history-row b[data-status="declined"],
.staff-leave-history-row b[data-status="cancelled"] { color: var(--text-muted); background: var(--surface-muted); }
.staff-history-detail { display: flex; flex-direction: column; gap: 8px; padding: 0 10px 10px; }
.staff-history-detail > div:not(.staff-route-map):not(.staff-history-actions) { display: flex; gap: 8px; color: var(--text-muted); font-size: 10px; }
.staff-history-actions,
.staff-expense-meta > div { display: flex; gap: 6px; }
.staff-history-actions button,
.staff-expense-meta button { min-height: 29px; border-color: var(--border-subtle); background: var(--bg-elevated); }
button[data-danger] { color: var(--state-error) !important; border-color: color-mix(in srgb, var(--state-error) 35%, var(--border-subtle)) !important; }
button[data-approve] { color: var(--state-success) !important; border-color: color-mix(in srgb, var(--state-success) 35%, var(--border-subtle)) !important; }
.staff-claim-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.staff-claim-edit label { display: flex; flex-direction: column; gap: 4px; }
.staff-claim-edit [data-wide] { grid-column: 1 / -1; }
.staff-claim-edit > small { color: var(--text-muted); font-size: 9.5px; }
.staff-claim-edit > div { display: flex; justify-content: flex-end; gap: 6px; }

/* Expense mini-app. */
.staff-expense-form { display: flex; flex-direction: column; gap: 11px; }
.staff-money-input input { padding-left: 25px; }
.staff-segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; min-height: 39px; padding: 3px; border: 1px solid var(--border-subtle); border-radius: 9px; }
.staff-segmented button { border: 0; border-radius: 7px; color: var(--text-muted); background: transparent; font: inherit; font-size: 10.5px; font-weight: 700; cursor: pointer; }
.staff-segmented button[data-active] { color: var(--text-primary); background: var(--surface-muted); }
.staff-expense-submit > div { display: flex; gap: 6px; }
.staff-expense-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 9px; color: var(--text-muted); font-size: 10px; }

/* Exact-day leave picker + privacy-safe team calendar. */
.staff-leave-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 7px; }
.staff-leave-balances > span { display: grid; grid-template-columns: 1fr auto; gap: 2px 7px; padding: 9px 10px; border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--surface-muted); }
.staff-leave-balances small { overflow: hidden; color: var(--text-muted); font-size: 9.5px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.staff-leave-balances strong { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--accent); font-size: 19px; }
.staff-leave-balances em { color: var(--text-muted); font-size: 9px; font-style: normal; }
.staff-leave-request { display: flex; flex-direction: column; gap: 10px; }
.staff-leave-types { display: flex; flex-wrap: wrap; gap: 5px; }
.staff-leave-types button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 6px 9px; color: var(--text-muted); background: var(--bg-elevated); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.staff-leave-types button > span { width: 7px; height: 7px; border-radius: 50%; background: #4f8cff; }
.staff-leave-types button[data-tone="1"] > span { background: #f59e0b; }
.staff-leave-types button[data-tone="2"] > span { background: #f43f5e; }
.staff-leave-types button[data-tone="3"] > span { background: #8b5cf6; }
.staff-leave-types button[data-active] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle)); color: var(--text-primary); background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated)); }
.staff-leave-picker { padding: 11px; border: 1px solid var(--border-subtle); border-radius: 11px; background: color-mix(in srgb, var(--text-primary) 2%, var(--bg-elevated)); user-select: none; }
.staff-leave-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.staff-leave-picker-head button,
.staff-leave-picker-foot button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border-subtle); border-radius: 7px; color: var(--text-muted); background: var(--bg-elevated); cursor: pointer; }
.staff-leave-picker-head button { width: 29px; height: 29px; }
.staff-leave-picker-head button:disabled { opacity: .3; cursor: default; }
.staff-leave-picker-head strong { font-size: 13px; }
.staff-leave-weekdays,
.staff-leave-picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.staff-leave-weekdays span { padding: 2px; color: var(--text-muted); text-align: center; font-size: 9px; font-weight: 750; }
.staff-leave-picker-grid { touch-action: none; }
.staff-leave-picker-grid button { min-width: 0; height: 37px; border: 0; border-radius: 8px; color: var(--text-primary); background: var(--surface-muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.staff-leave-picker-grid button[data-weekend] { color: var(--text-muted); background: color-mix(in srgb, var(--surface-muted) 55%, transparent); }
.staff-leave-picker-grid button[data-selected] { color: white; background: var(--accent); box-shadow: 0 2px 7px color-mix(in srgb, var(--accent) 32%, transparent); }
.staff-leave-picker-grid button[data-disabled] { color: color-mix(in srgb, var(--text-muted) 35%, transparent); background: transparent; cursor: default; }
.staff-leave-picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.staff-leave-picker-foot small { color: var(--text-muted); font-size: 9.5px; line-height: 1.35; }
.staff-leave-picker-foot button { flex: none; padding: 4px 6px; font: inherit; font-size: 9.5px; font-weight: 700; }
.staff-leave-tally { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 11px; }
.staff-leave-tally > svg { color: var(--accent); }
.staff-leave-tally strong { color: var(--text-primary); }
.staff-leave-tally small { margin-left: auto; }
.staff-team-calendar { overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 12px; }
.staff-team-calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--border-subtle); }
.staff-team-calendar-head > span { display: flex; flex-direction: column; gap: 2px; }
.staff-team-calendar-head strong { font-size: 13.5px; }
.staff-team-calendar-head small { color: var(--text-muted); font-size: 9.5px; }
.staff-team-calendar-head > div { display: flex; gap: 4px; }
.staff-team-calendar-head button { min-height: 28px; border-color: var(--border-subtle); padding: 5px 7px; background: var(--bg-elevated); }
.staff-team-calendar-weekdays,
.staff-team-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.staff-team-calendar-weekdays { padding: 8px 8px 2px; }
.staff-team-calendar-weekdays span { color: var(--text-muted); text-align: center; font-size: 8.5px; font-weight: 750; }
.staff-team-calendar-grid { padding: 4px 8px 9px; }
.staff-team-calendar-grid > div { min-height: 63px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent); border-radius: 7px; padding: 4px; background: var(--bg-elevated); }
.staff-team-calendar-grid > div[data-weekend] { background: color-mix(in srgb, var(--surface-muted) 55%, transparent); }
.staff-team-calendar-grid > div > span { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 9px; font-weight: 700; }
.staff-team-calendar-grid > div > span b { display: inline-flex; align-items: center; gap: 1px; border-radius: 4px; padding: 1px 3px; color: var(--state-warning); background: color-mix(in srgb, var(--state-warning) 14%, transparent); font-size: 8px; }
.staff-team-calendar-grid > div > div { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; }
.staff-team-calendar-grid button { width: 100%; min-height: 16px; overflow: hidden; justify-content: flex-start; border-color: color-mix(in srgb, #4f8cff 45%, var(--border-subtle)); border-radius: 4px; padding: 2px 4px; color: #377bea; background: color-mix(in srgb, #4f8cff 12%, transparent); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.staff-team-calendar-grid button[data-tone="1"] { color: #9b6700; border-color: #f59e0b66; background: #f59e0b15; }
.staff-team-calendar-grid button[data-tone="2"] { color: #d43b5c; border-color: #f43f5e66; background: #f43f5e12; }
.staff-team-calendar-grid button[data-tone="3"] { color: #7b54dd; border-color: #8b5cf666; background: #8b5cf612; }
.staff-team-calendar-grid button[data-tone="4"] { color: #07836f; border-color: #14b8a666; background: #14b8a612; }
.staff-team-calendar-grid button[data-tone="5"] { color: #bd5d14; border-color: #f9731666; background: #f9731612; }
.staff-team-calendar-grid button[data-status="submitted"] { border-style: dashed; background: transparent; }
.staff-team-calendar-grid > div > div > small { color: var(--text-muted); font-size: 8px; }
.staff-team-calendar-empty { padding: 8px 12px 13px; color: var(--text-muted); text-align: center; font-size: 10.5px; }
.staff-team-calendar-detail { display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; gap: 10px; padding: 10px 11px; border-top: 1px solid var(--border-subtle); }
.staff-team-calendar-detail > span { border-radius: 999px; background: #4f8cff; }
.staff-team-calendar-detail[data-tone="1"] > span { background: #f59e0b; }
.staff-team-calendar-detail[data-tone="2"] > span { background: #f43f5e; }
.staff-team-calendar-detail[data-tone="3"] > span { background: #8b5cf6; }
.staff-team-calendar-detail[data-tone="4"] > span { background: #14b8a6; }
.staff-team-calendar-detail[data-tone="5"] > span { background: #f97316; }
.staff-team-calendar-detail > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staff-team-calendar-detail strong { font-size: 12px; }
.staff-team-calendar-detail small { color: var(--text-muted); font-size: 9.5px; }
.staff-team-calendar-detail em { align-self: flex-start; margin-top: 2px; color: var(--state-success); font-size: 9px; font-style: normal; font-weight: 700; }
.staff-team-calendar-detail em[data-status="submitted"] { color: var(--state-warning); }
.staff-team-calendar-detail > button { width: 28px; min-height: 28px; padding: 4px; }
.staff-team-calendar-detail > section { grid-column: 2 / -1; display: flex; gap: 6px; }
.staff-team-calendar-detail > section button { min-height: 29px; border-color: var(--border-subtle); background: var(--bg-elevated); }
.staff-team-calendar-legend { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 9px; }
.staff-team-calendar-legend span { display: inline-flex; align-items: center; gap: 4px; }
.staff-team-calendar-legend i { width: 12px; height: 8px; border: 1px solid #4f8cff88; border-radius: 2px; background: #4f8cff22; }
.staff-team-calendar-legend i[data-status="submitted"] { border-style: dashed; background: transparent; }
.staff-team-calendar-legend small { margin-left: auto; font-size: 8.5px; }
.staff-leave-history-item { overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 9px; }
.staff-leave-history-row { display: grid; grid-template-columns: 5px minmax(0, 1fr) auto; gap: 9px; padding: 9px; }
.staff-leave-history-row > span { border-radius: 999px; background: var(--accent); }
.staff-leave-history-row > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staff-leave-history-row strong { font-size: 12px; }
.staff-leave-history-row small { color: var(--text-muted); font-size: 10px; }
.staff-leave-history-row em { color: var(--text-muted); font-size: 9.5px; font-style: italic; }
.staff-leave-history-row section { display: flex; align-items: flex-end; flex-direction: column; gap: 5px; }
.staff-leave-history-row section button { display: inline-flex; align-items: center; gap: 3px; border: 0; padding: 2px; color: var(--state-error); background: transparent; font: inherit; font-size: 9px; font-weight: 700; cursor: pointer; }
.staff-leave-history-row section button:has(svg[data-lucide="pencil"]) { color: var(--accent); }
.staff-leave-amend { display: flex; flex-direction: column; gap: 9px; padding: 10px; border-top: 1px solid var(--border-subtle); background: color-mix(in srgb, var(--accent) 3%, var(--bg-elevated)); }
.staff-leave-amend > strong { font-size: 11px; }
.staff-leave-amend > div:last-child { display: flex; justify-content: flex-end; gap: 6px; }
.staff-leave-amend > div:last-child button { min-height: 30px; border-color: var(--border-subtle); background: var(--bg-elevated); }

/* Compact Cockpit approval queue with selection and guarded bulk actions. */
.staff-approvals-cockpit { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.staff-approvals-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.staff-approvals-toolbar > span { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.staff-approvals-toolbar > span strong { font-size: 15px; }
.staff-approvals-toolbar > span small { color: var(--text-muted); font-size: 10.5px; }
.staff-approval-filters { display: flex; flex-wrap: wrap; gap: 3px; }
.staff-approval-filters button { min-height: 27px; border-color: var(--border-subtle); padding: 4px 7px; text-transform: capitalize; }
.staff-approval-filters button[data-active] { color: var(--text-primary); background: var(--surface-muted); }
.staff-approvals-bulk { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle)); border-radius: 9px; background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated)); }
.staff-approvals-bulk label { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.staff-approvals-bulk input,
.staff-approvals-list input { accent-color: var(--accent); }
.staff-approvals-bulk > span { flex: 1; color: var(--text-muted); font-size: 9.5px; }
.staff-approvals-bulk button { min-height: 29px; border-color: var(--border-subtle); background: var(--bg-elevated); }
.staff-approvals-list { display: flex; flex-direction: column; gap: 7px; }
.staff-approvals-list > article { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 9px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated); }
.staff-approvals-list > article[data-selected] { border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle)); background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated)); }
.staff-approvals-list > article > input { margin-top: 4px; }
.staff-approval-kind { margin-top: 1px; border-radius: 5px; padding: 3px 5px; color: #377bea; background: #4f8cff18; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.staff-approval-kind[data-kind="expense"] { color: #9b6700; background: #f59e0b18; }
.staff-approval-kind[data-kind="leave"] { color: #7b54dd; background: #8b5cf618; }
.staff-approval-kind[data-kind="details"] { color: #07836f; background: #14b8a618; }
.staff-approval-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staff-approval-main > small { color: var(--text-muted); font-size: 9px; }
.staff-approval-main > strong { font-size: 12px; }
.staff-approval-main > p { margin: 0; color: var(--text-muted); font-size: 10.5px; }
.staff-approval-main > em { margin-top: 2px; color: var(--text-muted); font-size: 9.5px; }
.staff-approval-value strong { font-size: 12px; white-space: nowrap; }
.staff-approval-actions { grid-column: 3 / -1; display: flex; justify-content: flex-end; gap: 6px; }
.staff-approval-actions button { min-height: 29px; border-color: var(--border-subtle); background: var(--bg-elevated); }
.staff-approval-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 5px 0 0; }
.staff-approval-facts > div { padding: 5px 6px; border-radius: 6px; background: var(--surface-muted); }
.staff-approval-facts dt { color: var(--text-muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.staff-approval-facts dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: 9.5px; }
.staff-payslip-total { margin-top: 5px !important; border-top: 1px solid var(--border-subtle); padding-top: 7px !important; }

@media (max-width: 640px) {
  .staff-cockpit-app { padding: 10px; }
  .staff-cockpit-tabs { width: 100%; }
  .staff-cockpit-tabs button { flex: 1; padding-right: 5px; padding-left: 5px; }
  .staff-mileage-addresses,
  .staff-mileage-fields,
  .staff-expense-grid { grid-template-columns: 1fr; }
  .staff-cockpit-toggle { align-self: stretch; }
  .staff-cockpit-toggle > span { width: 100%; justify-content: center; }
  .staff-route-map { height: 210px; }
  .staff-mileage-submit,
  .staff-expense-submit,
  .staff-leave-submit { align-items: stretch; flex-direction: column; }
  .staff-mileage-submit .staff-cockpit-primary,
  .staff-expense-submit .staff-cockpit-primary,
  .staff-leave-submit .staff-cockpit-primary { width: 100%; }
  .staff-expense-submit > div { width: 100%; }
  .staff-expense-submit > div > button { flex: 1; }
  .staff-history-months > span { grid-template-columns: 1fr auto; }
  .staff-history-months > span small { grid-row: 2; grid-column: 1 / -1; }
  .staff-leave-picker-grid button { height: 34px; }
  .staff-team-calendar-weekdays { display: none; }
  .staff-team-calendar-grid { display: flex; flex-direction: column; gap: 5px; padding: 8px; }
  .staff-team-calendar-grid > div:empty { display: none; }
  .staff-team-calendar-grid > div { min-height: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 6px; }
  .staff-team-calendar-grid > div > div { margin-top: 0; }
  .staff-team-calendar-grid > div > span { align-items: flex-start; }
  .staff-team-calendar-grid > div:not(:has(button)) { display: none; }
  .staff-team-calendar-grid button { min-height: 22px; font-size: 9.5px; }
  .staff-team-calendar-legend { flex-wrap: wrap; }
  .staff-team-calendar-legend small { width: 100%; margin: 0; }
  .staff-approvals-toolbar { align-items: flex-start; flex-direction: column; }
  .staff-approvals-bulk { align-items: stretch; flex-wrap: wrap; }
  .staff-approvals-bulk > span { width: 100%; flex-basis: 100%; }
  .staff-approvals-list > article { grid-template-columns: auto auto minmax(0, 1fr); }
  .staff-approval-value { grid-column: 3; }
  .staff-approval-actions { grid-column: 2 / -1; }
}

/* UOS Mini Tasks — one compact inline object, shared by desktop + phone. */
.uos-mini-tasks {
  width: min(520px, 100%);
  margin: 2px 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, var(--accent) 6%);
}
.uos-mini-tasks-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px 7px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.uos-mini-tasks-list { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.uos-mini-task + .uos-mini-task { border-top: 1px solid color-mix(in srgb, var(--border) 62%, transparent); }
.uos-mini-task-summary {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto 16px;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 0;
  color: var(--text-primary);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.uos-mini-task-summary:hover { background: color-mix(in srgb, var(--text-primary) 4%, transparent); }
.uos-mini-task-mark { display: inline-flex; color: var(--text-tertiary); }
.uos-mini-task.is-in_progress .uos-mini-task-mark { color: #f59e0b; }
.uos-mini-task.is-done .uos-mini-task-mark { color: #22a06b; }
.uos-mini-task-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-mini-task.is-done .uos-mini-task-title { color: var(--text-secondary); text-decoration: line-through; }
.uos-mini-task-status {
  grid-column: 4;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.uos-mini-task-status.is-in_progress { color: #9a5b00; background: color-mix(in srgb, #f59e0b 17%, transparent); }
.uos-mini-task-status.is-done { color: #08784d; background: color-mix(in srgb, #22a06b 15%, transparent); }
/* The claim avatar (col 3) is only in the DOM when someone claimed the task — the status pill
   and chevron pin to their own columns so an absent avatar can't shift them into its track. */
.uos-mini-task-claim { display: inline-flex; grid-column: 3; }
.uos-mini-task-avatar { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; object-fit: cover; }
.uos-mini-task-chevron { grid-column: 5; color: var(--text-tertiary); transition: transform .15s ease; }
.uos-mini-task.is-open .uos-mini-task-chevron { transform: rotate(180deg); }
.uos-mini-task-detail { padding: 0 11px 11px 36px; }
.uos-mini-task-detail p { margin: 0 0 8px; color: var(--text-secondary); font-size: 12px; line-height: 1.45; white-space: pre-wrap; }
.uos-mini-task-detail p.is-empty { color: var(--text-tertiary); font-style: italic; }
.uos-mini-task-source { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 9px; color: var(--accent); font-size: 12px; font-weight: 700; text-decoration: none; }
.uos-mini-task-source:hover { text-decoration: underline; }
.uos-mini-task-owner { margin-bottom: 8px; color: var(--text-secondary); font-size: 11px; }
.uos-mini-task-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.uos-mini-task-actions button {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-secondary);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
}
.uos-mini-task-actions button.is-active { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--text-primary); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.uos-mini-task-actions button:disabled { cursor: default; opacity: .58; }
.uos-mini-tasks-error { padding: 0 11px 9px 36px; color: var(--danger, #dc2626); font-size: 11px; }

.uos-mini-composer-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 12, 20, .48);
  backdrop-filter: blur(5px);
}
.uos-mini-composer {
  width: min(570px, 100%);
  max-height: min(720px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  border-radius: 17px;
  color: var(--text-primary);
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}
.uos-mini-composer-head { display: grid; grid-template-columns: 38px 1fr 34px; gap: 10px; align-items: start; padding: 17px 18px 13px; border-bottom: 1px solid var(--border); }
.uos-mini-composer-head h2 { margin: 0; font-size: 17px; line-height: 1.2; }
.uos-mini-composer-head p { margin: 4px 0 0; color: var(--text-secondary); font-size: 12px; line-height: 1.35; }
.uos-mini-composer-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.uos-mini-composer-head > button, .uos-mini-composer-remove { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--text-secondary); background: transparent; }
.uos-mini-composer-head > button:hover, .uos-mini-composer-remove:hover { background: color-mix(in srgb, var(--text-primary) 7%, transparent); }
.uos-mini-composer-list { min-height: 0; overflow: auto; padding: 13px 18px 4px; }
.uos-mini-composer-row { display: grid; grid-template-columns: 25px minmax(0, 1fr) 32px; gap: 8px; align-items: start; margin-bottom: 10px; }
.uos-mini-composer-num { width: 23px; height: 23px; display: grid; place-items: center; margin-top: 5px; border-radius: 50%; color: var(--text-secondary); background: color-mix(in srgb, var(--text-primary) 7%, transparent); font-size: 11px; font-weight: 700; }
.uos-mini-composer-row input, .uos-mini-composer-row textarea { width: 100%; border: 1px solid var(--border); color: var(--text-primary); background: var(--surface); outline: none; }
.uos-mini-composer-row > div > input:first-child { height: 35px; padding: 7px 9px; border-radius: 9px 9px 0 0; font-size: 13px; font-weight: 600; }
.uos-mini-composer-row textarea { min-height: 48px; resize: vertical; margin-top: -1px; padding: 7px 9px; border-radius: 0 0 9px 9px; font: inherit; font-size: 12px; }
.uos-mini-composer-row input:focus, .uos-mini-composer-row textarea:focus { position: relative; z-index: 1; border-color: color-mix(in srgb, var(--accent) 65%, var(--border)); }
.uos-mini-composer-add { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: 0 18px 14px 51px; padding: 7px 9px; border: 0; border-radius: 8px; color: var(--accent); background: transparent; font-size: 12px; font-weight: 700; }
.uos-mini-composer-add:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.uos-mini-composer-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.uos-mini-composer-foot button { min-height: 34px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--text-primary); background: var(--surface); font-size: 12px; font-weight: 700; }
.uos-mini-composer-foot button.is-primary { border-color: var(--accent); color: white; background: var(--accent); }
.uos-mini-composer-foot button:disabled, .uos-mini-composer-add:disabled { opacity: .48; }

@media (max-width: 640px) {
  .uos-mini-composer-overlay { place-items: end center; padding: 0; }
  .uos-mini-composer { width: 100%; max-height: min(82dvh, 720px); border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .uos-mini-composer-head { padding: 16px 16px 13px; }
  .uos-mini-composer-list { padding-inline: 14px; }
  .uos-mini-composer-add { margin-left: 47px; }
  .uos-mini-task-summary { gap: 5px; }
  .uos-mini-task-status { font-size: 9px; }
}

/* Temporary GPT-Live-Transcribe call notes. This surface is intentionally compact: it never
   displaces the primary call controls, and it never pretends provisional text is the saved call
   record. Shared across desktop PSTN, phone-web PSTN and desktop UOS call ownership. */
.live-call-transcript {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: var(--text-primary, currentColor);
}
.live-call-transcript-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated, #18181b) 88%, transparent);
  color: var(--text-secondary, #a1a1aa);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.live-call-transcript-toggle:hover,
.live-call-transcript.is-active .live-call-transcript-toggle {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 55%, transparent);
  color: var(--text-primary, #f4f4f5);
  background: color-mix(in srgb, var(--accent, #6366f1) 12%, var(--bg-elevated, #18181b));
}
.live-call-transcript-toggle i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state-success, #4ade80);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--state-success, #4ade80) 14%, transparent);
}
.live-call-transcript-spin {
  animation: live-call-transcript-spin 0.8s linear infinite;
}
@keyframes live-call-transcript-spin {
  to { transform: rotate(360deg); }
}
.live-call-transcript-body {
  min-width: 0;
  max-height: 176px;
  overflow: auto;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 28%, var(--border-subtle, transparent));
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-elevated, #18181b) 94%, transparent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}
.live-call-transcript-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted, #a1a1aa);
  font-size: 11px;
  font-weight: 700;
}
.live-call-transcript-head button {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.live-call-transcript-head button:hover {
  background: color-mix(in srgb, currentColor 10%, transparent);
}
.live-call-transcript-copy {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}
.live-call-transcript-copy p {
  margin: 0;
  color: var(--text-primary, #f4f4f5);
  font-size: 13px;
  line-height: 1.42;
  opacity: 0.68;
}
.live-call-transcript-copy p[data-final] { opacity: 1; }
.live-call-transcript-body small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted, #71717a);
  font-size: 10px;
  line-height: 1.35;
}
.live-call-transcript.is-desktop {
  padding: 0 10px 9px;
  align-items: flex-start;
}
.live-call-transcript.is-desktop .live-call-transcript-body {
  width: min(460px, calc(100vw - 48px));
}
.live-call-transcript.is-uos {
  width: 100%;
  align-items: center;
}
.live-call-transcript.is-uos .live-call-transcript-body {
  width: 100%;
}
.live-call-transcript.is-phone {
  position: relative;
  z-index: 1;
  flex: none;
  width: min(420px, calc(100% - 36px));
  margin: 14px auto 0;
  align-items: center;
}
.live-call-transcript.is-phone .live-call-transcript-body {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 2;
  width: 100%;
  max-height: min(190px, 24vh);
  background: color-mix(in srgb, var(--ph-call-chipbg, #18181b) 92%, transparent);
}
.live-call-transcript.is-phone .live-call-transcript-toggle {
  min-height: 42px;
  padding-inline: 14px;
}
.live-call-transcript.is-phone .live-call-transcript-head button {
  width: 36px;
  height: 36px;
}
@media (max-height: 720px) {
  .live-call-transcript.is-phone {
    margin-top: 8px;
  }
  .live-call-transcript.is-phone .live-call-transcript-body {
    max-height: 110px;
  }
}

.properties-editor-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: min(64vh, 520px);
  padding: 2rem 1.25rem;
  gap: 0.6rem;
  color: var(--text-soft);
}

.properties-editor-empty svg,
.properties-editor-empty .side-nav-icon {
  width: 40px;
  height: 40px;
  opacity: 0.55;
}

.properties-editor-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.25rem 0 0;
}

.properties-editor-message {
  padding: 1rem 0;
}

.properties-load-error {
  min-height: min(52vh, 560px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.65rem;
  padding: 2rem;
  text-align: center;
  background: color-mix(in srgb, var(--bg-elevated) 96%, var(--state-error) 4%);
  color: var(--text-soft);
}

.properties-load-error h2,
.properties-load-error p {
  margin: 0;
}

.properties-load-error h2 {
  color: var(--text-primary);
  font-size: 1.05rem;
}

.properties-load-error p {
  max-width: 44ch;
  font-size: 0.86rem;
}

.properties-load-retry {
  margin-top: 0.25rem;
  min-height: 36px;
  padding: 0.45rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 42%, var(--border-subtle));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--brand-primary) 18%, var(--bg-elevated));
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
}

.properties-load-retry:hover {
  background: color-mix(in srgb, var(--brand-primary) 26%, var(--bg-elevated));
}

.properties-load-retry:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.properties-editor-toast {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
}

.properties-editor-banner {
  background: color-mix(in srgb, var(--state-warning) 18%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--state-warning) 35%, var(--border-subtle));
  color: var(--text-soft);
  font-size: 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
}

.properties-section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

.properties-section-toolbar .btn {
  flex-shrink: 0;
  font-size: 0.75rem;
}

.properties-editor-scroll {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 2px;
  padding-bottom: 2px;
}

.properties-editor-head {
  margin-bottom: 0.85rem;
}

.properties-editor-h1 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.properties-editor-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
}

.properties-section-card {
  padding: 0.9rem 1rem !important;
  /* "Frustum culling" for off-screen cards — the browser skips paint, layout
     and style calculation when the card is outside the viewport. Native CSS,
     zero JS. contain-intrinsic-size reserves vertical space so scrollbars and
     anchor jumps don't twitch as cards enter/leave the viewport. */
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}

.properties-section-h2 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  margin: 0 0 0.45rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

.properties-section-h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

/* Space between in-card subsections (descriptions, location, settings blocks, etc.) */
.properties-subsection {
  margin-top: 0.95rem;
  padding: 1rem 0.95rem 1.02rem;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 98%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 84%, var(--bg-elevated));
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--text-muted) 8%, transparent),
    0 1px 0 color-mix(in srgb, black 18%, transparent);
}

.properties-subsection:first-of-type {
  margin-top: 0.5rem;
}

.properties-subsection + .properties-subsection {
  margin-top: 1.15rem;
}

.card.properties-section-card > .properties-subsection + .properties-subsection {
  position: relative;
}

.card.properties-section-card > .properties-subsection + .properties-subsection::before {
  content: attr(data-section-label);
  position: absolute;
  top: -0.72rem;
  left: 0.9rem;
  padding: 0 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-deep);
}

.properties-subsection > .properties-section-h3 {
  margin: 0 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.properties-subsection > .properties-section-h3::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--ring) 56%, var(--text-muted));
  transform: translateY(-0.5px);
}

.properties-subsection > .properties-section-lead {
  margin: 0 0 0.85rem;
  max-width: 72ch;
  color: var(--text-muted);
}

.card.properties-section-card > .properties-subsection:first-of-type {
  margin-top: 0.5rem;
}

.properties-label-with-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
}

.properties-hint-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.1rem;
}

.properties-hint-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 0.6rem;
  line-height: 1;
  font-weight: 700;
  color: #93c5fd;
  border: 1px solid color-mix(in srgb, #93c5fd 50%, var(--border-subtle));
  border-radius: 999px;
  cursor: help;
  flex-shrink: 0;
  background: color-mix(in srgb, #0f172a 40%, transparent);
}

.properties-hint-bubble {
  position: absolute;
  z-index: 50;
  left: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  max-width: min(320px, 80vw);
  padding: 0.45rem 0.6rem;
  font-size: 0.75rem;
  line-height: 1.4;
  font-weight: 400;
  text-transform: none;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  pointer-events: none;
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.properties-hint-wrap:hover .properties-hint-bubble,
.properties-hint-wrap:focus-within .properties-hint-bubble {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.properties-hint-ico:hover,
.properties-hint-ico:focus-visible {
  color: #e0e7ff;
  border-color: #93c5fd;
  outline: none;
}

/* Disabled-field affordance — washes out the row when its precondition is off. */
.is-field-disabled {
  opacity: 0.62;
}

.properties-currency-input.is-disabled {
  background: color-mix(in srgb, var(--bg-deep) 55%, var(--surface-muted));
}

.properties-currency-input.is-disabled .properties-currency-prefix {
  color: var(--text-muted);
}

/* Combined Listing meta card — nickname + PMS status pill in a single row.
   Opt out of the section card's content-visibility containment so the hint
   tooltips can escape the card's box (otherwise paint containment clips
   anything that would render outside the card). The meta card is a single
   row at the top of the editor, so the perf cost of skipping CV is zero. */
.properties-meta-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 14rem);
  align-items: stretch;
  gap: 1.25rem;
  content-visibility: visible;
  contain: none;
  overflow: visible;
}

.properties-meta-card-identity {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.properties-meta-card-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

.properties-meta-card-nickname {
  font-size: 0.9rem !important;
  font-weight: 600;
  letter-spacing: -0.005em;
  width: 100%;
  max-width: 32rem;
  flex: 1;
}

.properties-meta-card-status {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: stretch;
  min-width: 0;
}

.properties-meta-card-status-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-soft);
}

/* PMS pill in the meta card: stretches full height to match the nickname
   field, signalling importance. Override the compact pill defaults. */
.properties-meta-card-status .properties-pms-pill-toggle {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  justify-content: center;
  gap: 0.55rem;
}

.properties-meta-card-status .properties-pms-pill-dot {
  width: 0.7rem;
  height: 0.7rem;
}

/* Tooltip on the PMS label sits near the right edge of the editor area; the
   right nav can sit over the default left-anchored bubble. Anchor right so
   the bubble opens *into* the meta card, and bump z-index so it always wins. */
.properties-meta-card-status .properties-hint-bubble {
  left: auto;
  right: 0;
  z-index: 1000;
}

@media (max-width: 720px) {
  .properties-meta-card {
    grid-template-columns: 1fr;
  }
  .properties-meta-card-status {
    align-items: stretch;
  }}

/* Belt-and-braces: any hint bubble in the editor needs to escape the right
   nav stacking context. */
.properties-editor .properties-hint-bubble {
  z-index: 1000;
}

.properties-header-identity {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.properties-header-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}

.properties-header-field--title {
  width: 100%;
}

.properties-desc-textarea {
  field-sizing: content;
  min-height: 3.5rem;
  width: 100%;
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.5;
  resize: vertical;
}

/* ── Descriptions section: grouped, premium layout ──────────────────────── */

.properties-desc-section {
  display: grid;
  gap: 0.85rem;
}

.properties-desc-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
}

.properties-desc-section-copy {
  min-width: 0;
}

.properties-desc-section-copy .properties-section-lead {
  margin: 0;
}

.properties-desc-progress {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.properties-desc-progress-bar {
  width: 8rem;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-subtle) 60%, var(--bg-input));
  overflow: hidden;
}

.properties-desc-progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--brand-primary) 70%, transparent),
    var(--brand-primary)
  );
  border-radius: inherit;
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.properties-desc-progress-label {
  font-size: 0.74rem;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.properties-desc-progress-label strong {
  color: var(--text-primary);
  font-weight: 650;
}

.properties-desc-groups {
  display: grid;
  gap: 0.55rem;
}

.properties-desc-group {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--table-surface) 94%, var(--bg-elevated));
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.properties-desc-group:hover {
  border-color: color-mix(in srgb, var(--ring) 16%, var(--border-subtle));
}

.properties-desc-group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.12s ease;
}

.properties-desc-group-head:hover {
  background: color-mix(in srgb, var(--border-subtle) 22%, transparent);
}

.properties-desc-group-head:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 60%, transparent);
  outline-offset: -2px;
}

.properties-desc-group-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-soft);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.properties-desc-group.is-collapsed .properties-desc-group-chevron {
  transform: rotate(-90deg);
}

.properties-desc-group-meta {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.properties-desc-group-label {
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.2;
}

.properties-desc-group-hint {
  font-size: 0.7rem;
  line-height: 1.3;
}

.properties-desc-group-count {
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--border-subtle) 40%, var(--table-surface));
  border: 1px solid var(--border-subtle);
}

.properties-desc-group-count.is-complete {
  color: color-mix(in srgb, var(--state-success) 80%, var(--text-primary));
  background: color-mix(in srgb, var(--state-success) 14%, var(--table-surface));
  border-color: color-mix(in srgb, var(--state-success) 35%, var(--border-subtle));
}

.properties-desc-group-body {
  display: grid;
  gap: 0.85rem;
  padding: 0 0.85rem 0.85rem;
  border-top: 1px dashed color-mix(in srgb, var(--border-subtle) 60%, transparent);
  padding-top: 0.85rem;
}

.properties-desc-field {
  display: grid;
  gap: 0.32rem;
  margin: 0;
}

.properties-desc-field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.properties-desc-field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.005em;
  /* Override .properties-compact-field span text-transform: capitalize */
  text-transform: none;
}

.properties-desc-field-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-subtle) 70%, var(--text-soft));
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.properties-desc-field-dot.is-filled {
  background: color-mix(in srgb, var(--brand-primary) 85%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.properties-desc-counter {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

.properties-desc-counter.is-warn {
  color: #fbbf24;
}

.properties-desc-counter.is-over {
  color: #f87171;
  font-weight: 600;
}

/* ── Premium input + textarea styling, scoped to the descriptions section ─ */

.properties-desc-field .properties-input-text {
  width: 100%;
  appearance: none;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border-strong) 75%, var(--border-subtle)) !important;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-input) 96%, var(--bg-elevated)) 0%,
      var(--bg-input) 100%
    ) !important;
  color: var(--text-primary);
  padding: 0.55rem 0.7rem !important;
  font-size: 0.86rem !important;
  line-height: 1.55;
  font-family: inherit;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 4%, transparent),
    0 1px 1.5px color-mix(in srgb, black 18%, transparent);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
  outline: none;
}

.properties-desc-field .properties-input-text:hover:not(:focus):not([aria-invalid="true"]) {
  border-color: color-mix(in srgb, var(--border-strong) 95%, var(--text-soft)) !important;
}

.properties-desc-field .properties-input-text:focus {
  border-color: color-mix(in srgb, var(--ring) 75%, var(--border-strong)) !important;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 5%, transparent) !important;
  background: var(--bg-input) !important;
}

.properties-desc-field .properties-input-text::placeholder {
  color: color-mix(in srgb, var(--text-muted) 70%, transparent);
  font-style: normal;
}

.properties-desc-field textarea.properties-input-text {
  min-height: 4.6rem;
  field-sizing: content;
  resize: vertical;
}

.properties-desc-title-input {
  font-size: 1.02rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em;
  padding: 0.6rem 0.75rem !important;
}

.properties-desc-field .properties-input-text[aria-invalid="true"] {
  border-color: color-mix(in srgb, #f87171 65%, var(--border-strong)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, #f87171 20%, transparent) !important;
}

@media (max-width: 720px) {
  .properties-desc-section-head {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .properties-desc-progress {
    justify-content: start;
  }}

.properties-intel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 130;
}

.properties-intel-export {
  position: relative;
}

.properties-intel-export .quick-filter-menu {
  z-index: 260;
}

.properties-intel-hint {
  font-size: 0.72rem;
}

.properties-intel-surface {
  margin-top: 0.25rem;
  border: 1px solid color-mix(in srgb, #6f7eff 36%, var(--border-subtle));
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, #1f2a4b 35%, var(--bg-elevated)) 0%,
    color-mix(in srgb, var(--bg-elevated) 84%, var(--table-surface)) 100%
  );
  padding: 0.8rem 0.85rem 0.85rem;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #6f7eff 22%, transparent),
    0 16px 36px rgba(9, 13, 21, 0.24) inset;
}

.properties-intel-modal {
  width: min(1220px, 96vw);
  height: min(92vh, 1040px);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1rem 1.1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.properties-intel-modal .property-intel-editor-surface {
  min-height: 0;
  max-height: none;
  flex: 1;
  background: color-mix(in srgb, var(--bg-elevated) 78%, var(--table-surface));
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 12px;
  font-family: inherit;
}

.properties-intel-modal .property-intel-editor .ProseMirror {
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.62;
  padding: 1rem 1.1rem 1.15rem;
  min-height: 62vh;
}

.properties-intel-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.properties-intel-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.properties-intel-modal-body .property-intel-editor-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.properties-intel-modal-body .property-intel-editor-wrap .properties-md-hint {
  margin-bottom: 0.35rem;
}

.properties-intel-modal-body .property-intel-editor-wrap .property-intel-editor-surface {
  flex: 1;
  min-height: 0;
}

.properties-modal-backdrop--intel {
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.properties-inline-link {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  font: inherit;
}

.properties-inline-link:hover {
  color: #c7d2fe;
}

.properties-fee-id-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.properties-inline-code {
  font-size: 0.72em;
  font-family: ui-monospace, monospace;
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: var(--table-surface);
}

.properties-fees-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.4rem 0 0.5rem;
}

.properties-fee-row {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 0.6fr) auto auto minmax(0, 0.5fr) auto;
  gap: 0.35rem 0.4rem;
  align-items: end;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  background: var(--table-surface);
  border: 1px solid var(--border-subtle);
}

@media (max-width: 900px) {
  .properties-fee-row {
    grid-template-columns: 1fr 1fr;
  }}

.properties-fee-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.3rem;
}

.properties-fee-check input {
  margin: 0;
}

.properties-fees-empty {
  font-size: 0.75rem;
  margin: 0.25rem 0 0.5rem;
}

.properties-mgmt-row {
  align-items: end;
}

.properties-mgmt-add {
  display: flex;
  align-items: center;
  padding-bottom: 0.1rem;
}

.properties-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: color-mix(in srgb, #020617 65%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.properties-modal {
  min-width: min(100%, 360px);
  max-width: 420px;
  padding: 1rem 1.1rem;
}

.properties-modal--registry {
  max-width: min(100%, 440px);
  border: 1px solid var(--nav-border-accent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--table-surface) 100%, #0f172a) 0%,
    var(--bg-deep) 100%
  );
  box-shadow: 0 18px 48px color-mix(in srgb, #000 45%, transparent);
}

.properties-registry-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.4rem 0 0.15rem;
}

.properties-registry-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Owner: searchable dropdown */
.properties-owner-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.properties-combobox {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.properties-combobox-inner {
  position: relative;
}

.properties-combobox-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.properties-combobox-trigger:hover,
.properties-combobox-trigger:focus-visible {
  border-color: color-mix(in srgb, #6366f1 50%, var(--border-subtle));
  outline: none;
}

.properties-combobox-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.properties-combobox-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  opacity: 0.7;
}

.properties-combobox-panel {
  position: absolute;
  z-index: 130;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 14px 36px color-mix(in srgb, #000 35%, transparent);
  padding: 0.4rem 0.45rem 0.5rem;
  max-height: min(280px, 50vh);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

[data-theme="light"] .properties-combobox-panel {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.properties-combobox-search {
  width: 100%;
}

.properties-combobox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  min-height: 0;
  flex: 1;
  max-height: 200px;
}

.properties-combobox-empty {
  padding: 0.5rem 0.45rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.properties-combobox-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.45rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
}

.properties-combobox-option:hover,
.properties-combobox-option:focus-visible {
  background: color-mix(in srgb, #6366f1 12%, var(--table-surface));
  outline: none;
}

.properties-combobox-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.4rem;
}

.properties-combobox-new {
  width: 100%;
  font-size: 0.75rem;
}

.properties-owner-contact {
  margin-top: 0.15rem;
}

.properties-modal-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.properties-modal-error {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 0.45rem;
  background: rgba(239, 68, 68, 0.12);
  color: rgb(220, 38, 38);
  font-size: 0.8rem;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.properties-modal-success {
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 0.45rem;
  background: rgba(34, 197, 94, 0.12);
  color: rgb(22, 163, 74);
  font-size: 0.8rem;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.properties-modal-progress {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
}

.properties-modal-progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 999px;
  overflow: hidden;
}

.properties-modal-progress-bar-fill {
  position: absolute;
  inset: 0;
  width: 35%;
  background: linear-gradient(90deg, transparent, var(--accent, #2563eb), transparent);
  animation: properties-modal-progress-slide 1.2s ease-in-out infinite;
}

@keyframes properties-modal-progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.properties-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 0.45rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2, transparent);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.properties-icon-button:hover {
  color: rgb(220, 38, 38);
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.08);
}

.properties-icon-button svg {
  width: 1rem;
  height: 1rem;
}

.properties-fee-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.properties-fee-info {
  display: inline-flex;
  color: var(--text-muted);
  cursor: help;
}

.properties-fee-info svg {
  width: 0.95rem;
  height: 0.95rem;
}

.properties-fee-info:hover {
  color: var(--text-soft, var(--text-muted));
}

.workspace-list-toolbar-registry {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  align-items: center;
}

.workspace-list-toolbar-registry input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-2);
  color: inherit;
  font-size: 0.84rem;
}

.workspace-registry-add {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
}

.workspace-registry-filter-wrap {
  position: relative;
}

.workspace-registry-filter-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
}

.workspace-registry-filter-btn.is-active {
  border-color: color-mix(in srgb, var(--ring) 40%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ring) 24%, transparent);
}

.workspace-registry-filter-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 176px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: 0 14px 28px color-mix(in srgb, black 35%, transparent);
  padding: 0.3rem;
  display: grid;
  gap: 0.16rem;
  z-index: 120;
}

.workspace-registry-filter-option {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  border-radius: 7px;
  font-size: 0.75rem;
  padding: 0.34rem 0.44rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.workspace-registry-filter-option:hover {
  border-color: color-mix(in srgb, var(--ring) 25%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary-gradient-soft) 34%, var(--bg-input));
}

.workspace-registry-filter-option.is-active {
  border-color: color-mix(in srgb, var(--ring) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary-gradient-soft) 45%, var(--bg-input));
}

.workspace-registry-filter-clear {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.12rem;
  padding: 0.34rem 0.44rem 0.14rem;
  background: transparent;
  text-align: left;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.workspace-registry-filter-clear:hover {
  color: var(--text-primary);
}

.workspace-list-card--registry {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.7rem;
  border-radius: 0.5rem;
  background: var(--surface-2);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 120ms ease, border-color 120ms ease;
}

.workspace-list-card--registry:hover {
  background: var(--surface-3, var(--surface-2));
  border-color: var(--border-subtle);
}

.workspace-list-card--registry.is-active {
  background: var(--accent-subtle, var(--surface-3));
  border-color: var(--accent, var(--border-strong, var(--border-subtle)));
}

.workspace-list-card--registry .workspace-list-card-body {
  display: grid;
  gap: 0.15rem;
}

.workspace-list-card--registry .workspace-list-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.registry-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
}

.registry-page .card {
  padding: 1.25rem;
}

.registry-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 1.2rem;
  max-width: 720px;
}

.registry-editor-grid .field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.registry-editor-grid .field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.registry-editor-grid .field-full {
  grid-column: 1 / -1;
}

/* Collapse the editor grid before the pane gets cramped — the same breakpoint
   the settlement-waterfall page uses. Applies to every registry editor
   (fees, chart of accounts, waterfall). */
@media (max-width: 1180px) {
  .registry-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.chart-of-accounts-landing {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* Full pane-3 width — a capped card in a wide pane reads as "compressed into the
   corner" (Hakim 2026-07-16); prose inside keeps its own readable max-widths. */
.accounts-readout-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
/* One company-side answer across Listing, grouped and Accounting Financials.
   The three plain-English facts stay visible; accountant proof is one
   disclosure underneath. Theme tokens only and single-column on phones. */
.company-money-summary {
  min-width: 0;
  display: grid;
  gap: 0.9rem;
  padding: 1.05rem 1.15rem;
  border-color: color-mix(in srgb, var(--accent, #6366f1) 30%, var(--border-subtle));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent, #6366f1) 7%, transparent), transparent 52%),
    var(--bg-elevated);
}
.company-money-summary.is-embedded {
  padding: 0;
  border: 0;
  background: transparent;
}
.company-money-summary.is-error {
  border-color: color-mix(in srgb, var(--state-danger, #dc2626) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-danger, #dc2626) 6%, var(--bg-elevated));
}
.company-money-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.company-money-summary-head > div {
  min-width: 0;
  max-width: 720px;
}
.company-money-summary-kicker {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--accent, #6366f1);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.company-money-summary-head h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
}
.company-money-summary-head p {
  margin: 0.32rem 0 0;
  color: var(--text-muted, var(--color-text-muted));
  font-size: 0.8rem;
  line-height: 1.45;
}
.company-money-summary-status {
  flex: 0 0 auto;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted, var(--color-text-muted));
  background: var(--surface-muted);
  font-size: 0.7rem;
  font-weight: 650;
}
.company-money-summary-status.is-warning {
  color: var(--state-warning, #b45309);
  border-color: color-mix(in srgb, var(--state-warning, #d97706) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning, #d97706) 8%, var(--surface-muted));
}
.company-money-summary-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.company-money-summary-tile {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 0.16rem;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 92%, transparent);
}
.company-money-summary-tile > span {
  color: var(--text-muted, var(--color-text-muted));
  font-size: 0.69rem;
  font-weight: 750;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.company-money-summary-tile > strong {
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: clamp(1.18rem, 1.8vw, 1.5rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.company-money-summary-tile > small {
  color: var(--text-muted, var(--color-text-muted));
  font-size: 0.72rem;
  line-height: 1.35;
}
.company-money-summary-tile.is-primary {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 52%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent, #6366f1) 9%, var(--surface-muted));
}
.company-money-summary-tile.is-warning {
  border-color: color-mix(in srgb, var(--state-warning, #d97706) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning, #d97706) 7%, var(--surface-muted));
}
.company-money-summary-equation,
.company-money-summary-note,
.company-money-summary-final-note {
  margin: 0;
  line-height: 1.45;
}
.company-money-summary-equation {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--surface-muted);
  font-size: 0.79rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.company-money-summary-note,
.company-money-summary-final-note,
.company-money-summary-detail > p {
  color: var(--text-muted, var(--color-text-muted));
  font-size: 0.75rem;
}
.company-money-summary-warning {
  margin: 0;
  padding: 0.58rem 0.68rem;
  border: 1px solid color-mix(in srgb, var(--state-warning, #d97706) 42%, var(--border-subtle));
  border-radius: 8px;
  color: var(--state-warning, #b45309);
  background: color-mix(in srgb, var(--state-warning, #d97706) 7%, transparent);
  font-size: 0.76rem;
  line-height: 1.45;
}
.company-money-summary-detail {
  padding-top: 0.15rem;
}
.company-money-summary-detail > summary {
  width: fit-content;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 650;
}
.company-money-summary-detail > p {
  margin: 0.55rem 0;
}
.company-money-summary-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.company-money-summary-table-wrap table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.company-money-summary-table-wrap th,
.company-money-summary-table-wrap td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
}
.company-money-summary-table-wrap th:first-child,
.company-money-summary-table-wrap td:first-child {
  text-align: left;
}
.company-money-summary-table-wrap th {
  color: var(--text-muted, var(--color-text-muted));
  font-size: 0.67rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.company-money-summary-table-wrap td small {
  display: block;
  margin-top: 0.1rem;
  color: var(--text-muted, var(--color-text-muted));
  text-transform: capitalize;
}
@media (max-width: 900px) {
  .company-money-summary-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .company-money-summary {
    padding: 0.9rem;
  }
  .company-money-summary.is-embedded {
    padding: 0;
  }
  .company-money-summary-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .company-money-summary-head > .btn {
    width: 100%;
  }
}
.chart-of-accounts-landing .registry-empty {
  max-width: none;
}
.company-cash-card {
  position: relative;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}
.company-cash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.company-cash-head h2,
.company-cash-modal-card h3 {
  margin: 0 0 0.35rem;
}
.company-cash-head p {
  max-width: 680px;
  margin: 0;
}
.company-cash-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: 10px;
}
.company-cash-alert p {
  margin: 0.2rem 0 0;
  max-width: 760px;
  font-size: 0.84rem;
}
.company-cash-alert.is-warning,
.company-cash-secondary-facts .is-warning {
  color: var(--state-warning, #b45309);
  background: color-mix(in srgb, var(--state-warning, #d97706) 8%, transparent);
}
.company-cash-alert.is-danger {
  color: var(--state-danger, #dc2626);
  background: color-mix(in srgb, var(--state-danger, #dc2626) 8%, transparent);
}
.company-cash-issue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--state-danger, #dc2626) 48%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--state-danger, #dc2626) 7%, transparent);
}
.company-cash-issue p {
  max-width: 820px;
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
}
.company-cash-issue-proof {
  color: var(--text-muted, var(--color-text-muted));
}
.company-cash-totals-held {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  color: var(--state-warning, #b45309);
  background: color-mix(in srgb, var(--state-warning, #d97706) 8%, transparent);
  font-size: 0.84rem;
  font-weight: 600;
}
.company-cash-proof {
  width: fit-content;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 7px;
  color: var(--state-success, #16a34a);
  background: color-mix(in srgb, var(--state-success, #16a34a) 10%, transparent);
  font-size: 0.78rem;
  font-weight: 600;
}
.company-cash-sync-errors {
  color: var(--state-danger, #dc2626);
  font-size: 0.84rem;
}
.company-cash-sync-errors ul {
  margin: 0.5rem 0 0;
}
.company-cash-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.company-cash-tile {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: 10px;
  background: var(--surface-muted);
}
.company-cash-tile span {
  color: var(--text-muted, var(--color-text-muted));
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.company-cash-tile strong {
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
}
.company-cash-tile small {
  color: var(--text-muted, var(--color-text-muted));
  font-size: 0.74rem;
}
.company-cash-tile.is-primary {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-muted));
}
.company-cash-equation {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--surface-muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.company-cash-settings {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: 10px;
}
.company-cash-settings summary,
.company-cash-history details summary {
  cursor: pointer;
  font-weight: 650;
}
.company-cash-settings > p {
  max-width: 760px;
  margin: 0.55rem 0 0.8rem;
  font-size: 0.82rem;
}
.company-cash-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 0.75rem;
}
.company-cash-account-table-wrap {
  overflow-x: auto;
}
.company-cash-account-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.company-cash-account-table th,
.company-cash-account-table td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--border-subtle, var(--border-color));
  text-align: right;
  white-space: nowrap;
}
.company-cash-account-table th:first-child,
.company-cash-account-table td:first-child {
  text-align: left;
  white-space: normal;
}
.company-cash-account-table th {
  color: var(--text-muted, var(--color-text-muted));
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.company-cash-account-table td small {
  display: block;
  margin-top: 0.12rem;
  color: var(--text-muted, var(--color-text-muted));
  text-transform: capitalize;
}
.company-cash-secondary-facts {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.company-cash-secondary-facts span {
  padding: 0.4rem 0.55rem;
  border-radius: 7px;
  background: var(--surface-muted);
}
.company-cash-history,
.company-cash-event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.company-cash-history > li {
  padding: 0.8rem 0;
  border-top: 1px solid var(--border-subtle, var(--border-color));
}
.company-cash-history-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.company-cash-history-main > div {
  display: grid;
  gap: 0.15rem;
}
.company-cash-history-main span:not(.company-cash-status),
.company-cash-history > li > p {
  font-size: 0.8rem;
}
.company-cash-status {
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.company-cash-status.is-completed {
  color: var(--state-success, #16a34a);
  background: color-mix(in srgb, var(--state-success, #16a34a) 10%, transparent);
}
.company-cash-status.is-scheduled {
  color: var(--state-warning, #b45309);
  background: color-mix(in srgb, var(--state-warning, #d97706) 10%, transparent);
}
.company-cash-status.is-cancelled {
  color: var(--text-muted, var(--color-text-muted));
  background: var(--surface-muted);
}
.company-cash-event-list {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
}
.company-cash-transition {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.7rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--surface-muted);
}
.company-cash-transition-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.company-cash-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.62);
}
.company-cash-modal-card {
  width: min(720px, 100%);
  max-height: min(88vh, 840px);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid var(--border-subtle, var(--border-color));
  border-radius: 14px;
  background: var(--bg-elevated);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
.company-cash-modal-card > header,
.company-cash-modal-card > footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.company-cash-modal-card > footer {
  justify-content: flex-end;
  margin-top: 1rem;
}
.company-cash-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}
.company-cash-form .field-full {
  grid-column: 1 / -1;
}
.company-cash-money-input {
  position: relative;
}
.company-cash-money-input > span {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, var(--color-text-muted));
}
.company-cash-money-input input {
  padding-left: 1.6rem;
}
.company-cash-review {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--surface-muted);
}
.company-cash-review > strong {
  font-size: 1.8rem;
}
.company-cash-review dl {
  display: grid;
  gap: 0.4rem;
}
.company-cash-review dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.company-cash-review dt {
  color: var(--text-muted, var(--color-text-muted));
}
.sw-account-routing-cell {
  display: grid;
  gap: 0.4rem;
  min-width: 210px;
}
.sw-cash-treatment {
  font-size: 0.76rem;
}
@media (max-width: 720px) {
  .company-cash-settings-grid,
  .company-cash-transition,
  .company-cash-form {
    grid-template-columns: 1fr;
  }
  .company-cash-form .field-full,
  .company-cash-transition-actions {
    grid-column: auto;
  }
  .company-cash-head > .btn,
  .company-cash-alert > .btn,
  .company-cash-issue > .btn,
  .company-cash-settings-grid > .btn {
    width: 100%;
  }
  .company-cash-issue {
    grid-template-columns: 1fr;
  }
  .company-cash-account-table {
    min-width: 680px;
  }
}
.accounts-readout-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.accounts-readout-head h2 {
  margin: 0 0 0.35rem;
}
.accounts-readout-head > div {
  max-width: 520px;
}
.accounts-readout-month {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 180px;
}
.accounts-readout-month > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.accounts-readout-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.accounts-readout-body.is-refreshing {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.money-reconciliation {
  display: grid;
  gap: 0.65rem;
}
.money-reconciliation-equations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 0.7rem;
}
.money-reconciliation-equation {
  min-width: 0;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border-subtle, var(--border-color, rgba(127, 127, 127, 0.25)));
  border-radius: 10px;
  background: var(--bg-elevated);
}
.money-reconciliation-caption {
  margin: 0 0 0.55rem;
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
}
.money-reconciliation-math {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}
.money-reconciliation-math strong {
  font-size: 1.02rem;
}
.money-reconciliation-math span {
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  font-weight: 700;
}
.money-reconciliation-lines {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0.55rem 0 0;
  border-top: 1px dashed var(--border-subtle, var(--border-color, rgba(127, 127, 127, 0.25)));
  display: grid;
  gap: 0.28rem;
  font-size: 0.78rem;
}
.money-reconciliation-lines li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}
.money-reconciliation-lines strong {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.money-reconciliation-key {
  display: grid;
  gap: 0.18rem;
  margin-top: 0.55rem;
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  font-size: 0.72rem;
  line-height: 1.35;
}
.money-reconciliation-check {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.35rem 0.55rem;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 600;
}
.money-reconciliation-check.is-balanced {
  color: var(--state-success, #16a34a);
  background: color-mix(in srgb, var(--state-success, #16a34a) 10%, transparent);
}
.money-reconciliation-check.is-out {
  color: var(--state-danger, #dc2626);
  background: color-mix(in srgb, var(--state-danger, #dc2626) 10%, transparent);
}
.accounts-readout-subheading {
  margin: 0.95rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.accounts-readout-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
}
.accounts-readout-tile {
  border: 1px solid var(--border-subtle, var(--border-color, rgba(127, 127, 127, 0.25)));
  border-radius: 10px;
  padding: 0.8rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--surface-raised, transparent);
}
.accounts-readout-tile strong {
  font-size: 1.25rem;
}
.accounts-readout-tile .muted {
  font-size: 0.78rem;
}
.accounts-readout-tile-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.accounts-readout-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.accounts-readout-account {
  padding: 0.7rem 0;
  border-top: 1px solid var(--border-subtle, var(--border-color, rgba(127, 127, 127, 0.2)));
}
.accounts-readout-account-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.accounts-readout-account-name {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  min-width: 0;
}
.accounts-readout-type {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.accounts-readout-lines {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.86rem;
}
.accounts-readout-lines li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}
.accounts-readout-breakdown {
  margin-top: 0.35rem;
}
.accounts-readout-breakdown summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--color-text-muted, #6b7280);
  width: fit-content;
}
.accounts-readout-footnote {
  font-size: 0.82rem;
  margin: 0;
}
.accounts-readout-empty {
  max-width: 560px;
}
.accounts-readout-cta {
  display: inline-flex;
  margin-top: 0.85rem;
}
.accounts-readout-business-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--state-success, #16a34a) 35%, transparent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--state-success, #16a34a) 8%, transparent);
}
.accounts-readout-business-total > div {
  display: grid;
  gap: 0.2rem;
}
.accounts-readout-business-total span {
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.accounts-readout-business-total strong {
  font-size: 1.65rem;
  font-variant-numeric: tabular-nums;
}
.accounts-readout-business-total p {
  max-width: 560px;
  margin: 0;
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: right;
}
.guest-portal-accounting {
  display: grid;
  gap: 1rem;
  margin: 1rem 0 1.1rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle, var(--border-color, rgba(127, 127, 127, 0.25)));
  border-radius: 12px;
  background: var(--surface-raised, transparent);
}
.guest-portal-accounting-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.guest-portal-accounting-head h3 {
  margin: 0.15rem 0 0.3rem;
  font-size: 1.15rem;
}
.guest-portal-accounting-head p {
  max-width: 720px;
  margin: 0;
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  font-size: 0.85rem;
  line-height: 1.5;
}
.guest-portal-accounting .company-money-summary-kicker {
  color: var(--accent);
}
.guest-portal-accounting .company-money-summary-status {
  flex: 0 0 auto;
}
.guest-portal-accounting-tiles .accounts-readout-tile.is-primary {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
}
.guest-portal-accounting-empty {
  margin: 0;
}
.guest-portal-accounting-note,
.guest-portal-accounting-proof,
.guest-portal-accounting-unmapped {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 9px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.guest-portal-accounting-note {
  background: var(--surface-muted, rgba(127, 127, 127, 0.08));
}
.guest-portal-accounting-note.is-warning,
.guest-portal-accounting-warning,
.guest-portal-accounting-unmapped {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning, #f59e0b) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--state-warning, #f59e0b) 30%, transparent);
}
.guest-portal-accounting-proof {
  color: var(--state-success, #16a34a);
  background: color-mix(in srgb, var(--state-success, #16a34a) 10%, transparent);
}
.guest-portal-accounting-warning {
  padding: 0.8rem 0.9rem;
  border-radius: 9px;
  font-size: 0.82rem;
  line-height: 1.45;
}
.guest-portal-accounting-warning p {
  margin: 0.3rem 0 0;
}
.guest-portal-accounting-warning ul {
  margin: 0.45rem 0 0;
  padding-left: 1.1rem;
}
.guest-portal-accounting-detail {
  margin-top: 0;
}
.guest-portal-accounting-detail td:first-child {
  display: grid;
  gap: 0.15rem;
}
.guest-portal-accounting-detail td small {
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  text-transform: capitalize;
}
.guest-portal-accounting-side {
  display: inline-block;
  min-width: 3.2rem;
  margin-right: 0.35rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.guest-portal-accounting-autosetup,
.guest-portal-accounting-recover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.guest-portal-accounting-autosetup > div,
.guest-portal-accounting-recover > div {
  display: grid;
  gap: 0.2rem;
}
.guest-portal-accounting-autosetup span,
.guest-portal-accounting-recover span,
.guest-portal-accounting-autosetup > small {
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  font-size: 0.8rem;
  line-height: 1.4;
}
.guest-portal-accounting-autosetup > small {
  grid-column: 1 / -1;
}
.guest-portal-accounting-setup {
  border-top: 1px solid var(--border-subtle, var(--border-color, rgba(127, 127, 127, 0.2)));
  padding-top: 0.85rem;
}
.guest-portal-accounting-setup > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style-position: outside;
}
.guest-portal-accounting-setup > summary > span:first-child {
  display: grid;
  gap: 0.15rem;
}
.guest-portal-accounting-setup > summary small,
.guest-portal-accounting-setup > summary > span:last-child {
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  font-size: 0.78rem;
}
.guest-portal-accounting-setup-body {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
.guest-portal-accounting-field {
  min-width: 0;
}
.guest-portal-accounting-field > small {
  line-height: 1.4;
}
.guest-portal-accounting-legacy,
.guest-portal-accounting-items {
  display: grid;
  gap: 0.55rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle, var(--border-color, rgba(127, 127, 127, 0.2)));
}
.guest-portal-accounting-legacy h4,
.guest-portal-accounting-items h4,
.guest-portal-accounting-legacy p,
.guest-portal-accounting-items p {
  margin: 0;
}
.guest-portal-accounting-item-list {
  display: grid;
  gap: 0.55rem;
}
.guest-portal-accounting-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(220px, 0.7fr);
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem;
  border: 1px solid var(--border-subtle, var(--border-color, rgba(127, 127, 127, 0.2)));
  border-radius: 9px;
}
.guest-portal-accounting-item > div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.guest-portal-accounting-item small {
  color: var(--text-muted, var(--color-text-muted, #6b7280));
  line-height: 1.35;
}
.guest-portal-accounting-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
@media (max-width: 760px) {
  .accounts-readout-business-total {
    align-items: flex-start;
    flex-direction: column;
  }
  .accounts-readout-business-total p {
    text-align: left;
  }
  .guest-portal-accounting {
    margin-inline: -0.15rem;
    padding: 0.8rem;
  }
  .guest-portal-accounting-head,
  .guest-portal-accounting-setup > summary {
    align-items: stretch;
    flex-direction: column;
  }
  .guest-portal-accounting-autosetup,
  .guest-portal-accounting-recover,
  .guest-portal-accounting-item {
    grid-template-columns: 1fr;
  }
  .guest-portal-accounting-autosetup .btn,
  .guest-portal-accounting-recover .btn,
  .guest-portal-accounting-actions .btn {
    width: 100%;
  }
}

/* Registry empty states (settlement waterfall / chart of accounts / fees) share
   ONE calm, left-aligned pattern: heading, one-line explainer, a real CTA button
   on its own line. Centered hero-style blocks and mid-sentence icon buttons are
   off-language here (Hakim, 2026-07-09). */
.registry-empty {
  padding: 1.5rem;
  color: var(--text-muted);
  max-width: 640px;
}
.registry-empty h2 {
  color: var(--text-primary, inherit);
}
.registry-empty-cta {
  display: inline-flex;
  margin: 0.85rem 0 0.25rem;
}
.registry-empty-footnote {
  font-size: 0.82rem;
  margin-top: 0.85rem;
}
.workspace-registry-list-empty {
  font-size: 0.82rem;
  padding: 0.5rem 0.35rem;
}

/* Registry delete pattern (red icon button + animated confirm modal).
   Named coa-* for historical reasons but SHARED: used by the chart of
   accounts AND the management-fees editor. Restyle here, not per page. */
.coa-delete-account-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #ef4444 42%, var(--border-subtle, rgba(255, 255, 255, 0.12)));
  background: color-mix(in srgb, #ef4444 16%, var(--bg-elevated, #1a1d24));
  color: #f87171;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease;
}
.coa-delete-account-btn:hover:not(:disabled) {
  background: color-mix(in srgb, #ef4444 26%, var(--bg-elevated, #1a1d24));
  border-color: color-mix(in srgb, #ef4444 55%, var(--border-subtle, rgba(255, 255, 255, 0.12)));
  color: #fca5a5;
}
.coa-delete-account-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, #ef4444 65%, transparent);
  outline-offset: 2px;
}
.coa-delete-account-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.coa-delete-account-btn svg {
  width: 20px;
  height: 20px;
}
[data-theme="light"] .coa-delete-account-btn {
  background: color-mix(in srgb, #ef4444 12%, #ffffff);
  border-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}
[data-theme="light"] .coa-delete-account-btn:hover:not(:disabled) {
  background: color-mix(in srgb, #ef4444 18%, #ffffff);
  color: #991b1b;
}

@keyframes coa-delete-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes coa-delete-modal-in {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.coa-delete-modal-backdrop {
  animation: coa-delete-backdrop-in 0.2s ease-out;
}
.coa-delete-modal {
  animation: coa-delete-modal-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  box-shadow: 0 20px 50px color-mix(in srgb, #000 42%, transparent);
}
.coa-delete-confirm-btn {
  background: linear-gradient(180deg, #f87171, #dc2626);
  color: #fff;
  border: 1px solid color-mix(in srgb, #fff 18%, #dc2626);
}
.coa-delete-confirm-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #fb923c, #b91c1c);
  color: #fff;
}
.coa-delete-confirm-btn:focus-visible {
  outline: 2px solid #fca5a5;
  outline-offset: 2px;
}
.coa-delete-confirm-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
[data-theme="light"] .coa-delete-modal {
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
}

.registry-amount-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
}

.registry-amount-table th,
.registry-amount-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.registry-amount-table th {
  background: var(--surface-2);
  font-weight: 600;
}

.registry-amount-table td.numeric,
.registry-amount-table th.numeric {
  text-align: right;
}

.properties-management-fees-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  margin-top: 0.35rem;
  background: var(--surface-2, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 0.5rem;
  overflow: hidden;
}

.properties-management-fees-table th,
.properties-management-fees-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.properties-management-fees-table tr:last-child td {
  border-bottom: 0;
}

.properties-management-fees-table th {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-3, rgba(0,0,0,0.02));
}

.properties-management-fees-table td.numeric {
  text-align: right;
  width: 9rem;
}

.properties-management-fees-table td.center {
  text-align: center;
  width: 5rem;
}

.properties-management-fees-table td.actions {
  text-align: right;
  width: 7rem;
}

.properties-fee-readonly-value {
  color: var(--text-primary);
  font-weight: 600;
}

.properties-management-fees-table input[type="number"] {
  width: 100%;
  text-align: right;
}

.properties-owner-picker-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.45rem 0.6rem;
  border-radius: 0.4rem;
  cursor: pointer;
  text-align: left;
  background: transparent;
  border: 0;
  width: 100%;
  color: inherit;
}

.properties-owner-picker-row:hover {
  background: var(--surface-3, rgba(0,0,0,0.04));
}

.properties-owner-picker-row .name {
  font-weight: 500;
  text-align: left;
}

.properties-owner-picker-row .email {
  color: var(--text-muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.properties-combobox-footer-add {
  display: flex;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-3, rgba(0,0,0,0.02));
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  color: var(--accent, #2563eb);
}

.properties-combobox-footer-add:hover {
  background: var(--surface-4, rgba(0,0,0,0.06));
}

.properties-modal-hint {
  font-size: 0.78rem;
  margin: 0.5rem 0 0;
  line-height: 1.45;
}

.properties-contact-types {
  gap: 0.35rem;
}

.properties-contact-types .properties-tag-pill {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
}

.properties-inline-quickadd {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  align-items: center;
}

.properties-inline-quickadd input[type="text"],
.properties-inline-quickadd .properties-input-text {
  flex: 1;
  min-width: 0;
}

.properties-section-lead {
  font-size: 0.75rem;
  margin: 0.35rem 0 0.6rem;
  line-height: 1.45;
}

.properties-pms-lead {
  font-size: 0.75rem;
  margin: 0 0 0.55rem;
  max-width: 48rem;
}

.properties-pms-toggle-wrap {
  display: inline-flex;
}

.properties-pms-pill-toggle {
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.48rem 0.85rem;
  min-width: 9.8rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  background: color-mix(in srgb, var(--table-surface) 92%, var(--bg-elevated));
}

.properties-pms-pill-toggle.is-active {
  background: color-mix(in srgb, var(--state-success) 14%, var(--table-surface));
  color: color-mix(in srgb, var(--state-success) 70%, var(--text-primary));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--state-success) 42%, transparent),
    0 2px 8px color-mix(in srgb, var(--state-success) 20%, transparent);
}

.properties-pms-pill-toggle.is-inactive {
  background: color-mix(in srgb, var(--table-surface) 92%, var(--bg-elevated));
  color: var(--text-soft);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--border-subtle) 56%, transparent),
    0 2px 8px color-mix(in srgb, #0f172a 12%, transparent);
}

.properties-pms-pill-toggle:hover {
  transform: translateY(-1px);
}

.properties-pms-pill-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: #e2e8f0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25) inset;
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

.properties-pms-pill-toggle.is-active .properties-pms-pill-dot {
  order: 2;
  transform: translateX(0);
}

.properties-pms-pill-toggle.is-inactive .properties-pms-pill-dot {
  order: 0;
  transform: translateX(0);
}

/* Policy subgroups — light divider + small label, no card chrome. */
.properties-policy-subgroup {
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px dashed color-mix(in srgb, var(--border-subtle) 60%, transparent);
}

.properties-policy-subgroup:first-of-type {
  padding-top: 0;
  margin-top: 0.75rem;
  border-top: 0;
}

.properties-policy-subgroup-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 0.5rem;
}

/* Input + suffix label / toggle pattern — e.g. "30 days ahead" or "24 hours". */
.properties-suffix-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-input);
  overflow: hidden;
  transition: border-color 0.14s;
}

.properties-suffix-input:focus-within {
  border-color: color-mix(in srgb, var(--ring) 60%, var(--border-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 14%, transparent);
}

.properties-suffix-input input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.42rem 0.55rem !important;
  flex: 1;
  min-width: 0;
}

.properties-suffix-input input:disabled {
  color: var(--text-muted);
}

.properties-suffix-input-suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 0.6rem;
  font-size: 0.72rem;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--border-subtle) 30%, var(--bg-input));
  border-left: 1px solid var(--border-subtle);
}

.properties-suffix-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  padding: 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--border-subtle) 30%, var(--bg-input));
  border: 0;
  border-left: 1px solid var(--border-subtle);
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.properties-suffix-toggle.is-on {
  background: color-mix(in srgb, var(--brand-primary) 16%, var(--bg-input));
  color: color-mix(in srgb, var(--brand-primary) 80%, var(--text-primary));
}

.properties-suffix-toggle:hover {
  background: color-mix(in srgb, var(--brand-primary) 24%, var(--bg-input));
}

.properties-policy-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.25rem 0;
}

.properties-policy-toggle-row .properties-pms-pill-toggle {
  min-width: 0;
  padding: 0.36rem 0.7rem;
  font-size: 0.74rem;
}

.properties-policy-glance {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem 0.35rem;
  margin: 0 0 0.6rem;
}

.properties-policy-chip {
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--border-subtle) 24%, var(--table-surface));
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.properties-day-toggles-label {
  font-size: 0.7rem;
  font-weight: 600;
  margin: 0.45rem 0 0.2rem;
  color: var(--text-soft);
}

.properties-day-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0.4rem;
}

.properties-day-chip {
  border: 1px solid var(--border-subtle);
  background: var(--table-surface);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 2.1rem;
  padding: 0.18rem 0.35rem;
  border-radius: 6px;
  cursor: pointer;
}

.properties-day-chip.is-on {
  border-color: var(--nav-border-accent);
  color: #e0e7ff;
  background: color-mix(in srgb, #5b6cff 22%, var(--table-surface));
}

.properties-abbr-hint {
  font-size: 0.6rem;
  text-decoration: none;
  cursor: help;
  color: var(--text-muted);
}

.properties-compact-field span {
  font-size: 0.72rem;
}

.properties-input-text {
  /* font-family must be stated: form controls don't inherit the page font,
     so textareas fell back to the browser's monospace default. */
  font-family: inherit;
  font-size: 0.8rem;
  min-height: 32px;
  padding: 0.35rem 0.5rem;
}

textarea.properties-input-text {
  min-height: 52px;
  resize: vertical;
}

.properties-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
}

@media (max-width: 900px) {
  .properties-grid-2 {
    grid-template-columns: 1fr;
  }}

.properties-suggestions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.35rem 0 0.5rem;
  max-height: 180px;
  overflow: auto;
}

.properties-suggestion-btn {
  text-align: left;
  font-size: 0.75rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: var(--table-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
}

.properties-suggestion-btn:hover {
  border-color: var(--nav-border-accent);
}

/* ── Amenities: header + collapsible categories + search ─────────────────── */

.properties-amenities-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
}

.properties-amenities-head-copy { min-width: 0; }
.properties-amenities-head-copy .properties-section-lead { margin: 0; }

.properties-amenities-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.properties-amenities-summary {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, var(--table-surface));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 26%, var(--border-subtle));
}

.properties-amenities-summary strong {
  font-weight: 650;
}

.properties-amenities-bulk-btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--table-surface);
  color: var(--text-soft);
  border-radius: 7px;
  font-size: 0.72rem;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.properties-amenities-bulk-btn:hover {
  border-color: color-mix(in srgb, var(--ring) 30%, var(--border-subtle));
  color: var(--text-primary);
  background: color-mix(in srgb, var(--border-subtle) 22%, var(--table-surface));
}

.properties-amenities-search {
  position: relative;
  margin-bottom: 0.65rem;
}

.properties-amenities-search-icon {
  position: absolute;
  top: 50%;
  left: 0.6rem;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.properties-amenities-search-input {
  width: 100%;
  padding-left: 1.85rem !important;
  padding-right: 2rem !important;
}

.properties-amenities-search-clear {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.properties-amenities-search-clear:hover {
  background: color-mix(in srgb, var(--border-subtle) 50%, transparent);
  color: var(--text-primary);
}

.properties-amenity-cat-list {
  display: grid;
  gap: 0.45rem;
}

.properties-amenity-category {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--table-surface) 95%, var(--bg-elevated));
  transition: border-color 0.14s ease;
}

.properties-amenity-category:hover {
  border-color: color-mix(in srgb, var(--ring) 16%, var(--border-subtle));
}

/* Wrapper lets the bulk "Select all" button sit alongside the category
   toggle without nesting buttons (which is invalid HTML). */
.properties-amenity-cat-head-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.25rem;
  padding-right: 0.5rem;
}

.properties-amenity-cat-bulk {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text-soft);
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}

.properties-amenity-cat-bulk:hover {
  color: color-mix(in srgb, var(--brand-primary) 80%, var(--text-primary));
  background: color-mix(in srgb, var(--brand-primary) 10%, transparent);
}

.properties-amenity-cat-bulk.is-clear {
  color: color-mix(in srgb, var(--state-warning) 70%, var(--text-soft));
}

.properties-amenity-cat-bulk.is-clear:hover {
  color: color-mix(in srgb, var(--state-warning) 90%, var(--text-primary));
  background: color-mix(in srgb, var(--state-warning) 12%, transparent);
}

.properties-amenity-cat-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.12s ease;
}

.properties-amenity-cat-head:hover:not(:disabled) {
  background: color-mix(in srgb, var(--border-subtle) 20%, transparent);
}

.properties-amenity-cat-head:disabled {
  cursor: default;
}

.properties-amenity-cat-head:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 60%, transparent);
  outline-offset: -2px;
}

.properties-amenity-cat-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-soft);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.properties-amenity-category.is-collapsed .properties-amenity-cat-chevron {
  transform: rotate(-90deg);
}

.properties-amenity-cat-label {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text-primary);
}

.properties-amenity-cat-count {
  font-size: 0.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--border-subtle) 35%, var(--table-surface));
  border: 1px solid var(--border-subtle);
}

.properties-amenity-cat-count.is-active {
  color: color-mix(in srgb, var(--brand-primary) 80%, var(--text-primary));
  background: color-mix(in srgb, var(--brand-primary) 14%, var(--table-surface));
  border-color: color-mix(in srgb, var(--brand-primary) 36%, var(--border-subtle));
}

.properties-photo-edit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--table-surface);
  min-width: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.properties-photo-edit-card.is-cover {
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 24%, transparent);
}

.properties-photo-edit-card.is-drop-target {
  border-color: color-mix(in srgb, var(--ring) 70%, var(--border-subtle));
  box-shadow:
    -3px 0 0 0 color-mix(in srgb, var(--ring) 80%, transparent),
    0 0 0 1px color-mix(in srgb, var(--ring) 30%, transparent);
}

.properties-photo-cover-badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 1;
  padding: 0.12rem 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f172a;
  background: color-mix(in srgb, var(--brand-primary) 85%, white);
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.properties-photo-cover-btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  min-height: 0;
}

.properties-photo-remove-confirm {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
}

.properties-photo-remove-confirm .btn {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  min-height: 0;
}

.properties-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.7rem;
}

.properties-photos-card {
  position: relative;
}

.properties-photos-card.is-file-drop-active {
  border-color: color-mix(in srgb, var(--brand-primary) 50%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 25%, transparent);
}

.properties-photos-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

.properties-photos-head-copy { min-width: 0; }
.properties-photos-head-copy .properties-section-lead { margin: 0; }

.properties-photos-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.properties-photos-count {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 12%, var(--table-surface));
  border: 1px solid color-mix(in srgb, var(--brand-primary) 26%, var(--border-subtle));
}

.properties-photos-count strong { font-weight: 650; }

.properties-photos-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.properties-photos-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 12rem;
  padding: 2rem 1.5rem;
  border: 1.5px dashed color-mix(in srgb, var(--border-subtle) 80%, var(--text-soft));
  border-radius: 14px;
  background: color-mix(in srgb, var(--table-surface) 92%, var(--bg-elevated));
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
  text-align: center;
}

.properties-photos-empty:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--brand-primary) 5%, var(--table-surface));
  color: var(--text-primary);
}

.properties-photos-empty-icon {
  color: color-mix(in srgb, var(--brand-primary) 70%, var(--text-soft));
}

.properties-photos-empty-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text-primary);
}

.properties-photos-empty-hint {
  font-size: 0.78rem;
  max-width: 22rem;
}

.properties-photos-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: color-mix(in srgb, var(--brand-primary) 18%, color-mix(in srgb, var(--bg-deep) 70%, transparent));
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.properties-photos-drop-overlay-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 1rem 1.4rem;
  border-radius: 12px;
  border: 1.5px dashed color-mix(in srgb, var(--brand-primary) 60%, white);
  background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.properties-photos-drop-overlay-inner svg {
  color: color-mix(in srgb, var(--brand-primary) 80%, white);
}

.properties-photo-preview {
  appearance: none;
  padding: 0;
  text-align: inherit;
  border: 0;
  width: 100%;
  cursor: zoom-in;
  border-radius: 6px;
  overflow: hidden;
  min-height: 100px;
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--text-muted) 6%, var(--table-surface));
}

.properties-photo-preview img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.properties-photo-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: space-between;
  align-items: center;
}

.properties-photo-position {
  font-size: 0.72rem;
}

.properties-photo-lightbox {
  width: min(980px, 95vw);
  display: grid;
  gap: 0.6rem;
}

.properties-photo-lightbox-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.properties-photo-lightbox-head p {
  margin: 0;
}

.properties-photo-lightbox-image-wrap {
  max-height: min(72vh, 860px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-input) 75%, black);
}

.properties-photo-lightbox-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.properties-photo-lightbox-caption {
  margin: 0;
}

.properties-map-wrap {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.properties-coords-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.properties-coords-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  color: var(--text-soft);
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  background: color-mix(in srgb, var(--border-subtle) 22%, var(--table-surface));
  border: 1px solid var(--border-subtle);
}

.properties-map-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.properties-map-head h4,
.properties-map-head p {
  margin: 0;
}

.properties-map-canvas {
  width: 100%;
  min-height: 300px;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  background: #dce9f8;
}

.properties-map-canvas .leaflet-container {
  width: 100% !important;
  height: 100% !important;
}

/* Premium zoom controls — replace Leaflet's default chunky beige buttons
   with a stacked frosted-glass pill. */
.properties-map-canvas .leaflet-control-zoom {
  border: 0 !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.45),
    0 6px 16px rgba(0, 0, 0, 0.32);
  margin: 12px !important;
}

.properties-map-canvas .leaflet-control-zoom a {
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1) !important;
  transition: background 0.12s ease, color 0.12s ease;
}

.properties-map-canvas .leaflet-control-zoom a:last-child {
  border-bottom: 0 !important;
}

.properties-map-canvas .leaflet-control-zoom a:hover {
  background: rgba(255, 255, 255, 1) !important;
  color: color-mix(in srgb, var(--brand-primary) 80%, #0f172a) !important;
}

.properties-map-canvas .leaflet-control-zoom a.leaflet-disabled {
  background: rgba(255, 255, 255, 0.6) !important;
  color: rgba(15, 23, 42, 0.4) !important;
}

/* Hide any stray attribution that might still appear via the tile layer
   (defensive — we already disabled attributionControl). */
.properties-map-canvas .leaflet-control-attribution {
  display: none !important;
}

/* Locked state — no grab/move cursor, marker shows it can't be dragged. */
.properties-map-canvas.is-map-locked .leaflet-container {
  cursor: default !important;
}

.properties-map-canvas.is-map-locked .leaflet-marker-draggable,
.properties-map-canvas.is-map-locked .leaflet-marker-icon {
  cursor: not-allowed !important;
}

.properties-map-fallback {
  width: 100%;
  min-height: 300px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

/* ── Custom map pins (Leaflet divIcons) ──────────────────────────────────
   Leaflet's divIcon strips its own backgrounds, so we draw the pin entirely
   in our own HTML/CSS — a rounded image badge with a tail underneath. The
   primary (current listing) pin is bigger and brand-tinted; siblings are
   compact circular thumbs that fade in/out on hover. */

.properties-map-pin-icon {
  background: transparent !important;
  border: 0 !important;
}

.properties-map-pin {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: grab;
  transform-origin: 50% 100%;
  transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.properties-map-pin:hover {
  transform: translateY(-2px) scale(1.04);
  z-index: 10;
}

.properties-map-pin-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

/* Primary pin — current listing. Pill-shaped, larger, brand ring + tail.
   Border is brand-primary (not white) so the pin reads on any tile colour;
   a 2px white inner halo via box-shadow gives the photo a clean separation. */
.properties-map-pin--primary .properties-map-pin-frame {
  box-sizing: border-box;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 3px solid color-mix(in srgb, var(--brand-primary) 85%, #0f172a);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.55),
    0 8px 18px rgba(0, 0, 0, 0.45),
    0 3px 6px rgba(0, 0, 0, 0.3);
}

.properties-map-pin--primary .properties-map-pin-tail {
  width: 16px;
  height: 12px;
  margin-top: -2px;
  background: color-mix(in srgb, var(--brand-primary) 85%, #0f172a);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

/* Exact-coordinate marker: a small ringed dot sitting *under* the tail tip.
   Together they unambiguously point at the property's true location. */
.properties-map-pin-anchor {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 95%, #fff);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 0 3px rgba(15, 23, 42, 0.55),
    0 2px 4px rgba(0, 0, 0, 0.4);
}

.properties-map-pin-anchor-pulse {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--brand-primary) 70%, transparent);
  opacity: 0;
  animation: properties-map-pin-pulse 2.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes properties-map-pin-pulse {
  0% { transform: scale(0.65); opacity: 0.9; }
  70% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.2); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .properties-map-pin-anchor-pulse { animation: none; }}

.properties-map-pin--primary.properties-map-pin--fallback .properties-map-pin-frame {
  background-color: color-mix(in srgb, var(--brand-primary) 70%, #0f172a);
  color: #fff;
}

/* ========================================================================
   Tasks desktop workspace — pane 2 navigation, editable table, full pane 4
   ======================================================================== */
.workspace-task-detail-host {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
/* The support pane is normally a two-row grid (heading + content). Tasks owns
   the whole pane and provides no heading sibling, so its sole host must span
   both rows. Without this, the absolutely-positioned TaskDrawer contributes no
   intrinsic height and the grid can collapse the host to 0px: the row remains
   selected while pane 4 looks completely blank. */
.workspace-property-nav-pane > .workspace-task-detail-host {
  grid-row: 1 / -1;
  align-self: stretch;
}
.task-workspace-pane {
  position: absolute;
  inset: 0;
  min-height: 0;
  background: var(--bg-deep);
}
.task-workspace-pane-related {
  height: 100%;
  overflow: auto;
  background: var(--bg-deep);
}
.task-workspace-pane-empty {
  display: flex;
  height: 100%;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
  font-size: .78rem;
}
.task-workspace-pane-empty strong { color: var(--text-primary); font-size: .9rem; }

.workspace-surface-failure {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 180px;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}
.workspace-surface-failure > strong {
  color: var(--text-primary);
  font-size: .9rem;
}
.workspace-surface-failure > span {
  max-width: 420px;
  font-size: .72rem;
  line-height: 1.5;
}
.workspace-surface-failure-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 7px;
}
.workspace-surface-failure-actions button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-size: .72rem;
  font-weight: 650;
}
.workspace-surface-failure-actions button:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
}
.workspace-surface-failure-actions button.is-primary {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-input));
}
.workspace-surface-loading {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .75rem;
}

.stream-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  margin: 5px 8px 2px;
  color: var(--text-muted);
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.stream-section-label.is-streams { margin-top: 14px; }

.tasks-table-header {
  position: sticky;
  top: 0;
  z-index: 14;
  display: grid;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  min-height: 30px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-base) 94%, transparent);
  color: var(--text-muted);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}
.tasks-shell .tasks-list { gap: 8px; }
.tasks-group { min-width: max-content; }
.tasks-group.is-ungrouped { gap: 0; }
.tasks-group-rows {
  overflow: visible;
  min-width: max-content;
}
.task-row {
  width: 100%;
  min-width: max-content;
  gap: 10px;
  padding: 0 10px;
  height: var(--tasks-row-h);
}
.task-row.is-closed .task-row-title-input,
.task-row.is-closed .task-row-title-open {
  color: var(--text-muted);
  text-decoration: line-through;
}
.task-row.is-subtask {
  height: calc(var(--tasks-row-h) * .9);
  opacity: .9;
}
.task-row-title-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  overflow: hidden;
}
.task-row-title-input {
  flex: 1 1 auto;
  min-width: 80px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: .82rem;
  font-weight: 560;
  text-overflow: ellipsis;
}
.task-row-title-input:hover { border-color: var(--border-subtle); background: var(--bg-input); }
.task-row-title-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--tasks-accent) 55%, var(--border-subtle));
  background: var(--bg-input);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tasks-accent) 13%, transparent);
}
.task-row-title-open {
  flex: 1 1 auto;
  min-width: 80px;
  height: 30px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: .82rem;
  font-weight: 560;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
}
.task-row-title-open:hover,
.task-row-title-open:focus-visible {
  border-color: color-mix(in srgb, var(--tasks-accent) 38%, var(--border-subtle));
  background: var(--bg-input);
  outline: none;
}
.task-row-title-edit {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
}
.task-row-title-cell:hover .task-row-title-edit,
.task-row-title-edit:focus-visible {
  opacity: 1;
}
.task-row-title-edit:hover { background: var(--bg-input); color: var(--text-primary); }
.task-row-inline-cell,
.task-row-dates,
.task-row-related {
  display: flex;
  min-width: 0;
  align-items: center;
}
.task-row-inline-type-icon {
  flex: 0 0 auto;
  margin-left: 6px;
  color: var(--text-muted);
}
.task-row-inline-type-icon + .task-row-inline-type {
  padding-left: 5px;
}
.task-row-inline-select {
  width: 100%;
  min-width: 0;
  height: 28px;
  justify-content: space-between;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  font-size: .72rem;
  font-weight: 560;
  overflow: hidden;
}
.task-row-inline-select:hover,
.task-row-inline-select[aria-expanded="true"] {
  border-color: var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
}
.task-row-inline-priority.is-urgent { color: var(--state-danger); }
.task-row-inline-priority.is-high { color: var(--state-warning); }
.task-row-inline-priority.is-low { color: var(--state-success); }
.task-row-related { gap: 4px; overflow: hidden; }
.task-row-related-chip,
.task-row-inline-empty,
.task-row-related-edit {
  display: inline-flex;
  min-width: 0;
  height: 24px;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-input));
  color: var(--text-soft);
  cursor: pointer;
  font-size: .68rem;
}
.task-row-related-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-related-chip:hover,
.task-row-inline-empty:hover,
.task-row-related-edit:hover { border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle)); color: var(--text-primary); }
.task-row-inline-empty { background: transparent; border-color: transparent; color: var(--text-muted); }
.task-row-related-edit {
  width: 24px;
  flex: 0 0 24px;
  justify-content: center;
  padding: 0;
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.task-row-related-more { color: var(--text-muted); font-size: .66rem; }
.task-row-assignee-button {
  display: inline-flex;
  min-width: 0;
  height: 30px;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .68rem;
}
.task-row-assignee-button:hover { border-color: var(--border-subtle); background: var(--bg-input); color: var(--text-primary); }
.task-row-assignee-button.is-empty { border-style: dashed; }
.task-row-assignee-label,
.task-modal-assignee-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-row-assignee-label {
  color: var(--text-soft);
  font-size: .67rem;
}
.task-modal-assignee-summary {
  max-width: 220px;
  color: var(--text-primary);
  font-size: .72rem;
}
.task-row-dates .task-date-pop { width: 100%; }
.task-row-dates .task-date-pop-trigger {
  width: 100%;
  min-width: 0;
  height: 28px;
  justify-content: flex-start;
  padding: 0 7px;
  border-color: transparent;
  background: transparent;
  font-size: .69rem;
  overflow: hidden;
}
.task-row-dates .task-date-pop-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row-dates .task-date-pop-trigger:hover,
.task-row-dates .task-date-pop-trigger[aria-expanded="true"] { border-color: var(--border-subtle); background: var(--bg-input); }
.task-row-dates .task-date-pop-panel { z-index: 90; }
.task-row-actions { justify-content: flex-end; }
.task-row:hover .task-row-actions,
.task-row:focus-within .task-row-actions { opacity: 1; }

.tasks-columns-panel { display: grid; width: 330px; max-width: calc(100vw - 40px); gap: 10px; }
.tasks-columns-panel-head { display: grid; gap: 2px; }
.tasks-columns-panel-head strong { color: var(--text-primary); font-size: .82rem; }
.tasks-columns-panel-head span,
.tasks-columns-custom-fields p { margin: 0; color: var(--text-muted); font-size: .68rem; line-height: 1.45; }
.tasks-columns-list { display: grid; gap: 2px; }
.tasks-columns-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 7px;
}
.tasks-columns-row:hover { background: var(--bg-input); }
.tasks-columns-row label { display: flex; flex: 1; align-items: center; gap: 8px; color: var(--text-soft); font-size: .75rem; }
.tasks-columns-row.is-visible label { color: var(--text-primary); }
.tasks-columns-order { display: inline-flex; gap: 2px; }
.tasks-columns-order button,
.tasks-columns-custom-fields > button {
  min-width: 26px;
  height: 26px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.tasks-columns-order button:hover:not(:disabled) { color: var(--text-primary); background: var(--bg-elevated); }
.tasks-columns-order button:disabled { opacity: .3; cursor: default; }
.tasks-columns-custom-fields { display: grid; gap: 6px; padding-top: 9px; border-top: 1px solid var(--border-subtle); }
.tasks-columns-custom-fields > button { width: fit-content; padding: 0 9px; color: var(--text-soft); }
.tasks-columns-custom-fields .tasks-fields-manager { margin-top: 5px; }
.tasks-toolbar-popover-content:has(.tasks-columns-panel) {
  width: auto;
  max-width: min(680px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 110px));
  overflow: auto;
}
.tasks-personal-view-panel { display: grid; width: 390px; max-width: calc(100vw - 40px); gap: 8px; }
.tasks-personal-view-panel strong { color: var(--text-primary); font-size: .84rem; }
.tasks-personal-view-panel p { margin: 0 0 3px; color: var(--text-muted); font-size: .71rem; line-height: 1.5; }
.tasks-personal-view-action {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
  font-size: .73rem;
}
.tasks-personal-view-action:hover { background: var(--bg-input); color: var(--text-primary); }
.tasks-personal-view-action.is-primary { border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle)); color: var(--accent); }
.tasks-personal-view-panel > span { color: var(--state-success); font-size: .68rem; }
.task-modal-assignee-trigger {
  min-height: 28px;
  min-width: 54px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
}
.task-modal-assignee-trigger:hover,
.task-modal-assignee-trigger:focus-visible {
  border-color: var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
}
.task-modal-assignee-trigger.is-empty { color: var(--text-muted); }
.task-modal-assignee-trigger > span { font-size: .73rem; font-weight: 650; }

@media (hover: none) {
  .task-row-title-edit { opacity: 1; }
}

@media (max-width: 1100px) {
  .tasks-shell { padding-inline: 14px; }
  .tasks-create-inline { flex-basis: 220px; }
}

/* Direct booking lifecycle: the same availability, quote and request controls
   are reused by Calendar, Inbox and phone. */
.direct-booking-policy-control-grid > .is-wide { grid-column: 1 / -1; }
.direct-booking-availability {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-input) 68%, transparent);
}
.direct-booking-availability > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.direct-booking-availability > header > div:first-child { display: grid; gap: 1px; }
.direct-booking-availability > header strong { color: var(--text-primary); font-size: 0.74rem; }
.direct-booking-availability > header span { color: var(--text-muted); font-size: 0.63rem; }
.direct-booking-availability-nav { display: flex; align-items: center; gap: 5px; }
.direct-booking-availability-nav > span { min-width: 88px; color: var(--text-soft) !important; text-align: center; font-weight: 650; }
.direct-booking-availability-nav button {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--text-muted);
  cursor: pointer;
}
.direct-booking-availability-weekdays,
.direct-booking-availability-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.direct-booking-availability-weekdays span { color: var(--text-muted); font-size: 0.57rem; font-weight: 700; text-align: center; }
.direct-booking-availability-grid button {
  position: relative;
  min-width: 0;
  min-height: 31px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: color-mix(in srgb, #22c55e 5%, var(--bg-deep));
  color: var(--text-soft);
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}
.direct-booking-availability-grid button:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 52%, var(--border-subtle)); color: var(--text-primary); }
.direct-booking-availability-grid button.is-outside { opacity: 0.42; }
.direct-booking-availability-grid button.is-blocked {
  border-color: color-mix(in srgb, #f59e0b 34%, var(--border-subtle));
  background: repeating-linear-gradient(135deg, color-mix(in srgb, #f59e0b 12%, var(--bg-deep)) 0 4px, var(--bg-deep) 4px 8px);
  color: color-mix(in srgb, #f59e0b 72%, var(--text-soft));
}
.direct-booking-availability-grid button.is-occupied {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--text-muted) 9%, var(--bg-deep)) 0 4px, var(--bg-deep) 4px 8px);
  color: var(--text-muted);
}
.direct-booking-availability-grid button:disabled { cursor: not-allowed; opacity: 0.42; }
.direct-booking-availability-grid button.is-range,
.direct-booking-availability-grid button.is-start,
.direct-booking-availability-grid button.is-end {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-deep));
  color: var(--text-primary);
  opacity: 1;
}
.direct-booking-availability-grid button.is-start,
.direct-booking-availability-grid button.is-end { background: var(--accent); color: #fff; font-weight: 750; }
.direct-booking-availability-state { min-height: 142px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-muted); font-size: 0.68rem; }
.direct-booking-availability-state.is-error { flex-direction: column; color: #ef7d7d; }
.direct-booking-availability-state button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--accent); cursor: pointer; }
.direct-booking-availability > footer { display: flex; flex-wrap: wrap; gap: 10px; color: var(--text-muted); font-size: 0.58rem; }
.direct-booking-availability > footer span { display: inline-flex; align-items: center; gap: 4px; }
.direct-booking-availability > footer i { width: 8px; height: 8px; border-radius: 2px; background: color-mix(in srgb, #22c55e 24%, var(--bg-deep)); }
.direct-booking-availability > footer i.is-blocked { background: #f59e0b; opacity: 0.72; }
.direct-booking-availability > footer i.is-occupied { background: var(--text-muted); opacity: 0.45; }
.direct-booking-availability > footer i.is-selected { background: var(--accent); }

.direct-booking-waterfall {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-deep));
}
.direct-booking-waterfall header,
.direct-booking-waterfall footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.direct-booking-waterfall header > div { display: grid; gap: 1px; }
.direct-booking-waterfall header strong,
.direct-booking-waterfall footer { color: var(--text-primary); font-size: 0.72rem; font-weight: 700; }
.direct-booking-waterfall header span,
.direct-booking-waterfall header small,
.direct-booking-waterfall p { color: var(--text-muted); font-size: 0.6rem; }
.direct-booking-waterfall ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.direct-booking-waterfall li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 5px 0; border-top: 1px solid color-mix(in srgb, var(--border-subtle) 68%, transparent); color: var(--text-soft); font-size: 0.66rem; }
.direct-booking-waterfall li small { grid-column: 1 / -1; color: var(--text-muted); font-size: 0.56rem; }
.direct-booking-waterfall footer { padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.direct-booking-waterfall p,
.direct-booking-waterfall-unavailable { margin: 0; line-height: 1.4; }
.direct-booking-waterfall-unavailable { margin-top: 8px; color: var(--text-muted); font-size: 0.63rem; }

.direct-payment-request-card { text-align: left; }
.direct-payment-state-icon { width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.direct-payment-state-icon.is-success { background: color-mix(in srgb, #22c55e 14%, transparent); color: #22c55e; }
.direct-payment-state-icon.is-error { background: color-mix(in srgb, #ef4444 14%, transparent); color: #ef4444; }
.direct-payment-request-stay { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-base); color: var(--accent); }
.direct-payment-request-stay span { display: grid; gap: 2px; color: var(--text-muted); font-size: 0.76rem; }
.direct-payment-request-stay strong { color: var(--text-primary); font-size: 0.84rem; }
.direct-payment-request-money { display: grid; gap: 7px; margin: 0; }
.direct-payment-request-money > div { display: flex; justify-content: space-between; gap: 20px; color: var(--text-muted); }
.direct-payment-request-money dt,
.direct-payment-request-money dd { margin: 0; }
.direct-payment-request-money .is-total { padding-top: 10px; border-top: 1px solid var(--border-subtle); color: var(--text-primary); font-size: 1rem; font-weight: 750; }
.direct-payment-request-notice { display: flex; align-items: flex-start; gap: 7px; padding: 10px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 8%, var(--bg-base)); font-size: 0.78rem; }
.direct-payment-request-notice svg { flex: 0 0 auto; margin-top: 2px; color: var(--accent); }
.direct-payment-request-pay { min-height: 46px; justify-content: center; font-size: 0.9rem; }
.direct-payment-request-deadline { text-align: center; font-size: 0.72rem; }

.direct-thread-card {
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  margin: 10px 16px 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
  box-shadow: 0 8px 24px -20px color-mix(in srgb, var(--accent) 70%, transparent);
}
.direct-thread-card-head { display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.direct-thread-card-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.direct-thread-card-head > div { display: grid; gap: 1px; }
.direct-thread-card-head strong { color: var(--text-primary); font-size: 13px; }
.direct-thread-card-head small { color: var(--text-muted); font-size: 11px; line-height: 1.35; }
.direct-thread-card-refresh { display: grid; width: 28px; height: 28px; place-items: center; padding: 0; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-input); color: var(--text-muted); cursor: pointer; }
.direct-thread-card-refresh:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle)); color: var(--accent); }
.direct-thread-card-refresh:disabled { cursor: default; opacity: 0.65; }
.direct-thread-request-list { display: grid; gap: 8px; }
.direct-thread-card.is-history-only { padding: 8px 10px; border-color: var(--border-subtle); background: var(--bg-elevated); box-shadow: none; }
.direct-thread-request-history { min-width: 0; }
.direct-thread-request-history > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.direct-thread-request-history > summary::-webkit-details-marker { display: none; }
.direct-thread-request-history > summary::after { content: "+"; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.direct-thread-request-history[open] > summary::after { content: "−"; }
.direct-thread-request-history > summary span { margin-left: auto; color: var(--text-soft); }
.direct-thread-request-history > .direct-thread-request-list { padding-top: 8px; }
.direct-thread-request { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-deep); }
.direct-thread-request > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.direct-thread-request > header > small { color: var(--text-muted); font-size: 10px; }
.direct-thread-request-state { display: inline-flex; align-items: center; gap: 5px; width: fit-content; color: var(--text-muted); font-size: 11px; font-weight: 750; }
.direct-thread-request-state.is-paid { color: #22c55e; }
.direct-thread-request-state.is-handled { color: #38bdf8; }
.direct-thread-request-state.is-danger { color: #ef4444; }
.direct-thread-request-state.is-attention,
.direct-thread-request-state.is-held { color: #f59e0b; }
.direct-thread-request-state.is-confirmed { color: #22c55e; }
.direct-thread-request-state.is-open { color: var(--accent); }
.direct-thread-request-stay { display: grid; gap: 2px; }
.direct-thread-request-stay strong { color: var(--text-primary); font-size: 12px; }
.direct-thread-request-stay span { color: var(--text-muted); font-size: 10.5px; }
.direct-thread-request-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 0; }
.direct-thread-request-money.is-single { grid-template-columns: minmax(0, 1fr); }
.direct-thread-request-money > div { display: grid; gap: 1px; padding: 6px 7px; border-radius: 7px; background: var(--bg-input); }
.direct-thread-request-money dt { color: var(--text-muted); font-size: 9.5px; }
.direct-thread-request-money dd { overflow: hidden; margin: 0; color: var(--text-primary); font-size: 11px; font-weight: 700; text-overflow: ellipsis; }
.direct-thread-request-details { min-width: 0; border-top: 1px solid var(--border-subtle); padding-top: 6px; }
.direct-thread-request-details > summary { color: var(--text-muted); font-size: 10.5px; font-weight: 700; cursor: pointer; }
.direct-thread-request-details-body { display: grid; gap: 8px; padding-top: 8px; }
.direct-thread-request-extras { display: grid; gap: 5px; padding: 7px 8px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-input); }
.direct-thread-request-extras > strong { color: var(--text-primary); font-size: 10px; }
.direct-thread-request-extras ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.direct-thread-request-extras li { display: flex; justify-content: space-between; gap: 10px; color: var(--text-muted); font-size: 10px; }
.direct-thread-request-extras li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.direct-thread-request-extras li b { flex: none; color: var(--text-primary); font-size: 10px; }
.direct-thread-request-facts { display: grid; gap: 4px; }
.direct-thread-request-facts > span { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 10px; line-height: 1.35; }
.direct-thread-request-facts svg { flex: 0 0 auto; color: var(--accent); }
.direct-thread-request-facts strong { color: var(--text-soft); }
.direct-thread-cancellation { display: grid; gap: 7px; padding: 9px; border: 1px solid color-mix(in srgb, #f59e0b 38%, var(--border-subtle)); border-radius: 9px; background: color-mix(in srgb, #f59e0b 6%, var(--bg-input)); }
.direct-thread-cancellation.is-completed { border-color: color-mix(in srgb, #22c55e 35%, var(--border-subtle)); background: color-mix(in srgb, #22c55e 5%, var(--bg-input)); }
.direct-thread-cancellation.is-failed { border-color: color-mix(in srgb, #ef4444 38%, var(--border-subtle)); }
.direct-thread-cancellation-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.direct-thread-cancellation-head > span { display: inline-flex; align-items: center; gap: 5px; color: #f59e0b; font-size: 11px; }
.direct-thread-cancellation-head time { color: var(--text-muted); font-size: 9.5px; }
.direct-thread-cancellation > p { margin: 0; color: var(--text-muted); font-size: 10px; line-height: 1.4; }
.direct-thread-cancellation > dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0; }
.direct-thread-cancellation > dl > div { display: grid; gap: 1px; padding: 6px; border-radius: 7px; background: var(--bg-deep); }
.direct-thread-cancellation dt { color: var(--text-muted); font-size: 9px; }
.direct-thread-cancellation dd { margin: 0; color: var(--text-primary); font-size: 10.5px; font-weight: 700; }
.direct-thread-cancellation-review { display: grid; gap: 6px; }
.direct-thread-cancellation-review label { display: grid; gap: 3px; color: var(--text-muted); font-size: 9.5px; }
.direct-thread-cancellation-review label span { color: var(--text-soft); font-weight: 700; }
.direct-thread-cancellation-review label em { font-style: normal; font-weight: 500; }
.direct-thread-cancellation-review input,
.direct-thread-cancellation-review textarea { min-height: 32px; padding: 6px 7px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-deep); color: var(--text-primary); font: inherit; font-size: 10.5px; }
.direct-thread-cancellation-review textarea { min-height: 52px; resize: vertical; }
.direct-thread-cancellation-review > div { display: flex; flex-wrap: wrap; gap: 5px; }
.direct-thread-cancellation button { min-height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 9px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-deep); color: var(--text-soft); font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.direct-thread-cancellation button.is-primary { border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle)); color: var(--accent); }
.direct-thread-cancellation button.is-danger { color: #ef7d7d; }
.direct-thread-cancellation button:disabled { cursor: default; opacity: .55; }
.direct-thread-guest-message { margin: 0; padding: 8px 9px; border-left: 2px solid color-mix(in srgb, var(--accent) 55%, var(--border-subtle)); border-radius: 0 7px 7px 0; background: var(--bg-input); color: var(--text-soft); font-size: 10.5px; line-height: 1.45; white-space: pre-wrap; }
.direct-thread-request-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.direct-thread-request-actions button,
.direct-thread-request-actions a,
.direct-thread-request-manage button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-soft);
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
.direct-thread-request-actions button:first-child { border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle)); color: var(--accent); }
.direct-thread-guest-decision { display: grid; gap: 7px; padding: 8px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-input); }
.direct-thread-guest-decision label { display: grid; gap: 4px; color: var(--text-muted); font-size: 10px; }
.direct-thread-guest-decision label span { font-weight: 700; }
.direct-thread-guest-decision label em { font-weight: 500; }
.direct-thread-guest-decision textarea { width: 100%; min-height: 54px; resize: vertical; padding: 7px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-deep); color: var(--text-primary); font: inherit; }
.direct-thread-guest-decision > div { display: flex; flex-wrap: wrap; gap: 5px; }
.direct-thread-guest-decision button { display: inline-flex; min-height: 30px; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-deep); color: var(--text-soft); font-size: 10.5px; font-weight: 700; cursor: pointer; }
.direct-thread-guest-decision button.is-danger { color: #ef7d7d; }
.direct-thread-handled-elsewhere {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(160px, 0.75fr);
  gap: 9px 12px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, #38bdf8 32%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, #38bdf8 7%, var(--bg-input));
}
.direct-thread-handled-elsewhere > div:first-child { display: grid; gap: 2px; }
.direct-thread-handled-elsewhere strong { color: var(--text-primary); font-size: 11px; }
.direct-thread-handled-elsewhere p { margin: 0; color: var(--text-muted); font-size: 9.5px; line-height: 1.45; }
.direct-thread-handled-elsewhere label { display: grid; align-content: start; gap: 4px; color: var(--text-muted); font-size: 9.5px; font-weight: 650; }
.direct-thread-handled-elsewhere select { min-width: 0; min-height: 31px; padding: 4px 7px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-deep); color: var(--text-primary); font: inherit; font-size: 10.5px; }
.direct-thread-handled-elsewhere > div:last-child { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.direct-thread-handled-elsewhere button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 31px; padding: 5px 9px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-deep); color: var(--text-soft); font: inherit; font-size: 10.5px; font-weight: 700; cursor: pointer; }
.direct-thread-handled-elsewhere button.is-primary { border-color: color-mix(in srgb, #38bdf8 42%, var(--border-subtle)); color: color-mix(in srgb, #38bdf8 72%, var(--text-primary)); }
.direct-thread-handled-elsewhere button:disabled { cursor: wait; opacity: 0.68; }
.direct-thread-request-manage,
.direct-thread-request-activity { border-top: 1px solid var(--border-subtle); padding-top: 6px; }
.direct-thread-request-manage summary,
.direct-thread-request-activity summary { color: var(--text-muted); font-size: 10.5px; font-weight: 650; cursor: pointer; }
.direct-thread-request-manage > div { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 7px; }
.direct-thread-request-manage label { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 10px; }
.direct-thread-request-manage select { min-height: 30px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 10.5px; }
.direct-thread-request-manage .direct-thread-balance-request { flex: 1 1 100%; display: grid; grid-template-columns: minmax(95px, 0.45fr) minmax(130px, 1fr) auto; gap: 6px; padding: 7px; border: 1px solid var(--border-subtle); border-radius: 8px; background: color-mix(in srgb, var(--accent) 4%, var(--bg-input)); }
.direct-thread-balance-request > span { grid-column: 1 / -1; color: var(--text-soft); font-weight: 700; }
.direct-thread-balance-request input { min-width: 0; min-height: 30px; box-sizing: border-box; padding: 5px 7px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-deep); color: var(--text-primary); font: inherit; font-size: 10.5px; }
.direct-thread-request-manage button.is-danger { color: #ef7d7d; }
.direct-thread-request-activity ol { display: grid; gap: 5px; margin: 7px 0 0; padding: 0; list-style: none; }
.direct-thread-request-activity li { display: flex; justify-content: space-between; gap: 8px; color: var(--text-soft); font-size: 10px; }
.direct-thread-request-activity time { flex: 0 0 auto; color: var(--text-muted); }
.direct-thread-request-error { margin: 0; color: #ef7d7d; font-size: 10.5px; }

.direct-thread-booking-overlay { position: fixed; z-index: 2400; inset: 0; display: grid; place-items: center; padding: 24px; background: rgb(4 6 12 / 72%); backdrop-filter: blur(5px); }
.direct-thread-booking-modal { width: min(760px, 100%); max-height: min(92dvh, 940px); overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid var(--border-subtle); border-radius: 16px; background: var(--bg-elevated); box-shadow: 0 30px 100px rgb(0 0 0 / 45%); }
.direct-thread-booking-modal-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--border-subtle); }
.direct-thread-booking-modal-head > div { display: grid; gap: 3px; }
.direct-thread-booking-modal-head span { color: var(--accent); font-size: 0.68rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
.direct-thread-booking-modal-head h2 { margin: 0; color: var(--text-primary); font-size: 1.05rem; }
.direct-thread-booking-modal-head p { margin: 0; color: var(--text-muted); font-size: 0.72rem; line-height: 1.45; }
.direct-thread-booking-modal-head > button { display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-input); color: var(--text-muted); cursor: pointer; }
.direct-thread-booking-modal-body { overflow-y: auto; padding: 18px 20px 24px; }
.direct-collection-form { display: grid; gap: 12px; }
.direct-collection-form > label { display: grid; gap: 5px; color: var(--text-muted); font-size: 0.68rem; font-weight: 650; }
.direct-collection-form > .direct-booking-duration { color: var(--text-muted); font-size: 0.68rem; font-weight: 650; }
.direct-collection-form > label > input,
.direct-collection-form > label > select,
.direct-collection-amount { box-sizing: border-box; width: 100%; min-height: 38px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 0.76rem; }
.direct-collection-form > label > input,
.direct-collection-form > label > select { padding: 7px 9px; }
.direct-collection-amount { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; overflow: hidden; }
.direct-collection-amount i { padding-left: 9px; color: var(--text-muted); font-style: normal; font-weight: 750; }
.direct-collection-amount input { min-width: 0; min-height: 36px; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; padding: 7px 9px; }
.direct-collection-form fieldset { display: flex; gap: 14px; margin: 0; padding: 0; border: 0; color: var(--text-muted); font-size: 0.7rem; }
.direct-collection-form fieldset legend { margin-bottom: 6px; font-weight: 650; }
.direct-collection-form fieldset label { display: inline-flex; align-items: center; gap: 6px; }
.direct-collection-form > .btn { justify-content: center; min-height: 42px; }
.direct-thread-deadline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}
.direct-thread-deadline-control > .direct-booking-duration { min-width: 0; }
.direct-thread-deadline-control > button { min-height: 36px; }
.direct-booking-pending-explainer p { margin: 3px 0 0; color: var(--text-muted); font-size: 0.65rem; line-height: 1.4; }

.ph-convo .direct-thread-card { margin: 8px 10px 0; border-color: color-mix(in srgb, var(--accent) 34%, var(--ph-line)); background: color-mix(in srgb, var(--accent) 5%, var(--ph-card)); }
.ph-convo .direct-thread-card-head strong,
.ph-convo .direct-thread-request-stay strong { color: var(--ph-text); }
.ph-convo .direct-thread-card-head small,
.ph-convo .direct-thread-request-stay span { color: var(--ph-text-2); }

@media (max-width: 640px) {
  .direct-booking-field-grid,
  .direct-booking-policy-control-grid { grid-template-columns: 1fr; }
  .direct-booking-field.is-wide,
  .direct-booking-policy-control-grid > .is-wide { grid-column: auto; }
  .direct-booking-availability > header { align-items: flex-start; flex-direction: column; }
  .direct-booking-availability-nav { width: 100%; justify-content: space-between; }
  .direct-booking-availability-grid button { min-height: 36px; }
  .direct-thread-request-money { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .direct-thread-request-actions button,
  .direct-thread-request-actions a { min-height: 38px; }
  .direct-thread-request-manage > div { display: grid; grid-template-columns: 1fr; }
  .direct-thread-request-manage label { display: grid; grid-template-columns: 1fr auto auto; }
  .direct-thread-deadline-control { grid-template-columns: 1fr; }
  .direct-thread-request-manage .direct-thread-balance-request { grid-template-columns: 1fr; }
  .direct-thread-balance-request > span { grid-column: auto; }
  .direct-thread-request-manage button { min-height: 38px; }
  .direct-thread-handled-elsewhere { grid-template-columns: 1fr; }
  .direct-thread-handled-elsewhere > div:last-child { grid-column: auto; display: grid; grid-template-columns: 1fr; }
  .direct-thread-handled-elsewhere button { min-height: 38px; }
  .direct-thread-booking-overlay { place-items: end stretch; padding: 0; }
  .direct-thread-booking-modal { width: 100%; max-height: calc(96dvh - env(safe-area-inset-top)); border-radius: 18px 18px 0 0; }
  .direct-thread-booking-modal-head { padding: 16px 15px 13px; }
  .direct-thread-booking-modal-body { padding: 14px 15px calc(22px + env(safe-area-inset-bottom)); }
}

/* Sibling pin — other workspace listings. Compact circular thumb. */
.properties-map-pin--sibling {
  cursor: pointer;
  opacity: 0.86;
  transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.properties-map-pin--sibling:hover {
  opacity: 1;
  transform: translateY(-2px) scale(1.12);
}

.properties-map-pin--sibling .properties-map-pin-frame {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  /* Dark outer ring + inset white halo: reads on snow, water, or city tiles. */
  border: 2px solid #0f172a;
  font-size: 0.7rem;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.92),
    0 0 0 1px rgba(15, 23, 42, 0.4),
    0 4px 10px rgba(0, 0, 0, 0.4);
}

.properties-map-pin--sibling.properties-map-pin--fallback .properties-map-pin-frame {
  background-color: color-mix(in srgb, var(--text-soft) 30%, var(--bg-elevated));
  color: var(--text-primary);
}

/* Hover tooltip — Leaflet renders these as `.leaflet-tooltip` siblings of
   the marker, so we override that base class scoped to our custom one. */
.leaflet-tooltip.properties-map-tooltip {
  background: color-mix(in srgb, var(--bg-elevated) 96%, transparent);
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, transparent);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42), 0 2px 6px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}

.leaflet-tooltip.properties-map-tooltip.is-primary {
  font-size: 0.78rem;
  padding: 0.32rem 0.65rem;
  border-color: color-mix(in srgb, var(--brand-primary) 38%, var(--border-subtle));
}

.leaflet-tooltip.properties-map-tooltip::before {
  border-top-color: color-mix(in srgb, var(--bg-elevated) 96%, transparent);
}

.properties-map-loading {
  min-height: 300px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--table-surface) 92%, transparent) 25%,
    color-mix(in srgb, var(--bg-elevated) 58%, transparent) 50%,
    color-mix(in srgb, var(--table-surface) 92%, transparent) 75%
  );
  background-size: 230% 100%;
  animation: properties-field-skeleton 1.35s ease-in-out infinite;
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-soft);
}

/* Amenity grid uses a flow layout (not a fixed-column grid) so pill items
   wrap naturally based on label length — denser, more flagship reading
   than a strict 2/3-column grid of disconnected rows. */
.properties-amenity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.32rem;
  padding: 0.65rem 0.8rem 0.75rem;
  border-top: 1px dashed color-mix(in srgb, var(--border-subtle) 60%, transparent);
}

/* Pill toggle — replaces native checkbox + raw text. Checked = brand-tinted
   filled pill with a tick mark; unchecked = subtle outlined pill that
   contrasts cleanly without dominating the page. */
.properties-amenity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.32rem 0.7rem 0.32rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 95%, transparent);
  background: color-mix(in srgb, var(--bg-input) 55%, transparent);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition:
    border-color 0.14s ease,
    background 0.14s ease,
    color 0.14s ease,
    transform 0.12s cubic-bezier(0.22, 1, 0.36, 1);
  appearance: none;
}

.properties-amenity-pill:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-input) 100%, transparent);
  border-color: color-mix(in srgb, var(--ring) 22%, var(--border-subtle));
  transform: translateY(-0.5px);
}

.properties-amenity-pill:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
}

.properties-amenity-pill.is-checked {
  color: color-mix(in srgb, var(--brand-primary) 80%, var(--text-primary));
  background: color-mix(in srgb, var(--brand-primary) 16%, var(--bg-input));
  border-color: color-mix(in srgb, var(--brand-primary) 45%, var(--border-subtle));
  font-weight: 600;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.properties-amenity-pill.is-checked:hover {
  background: color-mix(in srgb, var(--brand-primary) 22%, var(--bg-input));
}

/* The tick mark slot reserves space even when empty so checked/unchecked
   pills stay the same width and don't shuffle on toggle. */
.properties-amenity-pill-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--border-subtle) 95%, transparent);
  color: #fff;
  background: transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.properties-amenity-pill.is-checked .properties-amenity-pill-mark {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  box-shadow: 0 0 6px color-mix(in srgb, var(--brand-primary) 35%, transparent);
}

.properties-amenity-pill-label {
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

/* Filter chips above the catalogue — segmented selector showing All /
   Selected / Available. */
.properties-amenity-filter-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  margin: 0 0 0.55rem;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--border-subtle) 22%, var(--bg-input));
}

.properties-amenity-filter-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.properties-amenity-filter-chip:hover:not(.is-active) {
  color: var(--text-primary);
}

.properties-amenity-filter-chip.is-active {
  background: var(--bg-elevated);
  color: color-mix(in srgb, var(--brand-primary) 80%, var(--text-primary));
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 0 0 1px color-mix(in srgb, var(--brand-primary) 25%, transparent);
}

/* ── Light-mode tightening ──────────────────────────────────────────────
   Dark-mode defaults rely on background mixes that read fine against
   var(--bg-input) when that's a dark surface. In light mode it becomes
   pure white, so the same translucent borders/backdrops vanish. These
   overrides give the controls visible structure on white. */
[data-theme="light"] .properties-amenity-pill {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(15, 23, 42, 0.03);
  color: #3f3f46;
}

[data-theme="light"] .properties-amenity-pill:hover {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(79, 70, 229, 0.4);
  color: #18181b;
}

[data-theme="light"] .properties-amenity-pill.is-checked {
  background: color-mix(in srgb, var(--brand-primary) 12%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-primary) 50%, rgba(15, 23, 42, 0.14));
  color: color-mix(in srgb, var(--brand-primary) 90%, #18181b);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 28%, transparent);
}

[data-theme="light"] .properties-amenity-pill.is-checked:hover {
  background: color-mix(in srgb, var(--brand-primary) 18%, #ffffff);
}

[data-theme="light"] .properties-amenity-pill-mark {
  border-color: rgba(15, 23, 42, 0.22);
}

[data-theme="light"] .properties-amenity-pill.is-checked .properties-amenity-pill-mark {
  border-color: var(--brand-primary);
}

[data-theme="light"] .properties-amenity-filter-row {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .properties-amenity-filter-chip.is-active {
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.08),
    0 0 0 1px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

[data-theme="light"] .properties-amenity-cat-bulk:hover {
  background: color-mix(in srgb, var(--brand-primary) 8%, #ffffff);
}

[data-theme="light"] .properties-amenity-cat-bulk.is-clear:hover {
  background: color-mix(in srgb, var(--state-warning) 10%, #ffffff);
}

[data-theme="light"] .properties-amenity-cat-count {
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .properties-amenity-cat-count.is-active {
  color: color-mix(in srgb, var(--brand-primary) 80%, #18181b);
  background: color-mix(in srgb, var(--brand-primary) 12%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-primary) 40%, rgba(15, 23, 42, 0.1));
}

[data-theme="light"] .properties-amenity-category {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .properties-amenity-category:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 22%, rgba(15, 23, 42, 0.08));
}

[data-theme="light"] .properties-amenity-cat-head:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .properties-amenities-summary {
  background: color-mix(in srgb, var(--brand-primary) 8%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-primary) 22%, rgba(15, 23, 42, 0.1));
  color: var(--text-primary);
}

[data-theme="light"] .properties-amenities-bulk-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .properties-amenities-search-input {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.14) !important;
}

/* ── Channel filter row + per-pill platform badges ──────────────────────
   Lets users (a) narrow the catalogue to a single OTA and (b) see which
   channels each amenity will fan out to without leaving the page.

   The filter bar wraps both filter groups (status + channel) onto a single
   row at typical widths and breaks gracefully when the section is narrow. */
.properties-amenity-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin: 0 0 0.55rem;
}

.properties-amenity-filter-bar .properties-amenity-filter-row {
  margin: 0;
}

.properties-amenity-channel-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.properties-amenity-channel-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.2rem 0.55rem 0.2rem 0.32rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-input) 60%, transparent);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.12s;
}

.properties-amenity-channel-chip.is-all {
  padding: 0.2rem 0.65rem;
}

.properties-amenity-channel-chip:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--channel-color, var(--ring)) 45%, var(--border-subtle));
  transform: translateY(-0.5px);
}

.properties-amenity-channel-chip.is-active {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--channel-color, var(--brand-primary)) 14%, var(--bg-input));
  border-color: color-mix(in srgb, var(--channel-color, var(--brand-primary)) 65%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--channel-color, var(--brand-primary)) 22%, transparent);
}

.properties-amenity-channel-chip.is-all.is-active {
  background: color-mix(in srgb, var(--brand-primary) 14%, var(--bg-input));
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 22%, transparent);
}

.properties-amenity-channel-chip-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 4px;
  background: var(--channel-color, var(--brand-primary));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

/* Channels not connected to this listing — the filter chip is still clickable
   (lets users preview "what would I gain by adding this channel?") but
   visually de-emphasised so the live channels stand out. */
.properties-amenity-channel-chip.is-channel-inactive {
  opacity: 0.55;
}

.properties-amenity-channel-chip.is-channel-inactive:hover,
.properties-amenity-channel-chip.is-channel-inactive.is-active {
  opacity: 1;
}

.properties-amenity-channel-chip.is-channel-inactive .properties-amenity-channel-chip-dot {
  background: color-mix(in srgb, var(--channel-color, var(--brand-primary)) 65%, var(--text-soft));
}

[data-theme="light"] .properties-amenity-channel-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #3f3f46;
}

[data-theme="light"] .properties-amenity-channel-chip.is-active {
  background: color-mix(in srgb, var(--channel-color, var(--brand-primary)) 10%, #ffffff);
  border-color: color-mix(in srgb, var(--channel-color, var(--brand-primary)) 55%, rgba(15, 23, 42, 0.14));
  color: #18181b;
}

/* Per-pill: row of tiny brand-coloured monogram chips on the right edge.
   Hidden when the pill is in "custom" mode (replaced by a Custom marker). */
.properties-amenity-pill-platforms {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 0.3rem;
  padding-left: 0.42rem;
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
}

.properties-amenity-platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14px;
  height: 12px;
  padding: 0 2.5px;
  border-radius: 3px;
  background: var(--channel-color, var(--brand-primary));
  color: #fff;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
  transition: opacity 0.14s, background 0.14s;
}

/* Channel isn't connected to this listing — fade the badge so live channels
   read first. The colour is preserved (just muted) so the user can still
   tell which channel is which. */
.properties-amenity-platform-badge.is-inactive {
  opacity: 0.42;
  background: color-mix(in srgb, var(--channel-color, var(--brand-primary)) 50%, var(--text-soft));
}

.properties-amenity-pill:hover .properties-amenity-platform-badge.is-inactive {
  opacity: 0.7;
}

.properties-amenity-pill.is-checked .properties-amenity-pill-platforms {
  border-left-color: color-mix(in srgb, var(--brand-primary) 25%, transparent);
}

[data-theme="light"] .properties-amenity-pill-platforms {
  border-left-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .properties-amenity-pill.is-checked .properties-amenity-pill-platforms {
  border-left-color: color-mix(in srgb, var(--brand-primary) 35%, rgba(15, 23, 42, 0.12));
}

/* Custom amenity — not in the channel map. Subtle muted treatment so users
   know it'll save locally but won't push anywhere. */
.properties-amenity-pill-custom {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  padding: 1px 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--border-subtle) 60%, transparent);
  color: var(--text-soft);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.properties-amenity-pill.is-custom .properties-amenity-pill-label {
  font-style: italic;
}

[data-theme="light"] .properties-amenity-pill-custom {
  background: rgba(15, 23, 42, 0.08);
  color: #52525b;
}

/* Orphaned = selected, has platforms, but none overlap with the listing's
   connected channels. The tick is real but the save will silently no-op for
   amenity sync — flag it with the warning palette so the user knows. */
.properties-amenity-pill.is-orphaned.is-checked {
  background: color-mix(in srgb, var(--state-warning) 14%, var(--bg-input));
  border-color: color-mix(in srgb, var(--state-warning) 60%, var(--border-subtle));
  color: color-mix(in srgb, var(--state-warning) 85%, var(--text-primary));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--state-warning) 28%, transparent);
}

.properties-amenity-pill.is-orphaned.is-checked:hover {
  background: color-mix(in srgb, var(--state-warning) 22%, var(--bg-input));
}

.properties-amenity-pill.is-orphaned.is-checked .properties-amenity-pill-mark {
  background: var(--state-warning);
  border-color: var(--state-warning);
  box-shadow: 0 0 6px color-mix(in srgb, var(--state-warning) 35%, transparent);
}

[data-theme="light"] .properties-amenity-pill.is-orphaned.is-checked {
  background: color-mix(in srgb, var(--state-warning) 10%, #ffffff);
  border-color: color-mix(in srgb, var(--state-warning) 55%, rgba(15, 23, 42, 0.14));
  color: color-mix(in srgb, var(--state-warning) 70%, #18181b);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--state-warning) 32%, transparent);
}

[data-theme="light"] .properties-amenity-pill.is-orphaned.is-checked:hover {
  background: color-mix(in srgb, var(--state-warning) 16%, #ffffff);
}

.properties-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-soft);
  margin: 0.35rem 0;
}

.properties-counts span {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--table-surface);
  border: 1px solid var(--border-subtle);
}

.properties-add-room {
  font-size: 0.78rem;
  min-height: 34px;
  margin-bottom: 0;
}

.properties-rooms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.7rem 0 0.45rem;
}

/* Quick-add buttons next to the "Rooms" heading. Each is a chip with an
   icon + label that adds a preset room (auto-numbered name, sensible
   defaults). Wraps to a second line on narrow widths. */
.properties-room-quickadd {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.properties-room-quickadd-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.65rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s, transform 0.12s;
}

.properties-room-quickadd-btn:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--ring) 45%, var(--border-strong));
  transform: translateY(-0.5px);
}

.properties-room-quickadd-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
}

.properties-room-quickadd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--brand-primary) 85%, var(--text-primary));
}

[data-theme="light"] .properties-room-quickadd-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #3f3f46;
}

[data-theme="light"] .properties-room-quickadd-btn:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 40%, rgba(15, 23, 42, 0.14));
  color: #18181b;
}

/* Empty state when no rooms are configured. Centred, friendly, encourages
   the first add without taking up too much vertical space. */
.properties-rooms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  text-align: center;
  padding: 1.2rem 1rem 1.3rem;
  border: 1px dashed color-mix(in srgb, var(--border-subtle) 90%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-elevated) 60%, transparent);
}

.properties-rooms-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand-primary) 14%, var(--bg-elevated));
  color: color-mix(in srgb, var(--brand-primary) 85%, var(--text-primary));
  margin-bottom: 0.18rem;
}

.properties-rooms-empty-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.properties-rooms-empty-sub {
  font-size: 0.76rem;
  line-height: 1.4;
  max-width: 32rem;
  margin: 0;
}

[data-theme="light"] .properties-rooms-empty {
  background: rgba(15, 23, 42, 0.025);
  border-color: rgba(15, 23, 42, 0.12);
}

.properties-room {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.65rem 0.8rem 0.8rem;
  margin-top: 0.5rem;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  transition: border-color 0.14s, box-shadow 0.14s;
}

.properties-room:hover {
  border-color: color-mix(in srgb, var(--ring) 18%, var(--border-subtle));
}

/* Room card header — icon + auto-titled label + tiny × close. Sits above
   the editable fields so users get a fast scan of the rooms list. */
.properties-room-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.55rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--border-subtle) 70%, transparent);
}

.properties-room-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand-primary) 14%, var(--bg-elevated));
  color: color-mix(in srgb, var(--brand-primary) 85%, var(--text-primary));
  flex-shrink: 0;
}

.properties-room-card-title {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Room removal — discoverable at rest (icon + label), red on hover so the
   destructive intent reads on engagement. Outline-style by default to match
   the secondary-button language used elsewhere in the editor. */
.properties-room-card-remove {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.26rem 0.55rem;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s, color 0.14s, border-color 0.14s, transform 0.12s;
}

.properties-room-card-remove:hover {
  background: color-mix(in srgb, #ef4444 14%, transparent);
  color: #f87171;
  border-color: color-mix(in srgb, #ef4444 35%, var(--border-strong));
  transform: translateY(-0.5px);
}

.properties-room-card-remove:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, #ef4444 22%, transparent);
}

[data-theme="light"] .properties-room-card-remove {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #3f3f46;
}

[data-theme="light"] .properties-room-card-remove:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.45);
}

[data-theme="light"] .properties-room {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .properties-room:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 24%, rgba(15, 23, 42, 0.1));
}

[data-theme="light"] .properties-room-card-icon {
  background: color-mix(in srgb, var(--brand-primary) 10%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, rgba(15, 23, 42, 0.08));
}

[data-theme="light"] .properties-room-card-head {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

.properties-room-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.properties-room-beds {
  margin-top: 0.15rem;
}

/* Quick-add bed presets — chip row beneath any existing bed chips. The
   "Other bed" variant is visually quieter so the four common presets stand
   out as the recommended path. */
.properties-bed-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.5rem;
}

.properties-bed-preset-btn {
  appearance: none;
  padding: 0.26rem 0.65rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s, transform 0.12s;
}

.properties-bed-preset-btn:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--ring) 45%, var(--border-strong));
  transform: translateY(-0.5px);
}

.properties-bed-preset-btn.is-other {
  background: transparent;
  border-style: dashed;
}

[data-theme="light"] .properties-bed-preset-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #3f3f46;
}

[data-theme="light"] .properties-bed-preset-btn:hover {
  color: #18181b;
}

[data-theme="light"] .properties-bed-preset-btn.is-other {
  background: transparent;
}

.properties-room-shared {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  margin: 0.25rem 0 0.35rem;
  color: var(--text-soft);
}

.properties-bed-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.properties-bed-list {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
  padding-left: 1rem;
}

.properties-bed-heading {
  font-size: 0.68rem;
  margin: 0.35rem 0 0.2rem;
}

.properties-bed-list-editable {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Chip-style bed entry: type selector + counter stepper + remove × all in
   one rounded pill. Reads as a single unit ("2× King bed") rather than a
   row of disjoint inputs. */
.properties-bed-chip {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-input) 96%, var(--bg-elevated));
  overflow: hidden;
  font-size: 0.78rem;
  transition: border-color 0.14s;
}

.properties-bed-chip:focus-within {
  border-color: color-mix(in srgb, var(--ring) 55%, var(--border-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 16%, transparent);
}

.properties-bed-chip-select {
  appearance: none;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.32rem 0.65rem !important;
  font-size: 0.78rem !important;
  font-weight: 550;
  min-height: 0 !important;
  cursor: pointer;
  border-radius: 999px 0 0 999px !important;
}

.properties-bed-chip-counter {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-left: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--border-subtle) 22%, var(--bg-input));
}

.properties-bed-chip-step {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  width: 1.55rem;
  height: 100%;
  cursor: pointer;
  padding: 0;
  transition: color 0.12s, background 0.12s;
}

.properties-bed-chip-step:hover:not(:disabled) {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--ring) 14%, transparent);
}

.properties-bed-chip-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.properties-bed-chip-count {
  min-width: 1.4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 0 0.15rem;
}

.properties-bed-chip-remove {
  appearance: none;
  border: 0;
  border-left: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-soft);
  padding: 0 0.55rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
}

.properties-bed-chip-remove:hover {
  color: #f87171;
  background: color-mix(in srgb, #ef4444 14%, transparent);
}

.properties-bed-new {
  margin-top: 0.55rem;
}

/* Area input with segmented unit toggle: input on the left, two-button
   sqm/sqft picker on the right, all inside a single bordered shell. */
.properties-area-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-input);
  overflow: hidden;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.properties-area-input:focus-within {
  border-color: color-mix(in srgb, var(--ring) 60%, var(--border-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 14%, transparent);
}

.properties-area-input-value {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.42rem 0.55rem !important;
  flex: 1;
  min-width: 0;
}

.properties-area-input-units {
  display: inline-flex;
  border-left: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--border-subtle) 22%, var(--bg-input));
  padding: 2px;
  gap: 2px;
}

.properties-area-input-unit {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0 0.6rem;
  cursor: pointer;
  border-radius: 7px;
  min-width: 2.4rem;
  transition: background 0.14s, color 0.14s;
}

.properties-area-input-unit:hover:not(.is-active) {
  color: var(--text-primary);
}

.properties-area-input-unit.is-active {
  background: color-mix(in srgb, var(--brand-primary) 22%, var(--bg-elevated));
  color: color-mix(in srgb, var(--brand-primary) 80%, var(--text-primary));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* ── Capacity stepper ────────────────────────────────────────────────────
   Visual upgrade from a bare number input. Three regions: minus button,
   readout (icon + number + "guests" label), plus button — all inside a
   single bordered shell so it reads as one control. */
.properties-capacity-stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-input);
  overflow: hidden;
  transition: border-color 0.14s, box-shadow 0.14s;
}

.properties-capacity-stepper:focus-within {
  border-color: color-mix(in srgb, var(--ring) 60%, var(--border-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 14%, transparent);
}

.properties-capacity-step {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  width: 2.2rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.properties-capacity-step:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ring) 14%, transparent);
  color: var(--text-primary);
}

.properties-capacity-step:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.properties-capacity-value {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.42rem 0.65rem;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--border-subtle) 18%, var(--bg-input));
}

.properties-capacity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--brand-primary) 80%, var(--text-primary));
}

.properties-capacity-number {
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.properties-capacity-suffix {
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Summary chips (Layout section) ──────────────────────────────────────
   Auto-derived layout glance: Sleeps / Bedrooms / Bathrooms / Beds. Icon +
   label per chip, wraps gracefully on narrow widths. */
.properties-layout-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.6rem 0 0.2rem;
}

.properties-layout-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
  border-radius: 999px;
  font-size: 0.74rem;
  color: var(--text-soft);
}

.properties-layout-summary-chip strong {
  color: var(--text-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.properties-layout-summary-chip svg {
  color: color-mix(in srgb, var(--brand-primary) 80%, var(--text-primary));
}

[data-theme="light"] .properties-capacity-stepper {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .properties-capacity-value {
  background: rgba(15, 23, 42, 0.025);
  border-left-color: rgba(15, 23, 42, 0.08);
  border-right-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .properties-layout-summary-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

/* ── Stay-type segmented control (Layout section) ────────────────────────
   Three icon-tagged cards on a single row that scale evenly. The selected
   card lifts slightly with a brand-tinted background and stronger border to
   give the click a satisfying confirmation. */
.properties-stay-type {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  margin: 0 0 0.7rem;
}

.properties-stay-type-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.properties-stay-type-card {
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  text-align: left;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  border-radius: 12px;
  cursor: pointer;
  transition:
    border-color 0.14s ease,
    background 0.14s ease,
    transform 0.12s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.14s ease;
}

.properties-stay-type-card:hover {
  border-color: color-mix(in srgb, var(--ring) 35%, var(--border-strong));
  transform: translateY(-0.5px);
}

.properties-stay-type-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 22%, transparent);
}

.properties-stay-type-card.is-active {
  border-color: color-mix(in srgb, var(--brand-primary) 55%, var(--border-strong));
  background: color-mix(in srgb, var(--brand-primary) 12%, var(--bg-input));
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    0 0 0 1px color-mix(in srgb, var(--brand-primary) 24%, transparent);
}

.properties-stay-type-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--brand-primary) 14%, var(--bg-elevated));
  color: color-mix(in srgb, var(--brand-primary) 85%, var(--text-primary));
  transition: background 0.14s, color 0.14s;
}

.properties-stay-type-card.is-active .properties-stay-type-card-icon {
  background: color-mix(in srgb, var(--brand-primary) 26%, var(--bg-elevated));
  color: var(--brand-primary);
}

.properties-stay-type-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.properties-stay-type-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.properties-stay-type-card-sub {
  font-size: 0.72rem;
  line-height: 1.3;
}

[data-theme="light"] .properties-stay-type-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
}

[data-theme="light"] .properties-stay-type-card:hover {
  border-color: color-mix(in srgb, var(--brand-primary) 35%, rgba(15, 23, 42, 0.14));
}

[data-theme="light"] .properties-stay-type-card.is-active {
  background: color-mix(in srgb, var(--brand-primary) 8%, #ffffff);
  border-color: color-mix(in srgb, var(--brand-primary) 55%, rgba(15, 23, 42, 0.14));
}

[data-theme="light"] .properties-stay-type-card-icon {
  background: color-mix(in srgb, var(--brand-primary) 10%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--brand-primary) 20%, rgba(15, 23, 42, 0.08));
}

[data-theme="light"] .properties-stay-type-card.is-active .properties-stay-type-card-icon {
  background: color-mix(in srgb, var(--brand-primary) 18%, #ffffff);
}

@media (max-width: 720px) {
  .properties-stay-type-row {
    grid-template-columns: 1fr;
  }}

.properties-hero-card {
  overflow: hidden;
  padding: 0;
  width: 100%;
  margin: 0 0 0.35rem;
  max-height: 340px;
}

.properties-hero-media {
  position: relative;
  width: 100%;
  min-height: 340px;
  max-height: 340px;
  border-radius: 10px;
  overflow: hidden;
}

.properties-hero-media img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  max-height: 340px;
  object-fit: cover;
  object-position: center;
}

.properties-hero-fade-top {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4.4rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.38), transparent);
  pointer-events: none;
}

.properties-hero-fade-bottom {
  position: absolute;
  inset: auto 0 0 0;
  height: 11rem;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.5) 40%,
    rgba(0, 0, 0, 0.78) 80%,
    color-mix(in srgb, var(--bg-base) 60%, rgba(0, 0, 0, 0.88)) 100%
  );
  pointer-events: none;
}

/* ── Skeleton shimmer: reusable loading placeholders ─────────────────────── */
/* Drop-in animated placeholder. Stack with `skel--circle` for round logos,
   `skel--on-photo` for the hero overlay (white-on-dark gradient), or pass
   inline width/height styles for ad-hoc shapes. The animation sweep is slow
   (1.6s linear) to read as "loading" without becoming a visual nuisance. */
.skel {
  display: inline-block;
  border-radius: 6px;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--text-muted) 14%, transparent) 0%,
      color-mix(in srgb, var(--text-muted) 28%, transparent) 50%,
      color-mix(in srgb, var(--text-muted) 14%, transparent) 100%
    );
  background-size: 220% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  animation: skel-shimmer 1.6s infinite linear;
  pointer-events: none;
  vertical-align: middle;
}

.skel--circle {
  border-radius: 999px !important;
}

.skel--on-photo {
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.22) 50%,
      rgba(255, 255, 255, 0.08) 100%
    );
  background-size: 220% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes skel-shimmer {
  to { background-position: -120% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skel {
    animation: none;
    background-position: 50% 0;
  }}

/* ── Hero overlay: title, location, stats, and active-channel logos ─────── */

.properties-hero-channels {
  position: absolute;
  top: 1.1rem;
  right: 1.2rem;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.55rem 0.35rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, black 35%, transparent),
    color-mix(in srgb, black 45%, transparent)
  );
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.properties-hero-channels-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.properties-hero-channels-logos {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Strict 26px circle wrapper. Brand SVGs slot in at the same size; the
   wrapper clips anything that would otherwise escape (some brand assets
   carry larger native dimensions or padding). Same pattern as
   PropertyCalendarReservationChip — transparent wrapper, full-size logo,
   soft drop-shadow for legibility against busy photos. */
.properties-hero-channel {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 26px !important;
  height: 26px !important;
  flex: 0 0 26px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  border: 0 !important;
  overflow: hidden !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
  transition: transform 0.16s ease;
}

.properties-hero-channel:hover {
  transform: translateY(-1px) scale(1.08);
  z-index: 1;
}

.properties-hero-channel > .workspace-platform-logo {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  flex: 0 0 26px !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.properties-hero-channel .platform-logo-image,
.properties-hero-channel img,
.properties-hero-channel svg {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  object-fit: contain !important;
  border-radius: 50% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Fallback (Google / Expedia / Agoda — no brand SVG). White-gradient circle
   with the iconPath stroke centred so it carries the same visual weight as
   the brand badges. */
.properties-hero-channel.properties-hero-channel-fallback {
  background: linear-gradient(180deg, #ffffff, #e2e8f0) !important;
  color: #0f172a;
}

.properties-hero-channel-fallback svg {
  width: 60% !important;
  height: 60% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border-radius: 0 !important;
}

.properties-hero-overlay {
  position: absolute;
  inset: auto 1.65rem 1.55rem 1.65rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 1px 6px rgba(0, 0, 0, 0.55),
    0 2px 18px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.properties-hero-overlay-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
  max-width: 42rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.properties-hero-overlay-location {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.005em;
}

.properties-hero-overlay-location svg {
  color: rgba(255, 255, 255, 0.78);
  flex-shrink: 0;
}

.properties-hero-overlay-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.properties-hero-overlay-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  font-size: 0.74rem;
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.08)
  );
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px) saturate(160%);
  -webkit-backdrop-filter: blur(8px) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.94);
  letter-spacing: 0.005em;
}

.properties-hero-overlay-stat strong {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .properties-hero-overlay {
    inset: auto 1.1rem 1.1rem 1.1rem;
  }
  .properties-hero-overlay-title {
    font-size: 1.15rem;
  }
  .properties-hero-channels {
    top: 0.8rem;
    right: 0.8rem;
    gap: 0.4rem;
    padding: 0.3rem 0.4rem 0.3rem 0.65rem;
  }
  .properties-hero-channels-label {
    display: none;
  }}

/* Tiptap WYSIWYG property notes */
.property-intel-skeleton {
  min-height: 10rem;
  border-radius: 8px;
  background: var(--table-surface);
  border: 1px solid var(--border-subtle);
}

.property-intel-editor-surface {
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-elevated) 78%, var(--table-surface));
  min-height: 16rem;
  overflow: auto;
  max-height: min(58vh, 32rem);
  resize: vertical;
  min-width: 100%;
}

.property-intel-editor .ProseMirror {
  min-height: 10rem;
  padding: 0.85rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  outline: none;
}

.property-intel-editor .ProseMirror p {
  margin: 0.35rem 0;
}

.property-intel-editor .ProseMirror h1,
.property-intel-editor .ProseMirror h2,
.property-intel-editor .ProseMirror h3 {
  font-weight: 700;
  line-height: 1.2;
  margin: 0.5rem 0 0.35rem;
  color: var(--text-primary);
}
.property-intel-editor .ProseMirror h1 { font-size: 1.35rem; }
.property-intel-editor .ProseMirror h2 { font-size: 1.1rem; }
.property-intel-editor .ProseMirror h3 { font-size: 0.95rem; }

.property-intel-toc {
  margin: 0.55rem 0.65rem 0.2rem;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 84%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  padding: 0.45rem 0.5rem;
}

.property-intel-toc-title {
  margin: 0 0 0.35rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.property-intel-toc-list {
  display: grid;
  gap: 0.12rem;
}

.property-intel-toc-list button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.26rem 0.35rem;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 0.72rem;
  cursor: pointer;
}

.property-intel-toc-list button:hover,
.property-intel-toc-list button.is-active {
  background: color-mix(in srgb, #4f46e5 10%, transparent);
  color: var(--text-primary);
}

.property-intel-editor .ProseMirror ul,
.property-intel-editor .ProseMirror ol {
  margin: 0.35rem 0;
  padding-left: 1.2rem;
}

.property-intel-editor .ProseMirror ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0.2rem;
}

.property-intel-editor .ProseMirror ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0.2rem 0;
}

.property-intel-editor .ProseMirror ul[data-type="taskList"] li > label {
  display: inline-flex;
  align-items: center;
  margin-top: 0.15rem;
}

.property-intel-editor .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"] {
  width: 0.9rem;
  height: 0.9rem;
}

.property-intel-editor .ProseMirror pre {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
  overflow: auto;
}

.property-intel-editor .ProseMirror blockquote {
  margin: 0.35rem 0;
  padding-left: 0.65rem;
  border-left: 3px solid var(--nav-border-accent);
  color: var(--text-soft);
}

.property-intel-editor .ProseMirror img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 28rem;
  object-fit: contain;
  margin: 0.75rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--table-surface);
  cursor: pointer;
}

.property-intel-editor .ProseMirror img.ProseMirror-selectednode {
  outline: 2px solid var(--nav-border-accent);
  outline-offset: 2px;
}

.property-intel-esc-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.property-intel-slash {
  position: fixed;
  z-index: 200;
  min-width: 220px;
  max-width: min(420px, 92vw);
  max-height: 60vh;
  overflow: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.property-intel-slash.is-above {
  transform: translateY(-100%);
}

.property-intel-slash--theme {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.35rem 0.4rem 0.5rem;
}

.property-intel-slash-empty {
  margin: 0.2rem 0.25rem 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.property-intel-slash-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.2rem 0.3rem 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.3rem;
}

.property-intel-slash-esc {
  opacity: 0.8;
}

.property-intel-slash-cat {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0.35rem 0.2rem 0.2rem;
}

.property-intel-slash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

.property-intel-slash-grid button {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-align: left;
  font-size: 0.72rem;
  padding: 0.4rem 0.4rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.property-intel-slash-grid button:hover,
.property-intel-slash-grid button.active {
  background: color-mix(in srgb, #fff 6%, var(--table-surface));
  border-color: var(--border-subtle);
}

[data-theme="light"] .property-intel-slash--theme {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.18);
}

[data-theme="light"] .property-intel-slash-grid button:hover,
[data-theme="light"] .property-intel-slash-grid button.active {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(79, 70, 229, 0.24);
}

.property-intel-slash-icon {
  display: inline-flex;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 4px;
  background: var(--table-surface);
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Hint row above the rich editor: keep the "/" hint quiet and one line, with
   the Guest-details helper hanging off the right. */
.property-intel-hint-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.property-intel-hint-row .properties-md-hint {
  font-size: 0.7rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}
.property-intel-tools,
.property-intel-image-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.property-intel-tools {
  margin-left: auto;
}
.property-intel-image-remove {
  color: var(--state-error);
}
.property-intel-image-error {
  margin: 0 0 0.45rem;
  color: var(--state-error);
  font-size: 0.72rem;
  line-height: 1.35;
}
.property-intel-fields {
  position: relative;
  flex: none;
}
.property-intel-fields-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.property-intel-fields-btn:hover,
.property-intel-fields-btn[aria-expanded="true"] {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.property-intel-fields-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.property-intel-fields-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 210;
  min-width: 250px;
  max-height: 300px;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.property-intel-fields-head {
  margin: 0.15rem 0.35rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.property-intel-fields-menu button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 0.6rem;
  width: 100%;
  padding: 0.4rem 0.45rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.76rem;
  text-align: left;
  cursor: pointer;
}
.property-intel-fields-menu button:hover {
  background: var(--table-surface);
}
.property-intel-fields-menu code {
  font-size: 0.68rem;
  color: var(--text-soft);
}
.property-intel-fields-hint {
  grid-column: 1 / -1;
  font-size: 0.66rem;
  color: var(--text-muted);
}

.properties-inline-2 {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 0.35rem;
}

.properties-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

/* Sticky save bar (matches message composer affordance) */
.properties-sticky-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4;
  margin: 0 -0.25rem;
  padding: 0.5rem 0.25rem 0.35rem;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg-base) 96%, transparent) 50%, transparent);
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.5rem;
}

.properties-sticky-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.properties-sticky-note {
  max-width: 1200px;
  margin: 0.3rem auto 0;
  font-size: 0.72rem;
}

.properties-dirty-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  color: var(--text-muted);
  background: var(--table-surface);
  border: 1px solid var(--border-subtle);
}

.properties-dirty-pill.is-dirty {
  color: #fde68a;
  border-color: color-mix(in srgb, var(--state-warning) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 14%, var(--table-surface));
}

.properties-sticky-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.properties-sticky-actions .btn {
  font-size: 0.75rem;
  min-height: 32px;
  padding: 0.2rem 0.6rem;
}

.properties-sticky-actions .btn:disabled {
  opacity: 0.6;
}

/* Review */
.properties-review-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 10, 18, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.properties-review-dialog {
  width: min(900px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  padding: 1rem !important;
  overflow: hidden;
}

.properties-save-confirm-dialog {
  width: min(920px, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem !important;
  overflow: hidden;
}

/* ── Save lifecycle: loading / success / error states inside the modal ── */

.properties-save-overlay.properties-save-overlay--saving,
.properties-save-overlay.properties-save-overlay--success,
.properties-save-overlay.properties-save-overlay--error {
  /* Lock the backdrop while the save is in flight or finalising. */
  cursor: default;
}

.properties-save-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  padding: 2.4rem 1.5rem 2rem;
  min-height: 18rem;
}

.properties-save-state h3 {
  margin: 0.4rem 0 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
}

.properties-save-state p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 28rem;
}

.properties-save-state-note {
  font-size: 0.75rem !important;
  margin-top: 0.35rem !important;
}

.properties-save-spinner {
  width: 3.4rem;
  height: 3.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, var(--brand-primary) 78%, white);
  animation: properties-save-spin 0.85s linear infinite;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--brand-primary) 28%, transparent));
}

@keyframes properties-save-spin {
  to { transform: rotate(360deg); }
}

.properties-save-tick,
.properties-save-cross {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: properties-save-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.properties-save-tick {
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 16%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--state-success) 40%, transparent),
    0 0 24px color-mix(in srgb, var(--state-success) 30%, transparent);
}

.properties-save-cross {
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 16%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, #ef4444 40%, transparent),
    0 0 24px color-mix(in srgb, #ef4444 30%, transparent);
}

@keyframes properties-save-pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.properties-save-state--error p:not(.muted) {
  color: #fca5a5;
  font-weight: 550;
}

.properties-save-error-detail {
  width: 100%;
  max-width: 36rem;
  margin-top: 0.4rem;
  text-align: left;
}

.properties-save-error-detail summary {
  font-size: 0.74rem;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0.25rem 0;
}

.properties-save-error-detail summary:hover {
  color: var(--text-primary);
}

.properties-save-error-detail pre {
  margin: 0.4rem 0 0;
  padding: 0.6rem 0.7rem;
  font-size: 0.72rem;
  line-height: 1.4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: color-mix(in srgb, var(--bg-deep) 88%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, #ef4444 22%, var(--border-subtle));
  border-radius: 8px;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 14rem;
  overflow: auto;
}

.properties-save-state-actions {
  display: inline-flex;
  gap: 0.55rem;
  margin-top: 0.55rem;
}

.properties-review-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.properties-review-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.38rem 0.5rem;
  background: color-mix(in srgb, var(--table-surface) 70%, transparent);
}

.properties-save-confirm-scroll {
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.properties-save-confirm-block h4 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.properties-save-confirm-block pre {
  margin: 0;
  max-height: 220px;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.66rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.properties-save-confirm-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.78rem;
}

.properties-save-confirm-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.properties-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.properties-review-table-wrap {
  overflow: auto;
  flex: 1;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.properties-review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.properties-review-table th,
.properties-review-table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.properties-review-old {
  color: var(--state-error);
  word-break: break-word;
  max-width: 280px;
}

.properties-review-new {
  color: var(--state-success);
  word-break: break-word;
  max-width: 280px;
}

/* Pricing publication is deliberately a separate, explicit action from Save.
   This dialog explains which evidence is contributing and which factors are
   safely standing by before a single connected-platform write is attempted. */
.pricing-publish-dialog {
  width: min(680px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
}

.pricing-publish-eyebrow {
  display: block;
  margin-bottom: 0.16rem;
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pricing-publish-summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

.pricing-publish-blocker,
.pricing-publish-readiness,
.pricing-publish-warning {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.72rem 0.8rem;
  background: color-mix(in srgb, var(--table-surface) 78%, transparent);
}

.pricing-publish-blocker {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.pricing-publish-readiness {
  display: grid;
  gap: 0.18rem;
}

.pricing-publish-readiness strong {
  color: var(--text-primary);
  font-size: 0.84rem;
}

.pricing-publish-readiness span {
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.pricing-publish-readiness.is-ready {
  border-color: color-mix(in srgb, var(--state-success) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-success) 9%, var(--table-surface));
}

.pricing-publish-readiness.is-blocked {
  border-color: color-mix(in srgb, var(--state-error) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-error) 8%, var(--table-surface));
}

.pricing-publish-factor-list {
  display: grid;
  gap: 0.42rem;
}

.pricing-publish-factor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.58rem 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--table-surface);
}

.pricing-publish-factor > div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.pricing-publish-factor strong {
  color: var(--text-primary);
  font-size: 0.76rem;
}

.pricing-publish-factor > div > span {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.pricing-publish-factor-status {
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.18rem 0.42rem;
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 800;
  white-space: nowrap;
}

.pricing-publish-factor-status.is-contributing {
  color: var(--state-success);
  border-color: color-mix(in srgb, var(--state-success) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-success) 9%, transparent);
}

.pricing-publish-factor-status.is-abstaining {
  color: var(--state-warning);
  border-color: color-mix(in srgb, var(--state-warning) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 9%, transparent);
}

.pricing-publish-factor-status.is-off {
  color: var(--text-muted);
}

.pricing-publish-warning {
  border-color: color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 7%, var(--table-surface));
}

.pricing-publish-warning strong {
  color: var(--text-primary);
  font-size: 0.76rem;
}

.pricing-publish-warning p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.42;
}

.pricing-publish-reasons {
  margin-top: 0;
}

.pricing-publish-actions {
  justify-content: flex-end;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* Left list: property card (workspace) */
.workspace-list-card--property {
  text-decoration: none;
  color: inherit;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 0.36rem 0.44rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--table-surface);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text-primary) 4%, transparent);
  flex-shrink: 0;
  min-height: 0;
  margin: 0;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.workspace-list-card--property:hover,
.workspace-list-card--property:focus-within {
  border-color: color-mix(in srgb, var(--nav-border-accent) 58%, var(--border-subtle));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--nav-border-accent) 14%, transparent);
}

/* One semantic link owns the card's non-interactive hit area. Property controls
   are siblings above it, never descendants of an anchor: native input/button
   behaviour therefore cannot activate property navigation. */
.workspace-list-property-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  color: inherit;
  text-decoration: none;
}

.workspace-list-card--property > .workspace-select-chip,
.workspace-list-card--property > .workspace-list-avatar-wrap,
.workspace-list-card--property > .workspace-list-body {
  position: relative;
  z-index: 2;
}

.workspace-list-card--property > .workspace-list-avatar-wrap,
.workspace-list-card--property > .workspace-list-body {
  pointer-events: none;
}

.workspace-list-card--property > .workspace-select-chip,
.workspace-list-card--property .workspace-tag-remove {
  pointer-events: auto;
}

.workspace-list-card--property .workspace-list-body {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
  position: relative;
  padding-bottom: 0.04rem;
}

.workspace-list-card--property .workspace-list-avatar-wrap {
  width: 40px;
  min-width: 40px;
}

.workspace-list-card--property .workspace-list-thumb,
.workspace-list-card--property .workspace-list-avatar-fallback {
  width: 40px;
  height: 40px;
}

.workspace-list-card--property .workspace-list-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.workspace-list-card--property .workspace-list-title {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
}

.workspace-list-open-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.workspace-list-open-cue span {
  color: var(--nav-border-accent);
  font-size: 0.9rem;
  line-height: 0.7;
  transition: transform 0.16s ease;
}

.workspace-list-card--property:hover .workspace-list-open-cue span,
.workspace-list-card--property:focus-within .workspace-list-open-cue span {
  transform: translateX(2px);
}

.workspace-list-card--property .workspace-list-subtitle,
.workspace-list-card--property .workspace-list-listing {
  font-size: 0.67rem;
}

.workspace-list-card--property.is-active {
  background: color-mix(in srgb, var(--primary-gradient-soft) 42%, var(--table-surface)) !important;
  border-color: color-mix(in srgb, #7c8cff 58%, var(--nav-border-accent)) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #7c8cff 42%, transparent),
    0 8px 24px rgba(88, 101, 242, 0.18);
}

.workspace-list-card--property.is-multi-selected {
  border-color: color-mix(in srgb, #7c8cff 58%, var(--nav-border-accent)) !important;
  background: var(--bg-deep) !important;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #7c8cff 42%, transparent),
    0 8px 24px rgba(88, 101, 242, 0.18);
  position: relative;
  z-index: 2;
  animation: workspacePropertyStackIn 180ms ease;
  opacity: 1 !important;
}

.workspace-list-card--property.is-stack-mode {
  opacity: 1 !important;
  background: var(--bg-elevated) !important;
  background-image: none !important;
  backdrop-filter: none !important;
  filter: none !important;
  border-color: var(--border-subtle) !important;
  box-shadow: 0 1px 0 color-mix(in srgb, black 10%, transparent) !important;
}

@keyframes workspacePropertyStackIn {
  from {
    transform: translateY(6px) scale(0.985);
    opacity: 1;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.ph-brain .ai-control {
  padding: 10px 14px 34px;
}

.workspace-list-card--property.is-stack-fly-in {
  animation: workspacePropertyFlyToStack 260ms cubic-bezier(0.2, 0.82, 0.25, 1);
}

@keyframes workspacePropertyFlyToStack {
  from {
    transform: translateY(14px) scale(0.985);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.workspace-property-selection-group {
  border: 1px solid color-mix(in srgb, var(--nav-border-accent) 45%, var(--border-subtle));
  border-radius: 11px;
  background: var(--bg-deep);
  padding: 0.38rem;
  margin-bottom: 0.52rem;
  display: grid;
  gap: 0.22rem;
  position: sticky;
  top: 0.42rem;
  z-index: 7;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--bg-app) 65%, transparent);
}

.workspace-property-selection-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.1rem 0.2rem 0.24rem;
}

.workspace-property-selection-group-head strong {
  font-size: 0.7rem;
  letter-spacing: 0.01em;
}

.workspace-property-selection-group-head small {
  font-size: 0.63rem;
  color: var(--text-muted);
}

.workspace-property-group {
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, var(--nav-border-accent));
  border-radius: 12px;
  padding: 0.3rem 0.3rem 0.3rem 0.55rem;
  margin: 0.45rem 0;
  background: color-mix(in srgb, var(--bg-elevated) 84%, transparent);
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

/* Always-on vertical accent line on the left edge of any property group
   container — a compact "this is a group" indicator that runs the full
   height of the group, regardless of whether we're in config or calendar
   mode. Pseudo-element keeps it independent of the group's own border so
   we can swap the line color on hover without disturbing layout. */
.workspace-property-group::before,
.workspace-property-selection-group::before {
  content: "";
  position: absolute;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.18rem;
  width: 3px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--nav-border-accent) 70%, var(--border-subtle));
  pointer-events: none;
  transition: background-color 0.18s ease, width 0.18s ease;
}
.workspace-property-group:hover::before,
.workspace-property-group:focus-within::before,
.workspace-property-selection-group:hover::before,
.workspace-property-selection-group:focus-within::before {
  background: var(--nav-border-accent);
  width: 4px;
}

.workspace-property-group.is-drop-active {
  border-color: color-mix(in srgb, var(--nav-border-accent) 62%, var(--border-subtle));
}
.workspace-property-group.is-drop-active::before {
  background: var(--nav-border-accent);
}

.workspace-property-group-head {
  margin-bottom: 0.25rem;
}

.workspace-property-group-headbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.workspace-property-group-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  cursor: pointer;
  color: var(--text-primary);
  font-weight: 650;
  letter-spacing: 0.01em;
  border-radius: 9px;
  padding: 0.35rem 0.45rem;
}

.workspace-property-group-toggle:hover {
  background: var(--table-row-hover);
}
/* Calendar mode keeps every group expanded by force, so the toggle button
   becomes inert — no pointer cursor, no hover wash, and the chevron is
   muted so it reads as decorative rather than interactive. */
.workspace-property-group-toggle:disabled,
.workspace-property-group-toggle[aria-disabled="true"] {
  cursor: default;
  background: transparent !important;
}
.workspace-property-group-toggle:disabled .ui-icon,
.workspace-property-group-toggle[aria-disabled="true"] .ui-icon {
  opacity: 0.35;
}

.workspace-property-group-toggle-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.workspace-property-group-toggle-title .ui-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.workspace-property-group-toggle small {
  font-size: 0.69rem;
  color: var(--text-muted);
}

.workspace-property-group-actions {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.workspace-property-group-actions-trigger {
  border: 0;
  background: color-mix(in srgb, var(--bg-elevated) 86%, transparent);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #fca5a5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, #ef4444 38%, var(--border-subtle));
}

.workspace-property-group-actions-trigger:hover {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  color: #fee2e2;
  border-color: color-mix(in srgb, #ef4444 54%, var(--border-subtle));
}

.workspace-property-group-delete-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.workspace-property-group-stack {
  cursor: pointer;
}

.workspace-property-group-stack .workspace-list-card--property {
  pointer-events: none;
  user-select: none;
}

.workspace-property-group-body {
  display: grid;
  gap: 0.2rem;
  padding: 0.08rem 0.05rem 0.15rem;
}

.workspace-property-group-empty {
  margin: 0;
  padding: 0.6rem 0.5rem;
  border: 1px dashed color-mix(in srgb, var(--border-subtle) 85%, var(--nav-border-accent));
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.workspace-list-pane.selection-mode .workspace-list-card--property .workspace-list-property-actions {
  display: none;
}

.workspace-list-property-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.18rem;
  position: absolute;
  right: 0.1rem;
  bottom: 0.02rem;
  opacity: 0;
  transform: translateY(1px);
  pointer-events: none;
  flex-shrink: 0;
  z-index: 8;
}

.workspace-list-card--property.has-open-tag-picker {
  z-index: 140;
}

.workspace-list-property-actions .workspace-list-tags {
  margin-right: 0.15rem;
}

.workspace-list-property-actions .properties-tag-picker {
  right: 0;
  left: auto;
  top: calc(100% + 0.24rem);
  bottom: auto;
  z-index: 220;
  background: var(--bg-elevated);
  opacity: 1 !important;
  backdrop-filter: none !important;
}

.workspace-list-card--property:hover .workspace-list-property-actions,
.workspace-list-card--property:focus-within .workspace-list-property-actions,
.workspace-list-card--property.is-active .workspace-list-property-actions,
.workspace-list-card--property.has-open-tag-picker .workspace-list-property-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.workspace-list-card--property.is-starred .workspace-list-property-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.workspace-list-card--property.is-starred .workspace-list-property-actions .workspace-inline-icon:not(.workspace-inline-icon-star) {
  display: none;
}

.workspace-list-card--property.is-starred:hover .workspace-list-property-actions .workspace-inline-icon,
.workspace-list-card--property.is-starred:focus-within .workspace-list-property-actions .workspace-inline-icon,
.workspace-list-card--property.is-starred.has-open-tag-picker .workspace-list-property-actions .workspace-inline-icon {
  display: inline-flex;
}

.workspace-list-card--property.is-multi-selected .workspace-list-property-actions {
  display: inline-flex !important;
}

.workspace-inline-icon-archive-prominent {
  color: color-mix(in srgb, var(--state-error) 78%, var(--text-main));
  border-color: color-mix(in srgb, var(--state-error) 44%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-error) 14%, var(--bg-input));
}

.workspace-inline-icon-star.active {
  color: #facc15;
  border-color: color-mix(in srgb, #eab308 72%, var(--border-subtle));
  background: color-mix(in srgb, #eab308 22%, var(--bg-input));
}

.workspace-list-property-pill {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 3.8rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.workspace-list-property-pill:hover {
  transform: translateY(-1px);
}

.workspace-list-property-pill-knob {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
  transition: transform 0.16s ease;
}

.workspace-list-property-pill.is-listed {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #f0fdf4;
  border: 1px solid color-mix(in srgb, #22c55e 45%, transparent);
}

.workspace-list-property-pill.is-unlisted {
  background: #374151;
  color: #e5e7eb;
  border: 1px solid color-mix(in srgb, #475569 65%, transparent);
}

[data-theme="light"] .workspace-list-property-pill.is-listed {
  color: #0f9d58;
  background: rgba(15, 157, 88, 0.12);
}

[data-theme="light"] .workspace-list-property-pill.is-unlisted {
  color: #334155;
  background: rgba(51, 65, 85, 0.12);
}

/* Toolbar: add + quick filters */
.workspace-properties-add-btn {
  height: 30px;
  width: 38px;
  min-width: 38px;
  min-height: 30px;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.workspace-properties-add-btn .ui-icon {
  flex-shrink: 0;
  display: block;
  opacity: 1;
  visibility: visible;
}

.workspace-properties-add-btn .ui-icon:first-child {
  width: 14px;
  height: 14px;
}

.workspace-properties-add-btn .ui-icon:last-child {
  width: 11px;
  height: 11px;
  opacity: 0.9;
}

.workspace-properties-mixed-filter-btn {
  font-size: 0.7rem;
  height: 30px;
  min-width: 30px;
  padding: 0 0.45rem;
  font-weight: 600;
  white-space: nowrap;
}

.workspace-properties-mixed-filter-btn.is-emphasis {
  box-shadow: 0 0 0 1px var(--nav-border-accent);
  color: var(--text-primary);
}

.workspace-property-filter-dropdown {
  position: relative;
  flex-shrink: 0;
}

.workspace-list-toolbar-properties {
  flex-direction: column;
  align-items: stretch;
  gap: 0.24rem;
}

.workspace-properties-density-toggle {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0 0.6rem;
  cursor: pointer;
}
.workspace-properties-density-toggle:hover {
  border-color: var(--border-strong, var(--border-subtle));
  color: var(--text-primary);
}
.workspace-properties-density-toggle.is-active {
  border-color: color-mix(in srgb, var(--ring) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--ring) 12%, var(--bg-input));
  color: var(--text-primary);
}
/* Preferences not loaded yet — show a quiet, non-committal state instead of a
   confident (and possibly wrong) ON/OFF until the server value lands. */
.workspace-properties-density-toggle.is-pending {
  opacity: 0.5;
  cursor: progress;
}
.workspace-properties-density-toggle-knob {
  width: 26px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--text-muted) 28%, transparent);
  position: relative;
  flex: 0 0 auto;
}
.workspace-properties-density-toggle-knob::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--text-soft);
  transition: transform 120ms ease;
}
.workspace-properties-density-toggle.is-active .workspace-properties-density-toggle-knob {
  border-color: color-mix(in srgb, var(--ring) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--ring) 30%, transparent);
}
.workspace-properties-density-toggle.is-active .workspace-properties-density-toggle-knob::after {
  transform: translateX(10px);
  background: color-mix(in srgb, var(--ring) 85%, white 15%);
}

.workspace-properties-mode-picker {
  position: relative;
  width: 100%;
}

.workspace-properties-mode-trigger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0 0.6rem;
  cursor: pointer;
}

.workspace-properties-mode-trigger:hover,
.workspace-properties-mode-trigger.is-open {
  border-color: color-mix(in srgb, var(--ring) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--ring) 10%, var(--bg-input));
}

.workspace-properties-mode-trigger svg {
  opacity: 0.9;
}

.workspace-properties-mode-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  display: grid;
  min-width: min(310px, calc(100vw - 32px));
  gap: 0.15rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 14px 28px color-mix(in srgb, black 35%, transparent);
  padding: 0.25rem;
  z-index: 25;
}

.workspace-properties-mode-item {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 600;
  text-align: left;
  padding: 0.36rem 0.5rem;
  cursor: pointer;
}

.workspace-properties-mode-item:hover,
.workspace-properties-mode-item.is-active {
  background: color-mix(in srgb, var(--ring) 18%, transparent);
  color: var(--text-primary);
}

.workspace-properties-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  width: 100%;
  box-sizing: border-box;
  gap: 0.4rem 0.65rem;
  min-height: 32px;
  padding: 0.26rem 0.45rem 0.24rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 78%, transparent);
  background: color-mix(in srgb, var(--bg-elevated) 74%, var(--bg-input));
  font-size: 0.75rem;
  color: var(--text-muted);
}

.workspace-properties-counts {
  color: var(--text-soft);
  margin-inline: auto;
  text-align: center;
}

.workspace-properties-counts-sep {
  display: inline-block;
  margin: 0 0.2rem;
  color: var(--text-muted);
}

.workspace-properties-filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #93c5fd;
  background: color-mix(in srgb, #3b82f6 18%, transparent);
  border: 1px solid color-mix(in srgb, #3b82f6 50%, transparent);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}
button.workspace-properties-filter-badge {
  cursor: pointer;
}
button.workspace-properties-filter-badge:hover {
  filter: brightness(1.16);
}
.workspace-properties-filter-badge.is-checkout {
  color: #fbbf24;
  background: color-mix(in srgb, #d97706 16%, transparent);
  border-color: color-mix(in srgb, #d97706 48%, transparent);
}

button.workspace-properties-filter-reset {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  min-height: auto;
  color: var(--text-soft);
}

.workspace-properties-toolbar-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.4rem;
  width: 100%;
  position: relative;
  z-index: auto;
  min-width: 0;
  overflow: visible;
}

.workspace-properties-toolbar-row input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 0.5rem;
  font-size: 0.78rem;
}

.workspace-properties-add-menu {
  position: relative;
}

.workspace-properties-add-menu-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 180px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: 0 14px 28px color-mix(in srgb, black 35%, transparent);
  padding: 0.25rem;
  display: grid;
  gap: 0.12rem;
  z-index: 120;
}

.workspace-properties-add-menu-popover button {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.75rem;
  border-radius: 7px;
  padding: 0.45rem 0.52rem;
  cursor: pointer;
}

.workspace-properties-add-menu-popover button:hover {
  background: var(--table-row-hover);
}

.workspace-properties-add-group-form {
  display: grid;
  gap: 0.4rem;
}

.workspace-properties-add-group-form label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.workspace-properties-add-group-form input {
  height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-app);
  color: var(--text-primary);
  padding: 0 0.45rem;
  font-size: 0.75rem;
}

.workspace-properties-add-group-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.workspace-properties-add-group-error {
  margin: 0;
  font-size: 0.68rem;
  color: #fca5a5;
}

.workspace-properties-select-all {
  margin-right: 0.25rem;
}

.workspace-properties-bulk-row {
  margin-top: 0.25rem;
  position: relative;
}

.workspace-properties-bulk-menu {
  position: relative;
}

.workspace-properties-bulk-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 210px;
  max-width: 250px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 0.45rem;
  display: grid;
  gap: 0.35rem;
  z-index: 130;
  box-shadow: 0 14px 28px color-mix(in srgb, black 38%, transparent);
}

.workspace-properties-bulk-popover input {
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-app);
  color: var(--text-primary);
  padding: 0 0.45rem;
  font-size: 0.74rem;
}

.workspace-properties-bulk-popover-list {
  display: grid;
  gap: 0.18rem;
  max-height: 170px;
  overflow: auto;
}

.workspace-properties-bulk-popover-list button {
  text-align: left;
  border: 0;
  border-radius: 7px;
  font-size: 0.74rem;
  color: var(--text-primary);
  background: transparent;
  padding: 0.36rem 0.4rem;
  cursor: pointer;
}

.workspace-properties-bulk-popover-list button:hover {
  background: var(--table-row-hover);
}

.workspace-properties-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  width: 100%;
  padding: 0 0.1rem 0.28rem 0.1rem;
}

.workspace-quick-filter-chip {
  border: 1px solid var(--border-subtle);
  background: var(--table-surface);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  cursor: pointer;
}

.workspace-quick-filter-chip.active {
  color: #e0e7ff;
  border-color: var(--nav-border-accent);
  background: color-mix(in srgb, #5b6cff 22%, var(--table-surface));
}

.workspace-properties-filter-panel {
  min-width: 220px;
  right: 0;
  left: 0;
}

.workspace-filter-panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0.2rem 0 0.4rem;
  color: var(--text-primary);
}

.workspace-filter-field {
  display: grid;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
}

.workspace-filter-field input {
  min-height: 30px;
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
}

.workspace-filter-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.workspace-right-pane-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 0.35rem 0.3rem 0.75rem;
}

.properties-right-nav {
  padding: 0 0.1rem;
}

.properties-right-nav-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin: 0 0 0.4rem 0.2rem;
}

.properties-setup-progress {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0.1rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 11px;
  padding: 0.65rem;
  background: color-mix(in srgb, var(--accent) 7%, var(--table-surface));
}

.properties-setup-progress > span:last-child {
  display: grid;
  gap: 0.1rem;
}

.properties-setup-progress > span:last-child strong {
  color: var(--text-primary);
  font-size: 0.7rem;
}

.properties-setup-progress > span:last-child small {
  color: var(--text-muted);
  font-size: 0.61rem;
  line-height: 1.3;
}

.properties-setup-progress-ring {
  --property-progress: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--property-progress), var(--border-subtle) 0);
}

.properties-setup-progress-ring::before {
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: var(--table-surface);
  content: "";
}

.properties-setup-progress-ring strong {
  position: relative;
  z-index: 1;
  color: var(--text-primary);
  font-size: 0.58rem;
}

.properties-right-nav-tree {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.properties-right-nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--table-surface);
  cursor: pointer;
}

.properties-setup-step-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.properties-setup-step-copy svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.properties-setup-step-state {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--text-muted);
  font-size: 0.59rem;
  font-weight: 650;
}

.properties-setup-step-state svg {
  color: var(--state-success);
}

@media (prefers-reduced-motion: reduce) {
  .properties-setup-progress-ring { transition: none; }
}

.properties-right-nav-section:hover,
.properties-right-nav-sub-btn:hover {
  border-color: var(--nav-border-accent);
}

.properties-right-nav-section.active,
.properties-right-nav-sub-btn.active,
.properties-right-nav-section.is-active,
.properties-right-nav-sub-btn.is-active {
  border-color: var(--nav-border-accent);
  background: color-mix(in srgb, #7c3aed 18%, var(--table-surface));
}

.properties-right-nav-sub {
  list-style: none;
  margin: 0.25rem 0 0 0.3rem;
  padding: 0 0 0 0.5rem;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.properties-right-nav-sub-btn {
  width: 100%;
  text-align: left;
  font-size: 0.7rem;
  color: var(--text-soft);
  padding: 0.28rem 0.35rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.properties-right-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.properties-publish-steps {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.properties-publish-steps > div {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--table-surface);
  color: var(--text-soft);
}

.properties-publish-steps > div > svg {
  flex: 0 0 auto;
  margin-top: 0.05rem;
}

.properties-publish-steps > div[data-ready="1"] > svg {
  color: var(--state-success);
}

.properties-publish-steps > div[data-ready="0"] > svg {
  color: var(--state-warning);
}

.properties-publish-steps > div[data-ready="advisory"] > svg {
  color: var(--accent);
}

.properties-publish-steps > div[data-ready="next"] > svg {
  color: var(--accent);
}

.properties-publish-steps > div > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.08rem;
}

.properties-publish-steps strong {
  color: var(--text-primary);
  font-size: 0.72rem;
}

.properties-publish-steps small {
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.properties-publish-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 800;
}

.properties-publish-next {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 12%, var(--table-surface));
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
}

.properties-publish-next:hover {
  border-color: var(--accent);
}

/* --content-offset stays :root-only on purpose. AppNav writes it onto <html>
   at runtime (components/layout/AppNav.tsx), so repeating it in the shared
   selector below would pin a stale 74px on every descendant of a dark-marked
   element the moment the phone shell sets it to 0px. */
:root {
  --content-offset: 74px;
}

/* 🔴 THE DARK PALETTE IS DECLARED FOR BOTH :root AND [data-theme="dark"], AND
   MUST STAY THAT WAY.

   `:root` only ever matches <html>. Custom properties inherit. So before
   2026-08-05 an element that opted INTO dark inside a light page matched no
   rule that re-declared these tokens and silently inherited the LIGHT values
   from <html>: it rendered white. The Customization page's colour swatches and
   its preview card both do exactly that, so picking "Dark" there did visibly
   nothing for anyone viewing the app in light mode, while being perfect for
   anyone in dark mode. That asymmetry is why it survived so long — see
   app/settings/customization/CustomizationClient.tsx.

   Do NOT "fix" a future case by copying this palette into its own
   [data-theme="dark"] block. One palette, two selectors; a second copy drifts.
   components/branding/BrandingProvider.tsx already writes the workspace colour
   overrides against this exact selector pair. */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  /* —— Premium dark palette (charcoal/zinc, restrained accent) ——
     Designed to feel like Linear / Notion / John Lewis dark, not
     synthwave purple. The base is a true near-black warm charcoal,
     surfaces step up in small increments, and accents are reserved
     for the brand wordmark + interactive states only. */
  --bg-base: #0a0a0b;
  --bg-deep: #111114;
  --bg-elevated: #17171a;
  --bg-input: #1d1d20;
  /* Alias: several inbox/CRM detail-rail rules reference `--bg-surface` for
     quiet field + card surfaces (contact-type inputs, contact-draft fields,
     participant rows/picker, CRM attachment + stay cards). It was never
     defined, so bare `var(--bg-surface)` (no fallback) resolved to the
     property's initial value — transparent — leaving those surfaces with no
     background in BOTH themes. --bg-input is the canonical field-surface token
     AND exactly what the author intended: a sibling in the same picker,
     .inbox-thread-participant-search, already uses `var(--bg-input)`. Like the
     --state-danger alias below, this resolves at use-time, so it picks up
     --bg-input's light override and stays at light/dark parity (CLAUDE.md #5)
     from this one line — no light-block counterpart needed. New code should use
     --bg-input directly. */
  --bg-surface: var(--bg-input);
  --text-primary: #ededee;
  --text-muted: #8a8a93;
  --text-soft: #b4b4bc;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --ring: rgba(99, 102, 241, 0.45);
  --glow-purple: rgba(99, 102, 241, 0.16);
  --glow-blue: rgba(91, 108, 255, 0.12);
  --state-success: #4ade80;
  --state-warning: #f59e0b;
  --state-error: #f87171;
  /* Alias: several rules reference `--state-danger` (the canonical token is
     `--state-error`). It was never defined, so bare `var(--state-danger)` uses
     (no fallback) rendered colourless. Aliasing to --state-error resolves them
     in BOTH themes (the alias resolves at use-time, picking up the light override
     on --state-error). New code should use --state-error directly. */
  --state-danger: var(--state-error);
  /* --accent / --surface-muted: these two token names were already
     referenced *bare* (no fallback) in ~200+ existing `sp-*` rules and a
     handful of other places, but were never actually defined in :root —
     so every `var(--accent)` / `var(--surface-muted)` was silently
     resolving to an invalid/empty value (transparent buttons, missing
     pill backgrounds). Defining them here makes those existing usages
     render correctly AND gives the sp2-* redesign a real, theme-aware
     accent. --accent tracks the established indigo brand hue (same family
     as --ring and --primary-gradient); --surface-muted is a quiet
     surface tint one step off the input background. Both have a light
     counterpart below so light + dark stay at parity (CLAUDE.md #5). */
  --accent: #6366f1;
  --surface-muted: #202024;
  /* Stable glass-look capsule material for the desktop inbox glasshead.
     This MUST stay opaque: Chromium/Arc can flash the whole compositor when a
     sticky backdrop-filter has hover-changing rows beneath it. The gradient rim
     and layered shadow provide the glass cue without live backdrop sampling.
     Light counterparts below — CLAUDE.md #5. */
  --glass-capsule-bg: rgb(28, 28, 33);
  --glass-capsule-border: rgba(255, 255, 255, 0.09);
  --glass-capsule-shadow: 0 10px 26px rgba(0, 0, 0, 0.38), 0 2px 7px rgba(0, 0, 0, 0.28);
  --glass-capsule-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.22);
  --glass-capsule-rim: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -0.5px 0 rgba(255, 255, 255, 0.03);
  --glass-menu-bg: rgb(26, 26, 31);
  /* De-purpled 2026-06-05 (DS bundle forbids bluish-purple gradients): dark variant was
     #5b6cff→#7c3aed (blue→violet) while the light variant was already clean indigo — now both are
     indigo (--accent family). Feeds 25 consumers, so this de-purples the brand surface app-wide. */
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --primary-gradient-soft: linear-gradient(135deg, rgba(79, 70, 229, 0.16), rgba(99, 102, 241, 0.12));
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.45);
  /* Surfaces that must track theme (tables, nav rail) */
  --nav-surface: linear-gradient(165deg, rgba(20, 20, 23, 0.96), rgba(10, 10, 11, 0.94));
  --nav-border-accent: rgba(99, 102, 241, 0.32);
  --nav-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 16px 36px rgba(0, 0, 0, 0.55);
  --table-surface: rgba(15, 15, 18, 0.6);
  --table-header-bg: rgba(28, 28, 32, 0.96);
  --table-header-text: #d4d4d8;
  --table-cell-text: var(--text-primary);
  --table-border: rgba(255, 255, 255, 0.06);
  --table-row-hover: rgba(99, 102, 241, 0.08);
  --table-striped: rgba(255, 255, 255, 0.02);
  --json-bg: rgba(10, 10, 11, 0.88);
  --brand-text: #ededee;

  /* HTML source colouring for the code editor (components/editor/). Defined in
     BOTH themes — the light counterparts sit beside --brand-text in the
     [data-theme="light"] block. See CLAUDE.md #5. */
  --code-tag: #7aa2f7;
  --code-attr: #bb9af7;
  --code-value: #9ece6a;
  --code-comment: #6b6b73;

  /* ────────────────────────────────────────────────────────────────────
     sp3 — "Quiet precision instrument" premium foundation (Wave 1).
     ADDITIVE token layer for the Smart Pricing tab redesign. Lives in the
     existing :root / [data-theme="light"] blocks so it inherits light/dark
     parity by construction (CLAUDE.md #5). Motion + focus tokens are
     theme-AGNOSTIC and only need to live here (the dark block); the LIGHT
     block below redefines ONLY what must differ per theme (the shadow
     colour). Consumed by the sp3 utilities + the refined sp2 / sp control
     classes further down this file. If you add an sp3 token, give it a
     light counterpart below whenever its value is theme-dependent.
     ──────────────────────────────────────────────────────────────────── */
  /* Motion: one shared "decelerate" curve for entrances + control state
     changes, one symmetric ease for reversible toggles, three durations
     (micro / standard / entrance). Kept as tokens so reduced-motion can
     neutralise transitions in one place and the feel stays consistent. */
  --sp3-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sp3-ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --sp3-dur-1: 140ms;
  --sp3-dur-2: 220ms;
  --sp3-dur-3: 360ms;
  /* Focus ring: a soft 3px accent halo. Uses color-mix on --accent so it
     tracks the theme accent automatically (indigo in both modes). */
  --sp3-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
  /* Radii: the app's existing --radius-* tokens top out at 10px, but the
     sp2 cards already use a 16px corner literally. Define dedicated sp3
     radii so cards (16) and controls (11) share one source of truth. */
  --sp3-radius: 16px;
  --sp3-radius-sm: 11px;
  /* Control thumb — a near-white disc in BOTH themes (like a physical switch
     thumb / iOS toggle). Deliberately NOT theme-inverted: a dark thumb in dark
     mode reads as low-contrast/broken. Sanctioned raw value (same category as
     --sp3-shadow-color). It sits on the neutral grey OFF track or the accent ON
     track — both give clear contrast in light AND dark. */
  --sp3-knob: #ffffff;
  /* Elevation — DARK-MODE TRAP avoided: the shadow colour is an explicit
     near-black token (rgb triplet, matching the format the app already
     uses for --shadow-soft's rgba base), NOT derived from --text-primary
     (which is near-WHITE in dark mode → would turn shadows into glows).
     This dark base is reused in BOTH themes; the light block keeps it dark
     too. Triplet form lets us compose alpha via rgb(... / a). */
  --sp3-shadow-color: 0 0 0;
  --sp3-shadow-sm: 0 1px 2px rgb(var(--sp3-shadow-color) / 0.32);
  --sp3-shadow-md: 0 1px 2px rgb(var(--sp3-shadow-color) / 0.3),
    0 10px 28px -14px rgb(var(--sp3-shadow-color) / 0.5);
  --sp3-shadow-lg: 0 2px 4px rgb(var(--sp3-shadow-color) / 0.32),
    0 20px 48px -20px rgb(var(--sp3-shadow-color) / 0.6);

  /* Mailbox avatar initials — theme-aware so the computed-from-name initials
     clear WCAG AA on BOTH the dark and light list panes. WHY tokens (not raw
     HSL in JS): a single fixed foreground lightness (62%) reads fine on the
     dark pane but collapses to ~1.5:1 on the white light pane. We carry only
     the per-theme saturation/lightness/bg-alpha here; lib/mailbox/format.ts
     :avatarColor injects the per-contact HUE via inline style and references
     these vars for the rest, so one hue + two theme triplets = AA in both. */
  --mbx-av-fg-s: 48%;
  --mbx-av-fg-l: 62%;
  --mbx-av-bg-a: 0.16;

  /* Text on the accent fill (buttons, outbound chat bubble, unread chip). Defined
     so the app-wide var(--accent-contrast) references resolve to a real token
     (sanctioned literal, same category as --sp3-knob). White clears AA on the
     accent in both themes. */
  --accent-contrast: #ffffff;
  /* Outbound chat bubble — a DEEPER indigo than --accent. WHY: 12–13.5px white
     text on the raw dark-mode accent (#6366f1) is only ~4.5:1, a borderline AA
     fail; deepening to indigo-700 gives a comfortable margin (~7:1). Light mode
     keeps the accent (white on #4f46e5 is already ~6.3:1). */
  --mbx-bubble-out-bg: #4338ca;

  /* ────────────────────────────────────────────────────────────────────
     Portal brand hues — for the long-let comparable-listing chips on the
     Pricing tab's Long-Let Position card (sp-llp-comp). These are LITERAL
     third-party brand colours, so they live as named tokens rather than
     hardcoded hex scattered across rule lines (CLAUDE.md #9).
     Dark-theme values are the brands' vivid hues (legible on the dark
     charcoal surface). The light block below swaps in deeper variants that
     keep contrast on white. `*-text` is the legible text/icon colour to
     pair with a tinted (color-mix) chip background.
     (The side-pane's `pnav-ltr-source-badge` chips — a duplicate of the
     same comp set — were removed 2026-06-02 along with its whole long-let
     section; these tokens stay because the main-tab card still uses them.) */
  --brand-rightmove: #00b0a0;        /* Rightmove teal */
  --brand-rightmove-text: #00b0a0;
  --brand-zoopla: #8000ff;           /* Zoopla purple */
  --brand-zoopla-text: #a855f7;      /* lifted purple — legible on dark */
  /* @document mention chip: violet-400 passes WCAG AA on the dark charcoal
     surface (#17171a); light mode uses the deeper violet-900 (#5b21b6) which
     clears AAA on white. */
  --mention-document-color: #a78bfa;
}

[data-theme="light"] {
  color-scheme: light;
  /* Premium light: paper white surfaces, charcoal ink, restrained indigo accent */
  --bg-base: #f5f5f4;
  --bg-deep: #fafaf9;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --text-primary: #18181b;
  --text-muted: #6b6b73;
  --text-soft: #3f3f46;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);
  --ring: rgba(79, 70, 229, 0.32);
  --state-success: #16a34a;
  --state-warning: #b45309;
  --state-error: #b91c1c;
  /* Light counterparts to the dark --accent / --surface-muted defined
     above. Indigo accent matches the light --primary-gradient start;
     surface-muted reuses the same near-white tint already used for
     --table-header-bg / --json-bg in light so it sits consistently. */
  --accent: #4f46e5;
  --surface-muted: #f4f4f5;
  /* Light stable-glass counterpart — see the dark block for the paint invariant. */
  --glass-capsule-bg: rgb(255, 255, 255);
  --glass-capsule-border: rgba(0, 0, 0, 0.07);
  --glass-capsule-shadow: 0 10px 26px rgba(15, 23, 42, 0.12), 0 2px 7px rgba(15, 23, 42, 0.06);
  --glass-capsule-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.09), 0 1px 3px rgba(15, 23, 42, 0.05);
  --glass-capsule-rim: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -0.5px 0 rgba(255, 255, 255, 0.35);
  --glass-menu-bg: rgb(255, 255, 255);
  --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  --primary-gradient-soft: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(99, 102, 241, 0.06));
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.08);
  --nav-surface: linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 249, 0.96));
  --nav-border-accent: rgba(79, 70, 229, 0.22);
  --nav-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04) inset, 0 8px 22px rgba(15, 23, 42, 0.06);
  --table-surface: #ffffff;
  --table-header-bg: #f4f4f5;
  --table-header-text: #18181b;
  --table-cell-text: var(--text-primary);
  --table-border: rgba(0, 0, 0, 0.06);
  --table-row-hover: rgba(79, 70, 229, 0.06);
  --table-striped: rgba(0, 0, 0, 0.02);
  --json-bg: #f4f4f5;
  --brand-text: #ffffff;

  /* Code-editor syntax colours, light counterparts. Darkened for contrast on a
     white field — the dark values would be unreadable here. */
  --code-tag: #1d4ed8;
  --code-attr: #7c3aed;
  --code-value: #15803d;
  --code-comment: #6b6b73;

  /* sp3 light-mode overrides. Only the SHADOW set differs per theme:
     a white card on a paper base needs a SOFTER, slate-tinted shadow
     (pure black at the dark-mode alphas would read as a harsh ink-drop —
     the exact "washed-out vs heavy" trap the existing --shadow-soft token
     was tuned around). Colour → slate-900 triplet (matches the existing
     --shadow-soft light rgba(15,23,42,…) base); alphas dialled down to a
     premium whisper. Motion / radii / ring tokens are theme-agnostic and
     inherit from :root unchanged. */
  --sp3-shadow-color: 15 23 42;
  --sp3-shadow-sm: 0 1px 2px rgb(var(--sp3-shadow-color) / 0.06);
  --sp3-shadow-md: 0 1px 2px rgb(var(--sp3-shadow-color) / 0.05),
    0 10px 28px -14px rgb(var(--sp3-shadow-color) / 0.16);
  --sp3-shadow-lg: 0 2px 4px rgb(var(--sp3-shadow-color) / 0.06),
    0 20px 48px -20px rgb(var(--sp3-shadow-color) / 0.22);

  /* Mailbox avatar initials — light-mode override: drop the foreground hard
     (62% → 28%) and lift bg alpha so initials clear 4.5:1 on the white pane
     across ALL hues. 28% (not 34%) because the worst hue (~yellow h55) only
     reaches ~3.8:1 at 34%; 28% gives ~5.3:1. See :root for the rationale. */
  --mbx-av-fg-s: 55%;
  --mbx-av-fg-l: 28%;
  --mbx-av-bg-a: 0.20;
  --accent-contrast: #ffffff;
  --mbx-bubble-out-bg: #4f46e5;

  /* Brand-hue light-mode counterparts. The dark vivid teal/purple wash out
     on white, so deepen them for AA contrast (text + chip-edge use). The
     viz hues inherit from :root unchanged — they're color-mix on tokens
     that already flip per theme (--accent / --state-* / --brand-zoopla),
     so they re-resolve correctly in light without an explicit override. */
  --brand-rightmove: #00897b;        /* deeper teal — legible on white */
  --brand-rightmove-text: #00796b;
  --brand-zoopla: #7c3aed;           /* deeper purple */
  --brand-zoopla-text: #7c3aed;
  /* @document mention chip: violet-900 (#5b21b6) clears AAA on white;
     dark mode uses violet-400 (#a78bfa) defined in :root above. */
  --mention-document-color: #5b21b6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-manrope), Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  background: var(--bg-base);
  color: var(--text-primary);
  letter-spacing: 0;
}

[data-theme="light"] body {
  background: var(--bg-base);
}

/* Headings follow the TUA brand type rules (Manrope) — Bold (H1) / SemiBold (H2–H5)
   and tight −3% tracking on H1 (the app previously used heavier 800/700 weights and
   OFF-brand +0.01em tracking). Sizes + the brand's airier 1.6–1.8 line-heights stay
   app-dense here; the FULL brand scale (large sizes, generous leading) is exposed via
   the .type-* utilities below so the ~240 in-app headings don't balloon. */
h1,
h2,
h3,
h4,
h5 {
  margin-top: 0;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.65rem, 2.4vw, 2.3rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
}

h3 {
  font-size: 1rem;
}

/* ── TUA brand type scale (Manrope) — opt-in utilities for content / marketing
   surfaces, straight from the brand guidelines (px → rem at 16px). The dense
   workspace UI keeps its own functional sizes; reach for these where you want the
   exact brand typography (e.g. page heroes, docs, the data product). ── */
.type-h1 { font-size: 3rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.03em; }
.type-h2 { font-size: 2.5rem; font-weight: 600; line-height: 1.3; }
.type-h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.6; }
.type-h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.6; }
.type-h5 { font-size: 0.875rem; font-weight: 600; line-height: 1.8; }
.type-base-lg { font-size: 1.125rem; font-weight: 400; line-height: 1.8; }
.type-base-lg-sb { font-size: 1.125rem; font-weight: 600; line-height: 1.8; }
.type-body { font-size: 1rem; font-weight: 400; line-height: 1.8; }
.type-body-sb { font-size: 1rem; font-weight: 600; line-height: 1.8; }
.type-sm { font-size: 0.875rem; font-weight: 400; line-height: 1.8; }
.type-accent { font-size: 0.875rem; font-weight: 600; line-height: 1.8; }
.type-button { font-size: 0.75rem; font-weight: 600; line-height: 1.8; }
.type-table-header { font-size: 0.75rem; font-weight: 400; line-height: 1.8; }

p,
li {
  font-size: 0.92rem;
}

a {
  color: color-mix(in srgb, var(--text-primary) 70%, #5b6cff 30%);
  text-decoration: none;
}

a:hover {
  color: var(--text-primary);
  opacity: 0.92;
}

.app-shell {
  min-height: 100vh;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Core Lite wordmark — frame from Figma export + HTML type */
/* Legacy image brand lockup (.brand-wordmark*, .brand-monogram) removed 2026-07-11:
   the nav + auth wordmark is now <Wordmark /> → .uos-lockup (see below). */

[data-theme="light"] .workspace-channel-notifications-menu,
[data-theme="light"] .properties-save-confirm-dialog,
[data-theme="light"] .properties-review-dialog,
[data-theme="light"] .properties-review-surface {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.18);
}

.app-content {
  padding-left: var(--content-offset);
  min-height: 100vh;
}

.side-nav {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 30;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--nav-surface), var(--bg-deep);
  box-shadow: var(--shadow-soft);
  transition: width 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
  backdrop-filter: blur(8px);
  color: var(--text-primary);
}

.side-nav.collapsed {
  width: 60px;
}

.side-nav.expanded {
  width: 220px;
  border-color: var(--nav-border-accent);
  box-shadow: var(--nav-shadow);
}

.side-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  padding: 0.55rem;
}

.side-nav.collapsed .side-nav-inner {
  align-items: center;
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.side-brand {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  padding: 0.28rem 0.5rem;
  white-space: nowrap;
  overflow: hidden;
}

.side-brand.side-brand-logo {
  overflow: visible;
  padding-top: 0.3rem;
  padding-bottom: 0.22rem;
}

.side-nav.collapsed .side-brand.side-brand-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.3rem 0 0.22rem;
}

.side-nav-top {
  display: flex;
  justify-content: center;
  margin-bottom: 0.1rem;
}

.nav-controls-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.nav-controls-row.collapsed {
  flex-direction: column;
}

.nav-controls-row.expanded {
  flex-direction: row;
}

.pin-toggle {
  width: 100%;
  min-height: 26px;
  padding: 0.18rem 0.4rem;
  border-radius: 7px;
}

.pin-toggle .ui-icon {
  width: 13px;
  height: 13px;
}

.side-nav.collapsed .pin-toggle {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
}

.pin-toggle.floating {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
}

.pin-dot {
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
}

.side-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.side-nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 36px;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  color: var(--text-soft);
  border: 1px solid transparent;
  transition: color 0.14s, background 0.14s, border-color 0.14s;
}

.side-nav-link:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--table-row-hover) 100%, transparent);
}

.side-nav-link.is-active {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--nav-border-accent) 60%, var(--border-subtle));
  background: color-mix(in srgb, var(--nav-border-accent) 12%, var(--primary-gradient-soft));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--nav-border-accent) 22%, transparent);
}

.side-nav-stack {
  position: fixed;
  left: 8px;
  top: 8px;
  bottom: 8px;
  z-index: 30;
  width: 60px;
  transition: width 180ms ease, bottom 180ms ease;
}

.side-nav-stack.expanded {
  width: 220px;
}

.side-nav-stack.submenu-open {
  width: 536px;
}

.side-nav-peek {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--nav-surface), var(--bg-deep);
  box-shadow: var(--shadow-soft);
  opacity: 0.2;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.side-nav-stack.expanded .side-nav-peek {
  opacity: 0.4;
}

.side-nav-stack.submenu-open .side-nav-peek.open {
  opacity: 1;
  transform: translateX(228px);
  pointer-events: auto;
}

.side-nav-peek-inner {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-sizing: border-box;
  height: 100%;
  padding: 0.7rem;
  overflow-y: auto;
}

.side-nav-link {
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
}

.side-nav-submenu-group {
  display: grid;
  gap: 0.42rem;
}

.side-nav-submenu-group p {
  margin: 0.08rem 0 0.02rem 0.2rem;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.side-nav-submenu-header,
.side-nav-submenu-link {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  gap: 0.62rem;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 62px;
  padding: 0.58rem 0.62rem;
  text-decoration: none;
  border-radius: 11px;
  border: 1px solid transparent;
  color: var(--text-soft);
  transition: color 0.14s, background 0.14s, border-color 0.14s;
}

.side-nav-submenu-header {
  min-height: 66px;
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--nav-border-accent) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--nav-border-accent) 10%, var(--bg-elevated));
}

.side-nav-submenu-header:hover,
.side-nav-submenu-header:focus-visible {
  border-color: color-mix(in srgb, var(--nav-border-accent) 72%, var(--border-subtle));
  background: color-mix(in srgb, var(--nav-border-accent) 16%, var(--bg-elevated));
}

.side-nav-submenu-link:hover,
.side-nav-submenu-link:focus-visible,
.side-nav-submenu-link.is-active {
  color: var(--text-primary);
  background: var(--table-row-hover);
  border-color: var(--border-subtle);
}

.side-nav-submenu-header:focus-visible,
.side-nav-submenu-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.side-nav-submenu-header-icon,
.side-nav-submenu-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-input));
}

.side-nav-submenu-header-icon .ui-icon,
.side-nav-submenu-link-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.side-nav-submenu-header-copy,
.side-nav-submenu-link-copy {
  display: grid;
  min-width: 0;
  gap: 0.16rem;
}

.side-nav-submenu-header-copy strong,
.side-nav-submenu-link-copy strong {
  color: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
}

.side-nav-submenu-header-copy span,
.side-nav-submenu-link-copy span {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.3;
}

.side-nav-submenu-arrow,
.side-nav-parent-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.side-nav-submenu-arrow .ui-icon,
.side-nav-parent-arrow .ui-icon {
  width: 16px;
  height: 16px;
}

.side-nav-parent-arrow {
  margin-left: auto;
}

[data-theme="light"] .side-nav-link.is-active {
  border-color: rgba(79, 70, 229, 0.35);
  background: rgba(79, 70, 229, 0.1);
  box-shadow: none;
}

.side-nav-icon {
  width: 20px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}

.side-nav-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.side-nav-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.side-nav-footer {
  margin-top: auto;
  display: flex;
  justify-content: center;
}

.side-nav-footer .btn {
  width: 100%;
  min-height: 28px;
  font-size: 0.74rem;
}

@media (prefers-reduced-motion: reduce) {
  .side-nav,
  .side-nav-stack,
  .side-nav-peek {
    transition: none;
  }
}

.page {
  max-width: min(1400px, calc(100vw - var(--content-offset) - 2.2rem));
  margin: 1.4rem auto;
  padding: 0 1rem 3rem;
}

.page.page-reservations {
  max-width: none;
  margin: 0;
  padding: 0.5rem 0.6rem 0.6rem;
  height: calc(100vh - 86px);
}

body:has(.page.page-inbox) {
  overflow: hidden;
}

/* =====================================================   AUTH SURFACES — login / forgot-password / reset-password
   Premium two-pane shell (AuthShell.tsx + Wordmark.tsx).
   The brand panel is an intentional always-indigo hero; the
   form side is theme-aware (light + dark). Mobile collapses to
   the form card only.
   ============================================================ */

/* Brand lockup — the OFFICIAL logo SVG, inlined by components/brand/Wordmark.tsx
   (the previous text+CSS approximation was rejected 2026-07-13: "this isnt my logo").
   The word paths are `currentColor`, so `color` here IS the theme control; the "os"
   chip keeps its own brand gradient in both tones. */
.uos-lockup {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  color: var(--text-primary);
}
.uos-lockup svg {
  display: block;
  flex: none;
}
.uos-lockup-invert {
  color: #fff;
}

/* Shell */
.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-deep);
  color: var(--text-primary);
}

/* Brand panel (left) — always-dark indigo hero */
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(2rem, 4vw, 4rem);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(99, 102, 241, 0.5), transparent 55%),
    radial-gradient(130% 130% at 100% 100%, rgba(67, 56, 202, 0.55), transparent 50%),
    linear-gradient(160deg, #312e81 0%, #1e1b4b 48%, #0f0d2b 100%);
}
.auth-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.55;
  pointer-events: none;
}
.auth-brand > * {
  position: relative;
  z-index: 1;
}
.auth-brand-headline {
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.022em;
  line-height: 1.12;
  margin: 0 0 0.9rem;
  max-width: 16ch;
}
.auth-brand-sub {
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 1.7rem;
  max-width: 40ch;
}
.auth-brand-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.auth-brand-points li {
  position: relative;
  padding-left: 1.75rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.3;
}
.auth-brand-points li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}
.auth-brand-foot {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.01em;
}

/* Form side (right) */
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: clamp(1.5rem, 4vw, 3rem);
}
[data-theme="light"] .auth-main {
  background: #f5f6fb;
}
.auth-legal {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.auth-card {
  width: 100%;
  max-width: 408px;
  background:
    linear-gradient(160deg, rgba(19, 30, 50, 0.92), rgba(16, 24, 39, 0.95)),
    var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: clamp(1.6rem, 3vw, 2.3rem);
  box-shadow: var(--shadow-soft);
}
[data-theme="light"] .auth-card {
  background: #ffffff;
  border-color: rgba(31, 41, 68, 0.08);
  box-shadow:
    0 24px 60px -30px rgba(31, 41, 68, 0.3),
    0 2px 8px -4px rgba(31, 41, 68, 0.12);
}
.auth-card-brand {
  display: none;
  margin-bottom: 1.35rem;
}
.auth-head {
  margin-bottom: 1.45rem;
}
.auth-head h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.022em;
  margin: 0 0 0.35rem;
  color: var(--text-primary);
}
.auth-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Alerts */
.auth-alert {
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.auth-alert-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.36);
}
[data-theme="light"] .auth-alert-error {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
}
.auth-alert-ok {
  color: var(--state-success);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.34);
}

/* Form bits */
.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.auth-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
}
.auth-link:hover {
  text-decoration: underline;
}
.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.35rem;
  padding-top: 0.72rem;
  padding-bottom: 0.72rem;
  font-size: 0.98rem;
}
.auth-magic {
  width: 100%;
  justify-content: center;
}
.btn.btn-ghost.auth-password-toggle {
  width: 100%;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.15rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.auth-foot {
  margin-top: 1.4rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-checking {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  padding: 0.4rem 0;
}
.auth-spinner {
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: uos-spin 0.7s linear infinite;
}
@keyframes uos-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hide the app chrome on auth pages. The root layout (app/layout.tsx) wraps
   EVERY route in .app-shell → AppNav (.side-nav-stack) + .app-content (offset by
   --content-offset). Auth pages are pre-login and must be full-bleed, so when an
   .auth-shell is present we drop the nav rail and its content offset. */
body:has(.auth-shell) .side-nav-stack {
  display: none;
}
body:has(.auth-shell) .app-content {
  padding-left: 0;
}

/* Mobile — collapse to the form card */
@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    display: none;
  }
  .auth-card-brand {
    display: block;
  }
  .auth-main {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

.card {
  background:
    linear-gradient(160deg, rgba(19, 30, 50, 0.92), rgba(16, 24, 39, 0.95)),
    var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.05rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-soft);
}

[data-theme="light"] .card {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(245, 247, 253, 0.98)),
    var(--bg-deep);
}

.muted {
  color: var(--text-muted);
}

.warning {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2) inset, var(--shadow-soft);
}

.error {
  border-color: rgba(248, 113, 113, 0.6);
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.2) inset, var(--shadow-soft);
}

.ok {
  color: var(--state-success);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span {
  font-size: 0.88rem;
  color: var(--text-soft);
  font-weight: 600;
}

.field input {
  width: 100%;
}

.auth-mode-toggle {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
}

.auth-form {
  display: grid;
  gap: 0.8rem;
}

.auth-dashboard-options {
  display: grid;
  gap: 10px;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

input,
select,
button {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 0.58rem 0.7rem;
  font: inherit;
}

/* 🔴 AN ICON IN A BUTTON MUST NEVER SHRINK. Read this before you touch it.
 *
 * The `padding: .58rem .7rem` above (≈9px × 11px) applies to EVERY button in the app,
 * and everything is border-box. So an icon-only button with a fixed box loses 22.4px of
 * width to padding before its glyph gets any: a 24px box is left with 1.6px, a 28px box
 * with 5.6px. Lucide icons are flex items with the default `flex-shrink: 1`, so they
 * collapsed into whatever was left — and a 16px glyph in a 24px box rendered at
 * literally **0px wide**, an empty bordered square.
 *
 * That was not a rare edge case. Measured on ONE page of the real app (2026-07-26):
 * **344 of 928 icon buttons were squeezed**, three of them to nothing —
 *   0px   .aiops-turn-menu (the ⋯ on every assistant answer), .duty-card-* buttons
 *   5.6px .aiops-wheel  (his "Context wheel is too small")
 *   9.6px .aiops-send / .aiops-compose-btn, .inbox-emailcard-icon-btn
 *   11.6px .inbox-share-pill — on all 333 messages in the open thread
 * It is the single root cause behind a whole cluster of TestFlight reports: #52 "icons
 * are way too tiny", #54 "icons too small in email", #56 "this button looks clunky",
 * `AIL-i7t5R9kij2eUYl4NJgs` "context wheel is too small", and it had already been patched
 * one selector at a time in #539, #684, #1246 and #1266 without anyone fixing the cause.
 *
 * ONE line kills all of it: an icon states its size and keeps it. If the glyph is now
 * wider than the padding box it simply overflows into the padding — the box is centred,
 * so it looks right and the hit area is unchanged. If a button's LABEL now shrinks
 * instead, that is the correct trade: text can ellipsise, an icon cannot.
 *
 * Do NOT "fix" a small icon by bumping its `size` prop — the prop was never the problem.
 * Verify with getBoundingClientRect on the svg, never the prop. memory/feedback_icons_too_small */
button svg {
  flex: 0 0 auto;
  vertical-align: middle;
}

/* Icon-only styling requires an explicit semantic signal. New controls use
 * components/ui/IconButton and its data marker. Existing SVG-only controls
 * opt in through their accessible aria-label; the source regression requires
 * visible icon-and-text labels to live in elements, because CSS :only-child
 * ignores raw text nodes. :where() keeps this baseline easy to override. */
button:where([data-icon-only="true"]),
button:where([aria-label]:has(> svg:only-child)) {
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 0;
}
button:where([data-icon-only="true"]) > svg,
button:where([aria-label]:has(> svg:only-child)) > svg {
  display: block;
  margin: 0;
}

input::placeholder {
  color: color-mix(in srgb, var(--text-muted) 70%, #94a3b8 30%);
}

select {
  width: 100%;
}

input:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

button {
  cursor: pointer;
  font-weight: 700;
  transition: 180ms ease;
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

/* Buttons — UpgradedOS DS spec (Core Lite Upgrade Figma): a CRISP SOLID indigo primary with subtle
   shadcn-style elevation + a focus ring + a real press, NOT a glowy bluish-purple gradient (the DS
   explicitly forbids those — they read as generic/dated). 8px control radius, Manrope 650. Token-
   based so light + dark both hold. (Restyled 2026-06-05 — host: "buttons look generic as fuck".) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.55rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.08s ease;
  -webkit-font-smoothing: antialiased;
}

/* Canonical icon-only button geometry. A labelled `.btn` owns horizontal
   padding; an icon-only button owns one square hit area. Mixing those two
   contracts is what made pencil, bin and close glyphs look optically offset
   even when the SVG itself was correct. */
.btn.btn-icon {
  inline-size: 2rem;
  block-size: 2rem;
  min-inline-size: 2rem;
  min-block-size: 2rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  gap: 0;
  line-height: 0;
}
.btn.btn-icon > svg {
  display: block;
  margin: 0;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 55%, transparent);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent); /* solid indigo-600/500 — DS primary, not a gradient */
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* shadow-xs — subtle elevation, not a glow */
}

.btn-primary:hover {
  /* DS hover = a ~10% darker overlay on the accent (holds in both themes). */
  background: color-mix(in srgb, #000 10%, var(--accent));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 30%, transparent);
}

.btn-primary:active {
  background: color-mix(in srgb, #000 16%, var(--accent));
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-raised, var(--bg-input));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--table-surface);
}

table {
  width: max-content;
  max-width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.72rem;
  border-bottom: 1px solid var(--table-border);
  vertical-align: top;
  color: var(--table-cell-text);
}

th {
  background: var(--table-header-bg);
  position: sticky;
  top: 0;
  font-weight: 700;
  color: var(--table-header-text);
}

tbody tr:nth-child(even) {
  background: var(--table-striped);
}

tr.clickable {
  cursor: pointer;
  transition: background 140ms ease;
}

tr.clickable:hover {
  background: var(--table-row-hover);
}

.pagination {
  margin-top: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.split {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 420px);
  gap: 1rem;
  min-width: 0;
}

.split > section {
  min-width: 0;
}

.split .card {
  min-width: 0;
}

.split .table-wrap {
  max-width: 100%;
}

.split.single {
  grid-template-columns: 1fr;
}

@media (max-width: 1020px) {
  .split {
    grid-template-columns: 1fr;
  }

  .app-content {
    padding-left: 80px;
  }

  .side-nav.expanded {
    width: 210px;
  }}

.json-pre {
  max-height: 64vh;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  background: var(--json-bg);
  color: var(--text-primary);
}

.money-toggle {
  align-content: flex-end;
}

.money-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.money-actions {
  display: flex;
  align-items: flex-end;
}

.money-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.money-summary p {
  font-size: 1.1rem;
  font-weight: 700;
}

.workspace-page {
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0.45rem 0.5rem;
}

.workspace-page.inbox-workspace-page {
  padding: 0;
}

.workspace-recovery-state {
  min-height: calc(100dvh - 12px);
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 2rem;
  color: var(--text-primary);
}

.workspace-main-content > .workspace-recovery-state {
  min-height: 100%;
}

.workspace-recovery-card {
  width: min(100%, 30rem);
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  text-align: center;
}

.workspace-recovery-card h2,
.workspace-recovery-card p {
  margin: 0;
}

.workspace-recovery-card h2 {
  font-size: 1.05rem;
}

.workspace-recovery-card p {
  max-width: 44ch;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

.workspace-recovery-card.is-loading {
  width: auto;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.workspace-recovery-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: workspace-recovery-spin 0.8s linear infinite;
}

@keyframes workspace-recovery-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-recovery-spinner { animation: none; }
}

.workspace-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.2rem;
}

.workspace-shell {
  display: grid;
  grid-template-columns: auto 8px minmax(0, 1fr) 8px auto;
  grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 10px);
  gap: 0.5rem;
  padding: 6px 8px 6px 4px;
  box-sizing: border-box;
}
/* The old desktop Agent Patrol strip is no longer mounted globally. These
   styles remain local to the explicit component instead of changing workspace
   or navigation geometry for every page. */
.agent-patrol {
  position: fixed;
  z-index: 58;
  left: 8px;
  right: 8px;
  bottom: 6px;
  color: var(--text-primary);
  font-family: inherit;
}
.agent-patrol-strip {
  height: 36px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px) saturate(1.25);
}
.agent-patrol-brand,
.agent-patrol-ticker,
.agent-patrol-actions button,
.agent-patrol-panel button,
.agent-patrol-reopen {
  border: 0;
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
.agent-patrol-brand {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px 0 5px;
  border-right: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.agent-patrol-brand .stavros-avatar { flex: none; }
.agent-patrol-brand strong { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.agent-patrol-brand > span:last-child { color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.agent-patrol-live-dot,
.agent-patrol-reopen > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state-success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--state-success) 14%, transparent);
}
.agent-patrol-live-dot.is-working,
.agent-patrol-reopen > span.is-working {
  background: var(--state-warning);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--state-warning) 18%, transparent);
  animation: agentPatrolPulse 1.35s ease-in-out infinite;
}
.agent-patrol-live-dot.is-attention,
.agent-patrol-reopen > span.is-attention {
  background: var(--state-error);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--state-error) 16%, transparent);
}
.agent-patrol-live-dot.is-paused,
.agent-patrol-reopen > span.is-paused {
  background: var(--text-muted);
  box-shadow: none;
}
.agent-patrol-ticker {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  padding: 0 14px;
  color: var(--text-soft);
  text-align: left;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.agent-patrol-ticker:disabled { cursor: default; }
.agent-patrol-ticker span { display: block; overflow: hidden; text-overflow: ellipsis; }
.agent-patrol-actions { display: flex; align-items: center; padding: 0 5px; border-left: 1px solid var(--border-subtle); }
.agent-patrol-actions button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; color: var(--text-muted); }
.agent-patrol-actions button:hover,
.agent-patrol-brand:hover,
.agent-patrol-ticker:not(:disabled):hover { background: var(--surface-muted); color: var(--text-primary); }
.agent-patrol-panel {
  position: absolute;
  right: 0;
  bottom: 42px;
  width: min(440px, calc(100vw - 16px));
  max-height: min(540px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}
.agent-patrol-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--border-subtle); }
.agent-patrol-panel-head > div { display: grid; gap: 2px; }
.agent-patrol-panel-head strong { font-size: 13px; }
.agent-patrol-panel-head span { color: var(--text-muted); font-size: 11px; }
.agent-patrol-panel-head button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; }
.agent-patrol-agents {
  display: grid;
  gap: 5px;
  max-height: 230px;
  overflow-y: auto;
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.agent-patrol-agents > strong,
.agent-patrol-section-title {
  padding: 0 4px 3px;
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.agent-patrol-agents > p { margin: 0; padding: 9px 5px; color: var(--text-muted); font-size: 11px; }
.agent-patrol-agent {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-muted);
}
.agent-patrol-agent-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--state-success); }
.agent-patrol-agent.is-review .agent-patrol-agent-dot { background: var(--state-warning); }
.agent-patrol-agent.is-attention .agent-patrol-agent-dot { background: var(--state-error); }
.agent-patrol-agent.is-paused .agent-patrol-agent-dot { background: var(--text-muted); }
.agent-patrol-agent-copy { min-width: 0; display: grid; gap: 2px; }
.agent-patrol-agent-copy strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.agent-patrol-agent-copy small { color: var(--text-muted); font-size: 10px; line-height: 1.35; }
.agent-patrol-agent-state {
  padding: 3px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-success) 11%, transparent);
  color: var(--state-success);
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}
.agent-patrol-agent.is-review .agent-patrol-agent-state { background: color-mix(in srgb, var(--state-warning) 11%, transparent); color: var(--state-warning); }
.agent-patrol-agent.is-attention .agent-patrol-agent-state { background: color-mix(in srgb, var(--state-error) 11%, transparent); color: var(--state-error); }
.agent-patrol-agent.is-paused .agent-patrol-agent-state { background: var(--surface-muted); color: var(--text-muted); }
.agent-patrol-history { min-height: 0; flex: 1; overflow-y: auto; padding: 7px; }
.agent-patrol-history > .agent-patrol-section-title { display: block; padding-top: 4px; }
.agent-patrol-history > button { width: 100%; display: grid; grid-template-columns: 10px minmax(0, 1fr); align-items: start; gap: 9px; padding: 9px 8px; border-radius: 8px; text-align: left; }
.agent-patrol-history > button:hover:not(:disabled) { background: var(--surface-muted); }
.agent-patrol-history > button:disabled { cursor: default; }
.agent-patrol-history > p { margin: 0; padding: 18px 10px; color: var(--text-muted); font-size: 12px; }
.agent-patrol-event-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--text-muted); }
.agent-patrol-event-dot.is-started { background: var(--state-warning); }
.agent-patrol-event-dot.is-waiting { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.agent-patrol-event-dot.is-completed { background: var(--state-success); }
.agent-patrol-event-dot.is-failed { background: var(--state-error); }
.agent-patrol-event-dot.is-interrupted { background: var(--text-muted); }
.agent-patrol-event-copy { min-width: 0; display: grid; gap: 3px; }
.agent-patrol-event-copy strong { overflow: hidden; color: var(--text-primary); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; }
.agent-patrol-event-copy small { color: var(--text-muted); font-size: 10.5px; }
.agent-patrol-reopen {
  position: fixed;
  z-index: 58;
  right: 10px;
  bottom: 8px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}
@keyframes agentPatrolPulse { 50% { transform: scale(1.28); opacity: 0.7; } }
@media (prefers-reduced-motion: reduce) {
  .agent-patrol-live-dot.is-working,
  .agent-patrol-reopen > span.is-working { animation: none; }
}
@media (max-width: 640px) {
  .agent-patrol,
  .agent-patrol-reopen { display: none; }
}

/* WorkspaceShell overlay drawers — pane 4 (support/details) + pane 5 (AI) slide in
   from the right whenever their expanded width would crowd the working pane.
   The width budget lives in responsive-layout.ts; there are no device breakpoints here.
   Tokens: all from :root / [data-theme="light"] blocks above — no invented values. */
.ws-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 59;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(1px);
}
[data-theme="light"] .ws-overlay-backdrop {
  background: rgba(0, 0, 0, 0.12);
}
.ws-overlay-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 92vw);
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
[data-theme="light"] .ws-overlay-drawer {
  box-shadow: -4px 0 24px rgba(15, 23, 42, 0.10);
}
.ws-overlay-drawer.is-open {
  transform: translateX(0);
}
.ws-overlay-drawer--ai {
  /* Runtime width follows the measured workspace rather than the device label.
     Before that measurement exists, mirror its 480px work-surface reserve from
     the browser width after AppNav. */
  width: min(
    360px,
    max(260px, calc(100vw - var(--content-offset) - 480px))
  );
  max-width: calc(100vw - var(--content-offset) - 8px);
}
@media (prefers-reduced-motion: reduce) {
  .ws-overlay-drawer {
    transition: none;
  }
}
.ws-overlay-drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  z-index: 1;
}
.ws-overlay-drawer-close:hover {
  background: color-mix(in srgb, var(--border-subtle) 60%, var(--bg-input));
  color: var(--text-primary);
}
/* Pane toggle buttons: rendered in the topbar right cluster only when the width
   budget has assigned that pane to a drawer. */
.ws-pane-toggle.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-input));
}

body.workspace-no-select {
  user-select: none !important;
  -webkit-user-select: none !important;
}

.workspace-topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 90%, transparent);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg-deep) 96%, var(--bg-elevated)) 0%,
    var(--bg-deep) 100%
  );
  padding: 0.22rem 0.32rem;
  position: relative;
  z-index: 20;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text-primary) 4%, transparent) inset;
}

.workspace-topbar-right {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

/* —— Detached pop-out window (lib/windows/detach.ts) ——
   The popped window renders the SAME shell (CLAUDE.md #11) with AppNav
   suppressed. Reclaim the rail offset here — .app-content pads by
   --content-offset unconditionally, so leaving it would indent the grid by 74px
   of empty space that nothing occupies. All colours are theme tokens, so light
   and dark come free. */
.app-shell.is-detached {
  --content-offset: 0px;
}

.workspace-detached-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-inline: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  min-width: 0;
}

.workspace-detached-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-detached-title svg {
  color: var(--text-muted);
  flex: none;
}

.workspace-popout-btn {
  padding-inline: 0.4rem;
}

/* A nav entry whose section is currently open in its own window. Clicking it
   raises that window rather than navigating, so it needs to LOOK different from
   a normal link or the lack of navigation reads as a broken click. */
.side-nav-link.is-detached .side-nav-icon::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-deep);
}

.side-nav-link.is-detached .side-nav-icon {
  position: relative;
}

/* The stand-in shown in the MAIN window while a section lives in its own
   window. It replaces panes 2–5, so it is a grid child of .workspace-shell and
   spans the single column the shell collapses to in this state. */
.workspace-detached-away {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 2rem;
  overflow: auto;
  background: var(--bg-deep);
}

.workspace-detached-away-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  max-width: 26rem;
  padding: 2rem 2.25rem 2.25rem;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.workspace-detached-away-icon {
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.workspace-detached-away-card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.workspace-detached-away-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.workspace-detached-away-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.workspace-history-wrap {
  position: relative;
}

.workspace-channel-notifications {
  position: relative;
}

.workspace-history-btn {
  min-height: 28px;
  padding: 0.22rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--border-strong) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  /* Labels contain spaces ("What's new") — never let a squeezed topbar wrap
     them to two lines; the ≤1100px query collapses to icon-only instead. */
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}

.workspace-history-btn:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--ring) 28%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-input) 100%, transparent);
}

.workspace-history-btn .ui-icon {
  width: 18px;
  height: 18px;
}

.workspace-channel-notifications-btn {
  min-height: 28px;
  padding: 0.22rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--border-strong) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}

.workspace-channel-notifications-btn:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--ring) 28%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-input) 100%, transparent);
}

.workspace-channel-notifications-btn .ui-icon {
  width: 18px;
  height: 18px;
}

.workspace-channel-notifications-btn strong {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--state-warning) 35%, transparent);
  color: #fef3c7;
  border: 1px solid color-mix(in srgb, var(--state-warning) 55%, transparent);
  font-size: 0.65rem;
}

.workspace-channel-notifications-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 25;
  min-width: 320px;
  max-width: 360px;
  max-height: min(60vh, 420px);
  overflow: auto;
  display: grid;
  gap: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.55rem;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}

.workspace-channel-notifications-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
}

.workspace-channel-notifications-head p {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 700;
}

.workspace-channel-notifications-list {
  display: grid;
  gap: 0.35rem;
}

.workspace-channel-note {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.35rem 0.42rem;
  display: grid;
  gap: 0.12rem;
}

.workspace-channel-note.is-success {
  border-color: color-mix(in srgb, var(--state-success) 48%, var(--border-subtle));
}

.workspace-channel-note.is-error {
  border-color: color-mix(in srgb, var(--state-error) 48%, var(--border-subtle));
}

.workspace-channel-note.is-info {
  border-color: color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
}

.workspace-channel-note.is-read {
  opacity: 0.75;
}

.workspace-channel-note strong {
  font-size: 0.73rem;
}

.workspace-channel-note p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-soft);
}

.workspace-channel-note small {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.workspace-history-btn .ui-icon {
  width: 18px;
  height: 18px;
}

.workspace-history-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 25;
  min-width: 280px;
  max-width: 340px;
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.55rem;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}

.workspace-history-menu > p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 700;
}

.workspace-history-empty {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.workspace-history-item {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  display: grid;
  gap: 0.14rem;
}

.workspace-history-item strong {
  font-size: 0.73rem;
  color: var(--text-primary);
}

.workspace-history-item small {
  font-size: 0.66rem;
  color: var(--text-muted);
}

.workspace-history-item button {
  justify-self: flex-start;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
}

.workspace-insights-panel {
  display: grid;
  gap: 0.45rem;
  padding: 0.42rem 0.56rem 0.1rem;
}

.workspace-insight-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.44rem 0.5rem;
  background: color-mix(in srgb, var(--bg-input) 44%, transparent);
  display: grid;
  gap: 0.28rem;
}

.workspace-insight-card h3 {
  margin: 0;
  font-size: 0.78rem;
}

.workspace-insight-card p {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-primary);
}

.workspace-insight-card small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.workspace-insight-grid {
  display: grid;
  gap: 0.16rem;
}

.workspace-insight-grid span {
  font-size: 0.7rem;
  color: var(--text-soft);
}

.workspace-insight-card textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.74rem;
  padding: 0.42rem 0.48rem;
}

.workspace-ai-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border: 1px solid color-mix(in srgb, var(--border-strong) 70%, transparent);
  border-radius: 8px;
  min-height: 28px;
  padding: 0.22rem 0.55rem;
  background: color-mix(in srgb, var(--primary-gradient-soft) 30%, var(--bg-input));
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.005em;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.workspace-ai-toggle:hover,
.workspace-ai-toggle:focus-visible {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--ring) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary-gradient-soft) 48%, var(--bg-input));
  outline: none;
}

.workspace-ai-toggle.is-open {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--ring) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary-gradient-soft) 58%, var(--bg-input));
}

.workspace-ai-toggle .ui-icon {
  width: 18px;
  height: 18px;
}

.workspace-ai-toggle strong {
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.24rem;
  font-size: 0.62rem;
  color: #f8fafc;
  background: color-mix(in srgb, #2563eb 75%, var(--ring));
}

/* Messages indicator (#5): slim icon + label button (reuses .workspace-history-btn)
   with a single unread badge + a click dropdown (.workspace-messages-menu reuses
   the notifications-menu shell). Replaces the old 232px hover-preview pill. */
.workspace-messages-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.24rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #e0f2fe;
  background: color-mix(in srgb, #2563eb 72%, var(--ring));
}

.workspace-message-row {
  display: grid;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.4rem 0.45rem;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.workspace-message-row:hover,
.workspace-message-row:focus-visible {
  border-color: color-mix(in srgb, var(--ring) 28%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
}

.workspace-message-row strong {
  font-size: 0.74rem;
  color: var(--text-primary);
}

.workspace-message-row em {
  color: var(--text-soft);
  font-style: normal;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-message-row small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.workspace-ai-notify {
  margin-left: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 0.3rem;
  font-size: 0.66rem;
  color: #f8fafc;
  background: color-mix(in srgb, #2563eb 75%, var(--ring));
}

.workspace-body-item {
  grid-row: 2;
}

.workspace-list-pane,
.workspace-main-pane,
.workspace-right-pane,
.workspace-property-nav-pane {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-height: 0;
}

.workspace-property-nav-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  contain: content;
}

.workspace-list-fetch-error {
  padding: 0.45rem 0.75rem;
  font-size: 0.72rem;
  color: #fecaca;
  background: color-mix(in srgb, #b91c1c 22%, var(--bg-deep));
  border-bottom: 1px solid var(--border-subtle);
}
.workspace-list-fetch-error:has(> button) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.workspace-list-fetch-error > button {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, #ef4444 42%, var(--border-subtle));
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.workspace-list-pane {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-width: 0;
  position: relative;
  /* 🔴 0, NOT auto — this one value is what keeps pane 2's contents INSIDE
     pane 2, and it must never go back to `auto`.
     `position: relative; z-index: auto` creates NO stacking context, so every
     floating thing in this pane competes directly against the rest of the app.
     The search head (.inbox-glasshead) is `sticky; z-index: 30` and the nav rail
     (.side-nav-stack) is `fixed; z-index: 30` — the SAME level. On a tie the
     later element in the document wins, and the list pane comes after the nav,
     so hovering the nav open painted the search bar and the filter chips
     straight over the menu, and over the Settings panel too (Hakim 2026-07-27,
     with a screenshot: "wtf is up with the search bar and chips? why does this
     keep happening?").
     "Keep happening" is the important part. Every previous go at this nudged one
     element's number, which fixes one collision and leaves the next one waiting
     — because the CAUSE is that the pane never contained anything. z-index: 0
     makes this pane a stacking context, so everything inside it (this head, its
     dropdowns at z-120, and anything a future agent adds at any z-index at all)
     is sealed below the nav, the topbar and every overlay, permanently and
     without anyone having to pick a number correctly.
     Inside the pane nothing changes: the head still floats over its own rows.
     Do NOT "simplify" this back to auto. */
  z-index: 0;
}

.workspace-list-pane.workspace-list-pane--properties {
  z-index: auto;
  overflow: visible;
}

.workspace-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.workspace-pane-head h2 {
  margin: 0;
  font-size: 0.93rem;
}

.workspace-list-scroll {
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 0.42rem 0.75rem 0.42rem 0.42rem;
  display: grid;
  gap: 0.42rem;
  min-width: 0;
  /* In the pane's `auto 1fr` grid, the scroll area sits in the `1fr` track. Grid
     items default to min-height:auto, which lets them grow past the track to fit
     content — so overflow:auto never engages and the list won't scroll. min-height:0
     lets it shrink to the track and actually scroll. align-content keeps rows
     top-packed instead of stretching to fill a short list. */
  min-height: 0;
  align-content: start;
}

/* Properties pane-2 Listings / Owners / All swap — the mode class flips between
   identical fades (an animation only restarts when its NAME changes), so the
   incoming list glides in instead of hard-popping. Opacity only: the scroll
   container hosts sticky/portal children a transform would break. */
.workspace-list-scroll--owners {
  animation: workspace-list-swap-owners 160ms ease;
}
.workspace-list-scroll--listings {
  animation: workspace-list-swap-listings 160ms ease;
}
.workspace-list-scroll--all {
  animation: workspace-list-swap-all 160ms ease;
}
.workspace-list-scroll--streams {
  animation: workspace-list-swap-streams 160ms ease;
}
@keyframes workspace-list-swap-owners {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes workspace-list-swap-listings {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes workspace-list-swap-all {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes workspace-list-swap-streams {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-list-scroll--owners,
  .workspace-list-scroll--listings,
  .workspace-list-scroll--all,
  .workspace-list-scroll--streams {
    animation: none;
  }
}

/* Pane-2 "render only what you see" (Hakim 2026-06-13). InboxListPane windows
   its rows in JS; content-visibility lets the browser skip layout/paint for any
   windowed row that's still off-screen, so even after the window grows on scroll
   only on-screen cards cost layout. contain-intrinsic-size gives skipped rows a
   placeholder height (scrollbar stays honest); `auto` remembers each row's real
   height once measured, since rows vary with tags/segment chips. Safe here — the
   only row tooltips are native `title=` (unaffected by paint containment). */
.workspace-list-scroll--inbox .workspace-list-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 76px;
}

/* Pane-2 loading skeleton (Hakim 2026-06-14: the list pane must not vanish while it
   loads — show shimmer placeholders instead of an empty/blank pane). Mirrors the
   real card's avatar + body grid so nothing jumps when real rows replace it; uses
   the shared `.skel` shimmer (theme-tokened, so it works in light + dark). */
/* Offered ONLY when the list failed to load — an empty list has nothing to retry.
   Distinguishing the two is the whole point; see lib/inbox/list-state.ts. */
.workspace-list-retry {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.workspace-list-retry:hover {
  background: var(--surface-hover, var(--surface));
}
.workspace-list-skel-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.58rem;
  padding: 0.46rem;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--table-surface);
}
.workspace-list-skel-avatar {
  width: 44px;
  height: 44px;
  justify-self: center;
}
.workspace-list-skel-body {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  min-width: 0;
}
.workspace-list-skel-line {
  height: 0.66rem;
}

/* Workspace shell loading skeleton — the Suspense fallback (app/layout.tsx) for the
   whole shell. WorkspaceShell suspends on useSearchParams(); the old fallback was a
   bare "Loading…" text that visually deleted the workspace. This mirrors the shell
   frame so the app stays present while it hydrates; pane surfaces match the real
   .workspace-*-pane (bg-deep + subtle border). */
.workspace-skel-root {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 10px);
  gap: 0.5rem;
  padding: 6px 8px 6px 4px;
  min-width: 0;
}
/* Phone suspense fallback: the desktop skeleton above would crush into a
   compacted grid at phone width, so a phone gets the plain launch canvas
   instead — the same #0a0a0f as the native splash, so the
   whole cold-load reads as one seamless dark hand-off, never a squished
   desktop. Theme-independent on purpose (matches the dark splash it follows). */
.workspace-skel-phone {
  position: fixed;
  inset: 0;
  background: #0a0a0f;
  z-index: 40;
}
.workspace-skel-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 46px;
  flex: 0 0 auto;
  padding: 0 0.5rem;
}
.workspace-skel-body {
  display: flex;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
}
.workspace-skel-pane {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.workspace-skel-pane--list {
  flex: 0 0 340px;
}
.workspace-skel-pane--main {
  flex: 1 1 auto;
}
.workspace-skel-pane--support {
  flex: 0 0 360px;
}
@media (max-width: 1024px) {
  .workspace-skel-pane--support {
    display: none;
  }
}
@media (max-width: 768px) {
  .workspace-skel-body {
    flex-direction: column;
  }
  .workspace-skel-pane--list {
    flex: 0 0 auto;
    max-height: 42vh;
  }
}

/* Properties list: when few results, keep cards at natural height (not stretched to full column) */
.workspace-list-pane.workspace-list-pane--properties:not(.is-slim) {
  min-width: 0;
}

.workspace-list-scroll--properties {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  padding: 0.72rem 0.9rem 1rem 0.6rem;
  position: relative;
  z-index: 1;
  overflow: auto;
}

.workspace-list-scroll--properties .workspace-list-card--property {
  display: grid;
  grid-template-columns: 52px 1fr;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: start;
  box-sizing: border-box;
  margin-bottom: 0;
}

.workspace-list-scroll--properties .workspace-list-card--property.selection-mode {
  grid-template-columns: 24px 52px 1fr;
  align-items: center;
}

.workspace-list-pane.is-slim,
.workspace-property-nav-pane.is-slim,
.workspace-right-pane.is-slim {
  padding: 0;
  overflow: hidden;
}

.workspace-list-pane.is-slim {
  grid-template-rows: 1fr;
}

.workspace-property-nav-pane.is-slim,
.workspace-right-pane.is-slim {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.workspace-pane-slim-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.workspace-pane-rail {
  flex: 1;
  min-height: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border: 0;
  background: color-mix(in srgb, var(--border-subtle) 20%, var(--bg-deep));
  color: var(--text-muted);
  padding: 0.35rem 0.1rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.16s ease, color 0.16s ease;
}

.workspace-pane-rail:hover,
.workspace-pane-rail:focus-visible {
  background: color-mix(in srgb, var(--ring) 20%, var(--bg-deep));
  color: var(--text-primary);
  outline: none;
}

.workspace-pane-rail-grip {
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--text-muted);
  opacity: 0.45;
}

.workspace-pane-rail-chevron {
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.7;
}

.workspace-list-pane,
.inbox-main-column {
  --workspace-list-control-height: 30px;
  --workspace-list-control-y-inset: 0.22rem;
}

.workspace-list-toolbar {
  padding: var(--workspace-list-control-y-inset) 0.42rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  flex-wrap: wrap;
  z-index: auto;
}

.workspace-list-toolbar input {
  flex: 1;
  height: var(--workspace-list-control-height);
  padding: 0 0.5rem;
  font-size: 0.78rem;
}

.workspace-list-filter-btn {
  width: var(--workspace-list-control-height);
  height: var(--workspace-list-control-height);
  padding: 0;
}

.workspace-list-filter-btn.active {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 24%, var(--bg-input));
  color: #e0ecff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 56%, transparent) inset, 0 0 0 2px color-mix(in srgb, var(--accent) 34%, transparent);
}

.workspace-bulk-row {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.34rem;
  margin-top: 0.1rem;
}

.workspace-bulk-check {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-right: 0.1rem;
  font-size: 0.72rem;
  color: var(--text-soft);
}

.workspace-bulk-check input {
  margin: 0;
}

.workspace-bulk-row .btn {
  min-height: 26px;
  padding: 0.18rem 0.44rem;
  font-size: 0.7rem;
}

.workspace-bulk-danger {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border-subtle));
  color: color-mix(in srgb, #fcd34d 68%, var(--text-primary));
}

.workspace-filter-menu {
  position: absolute;
  top: calc(100% + 0.2rem);
  right: 0.45rem;
  z-index: 120;
  min-width: 150px;
  display: grid;
  gap: 0.15rem;
  padding: 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-elevated) 96%, #0a0f1c);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
}

.workspace-filter-menu.layered {
  min-width: 165px;
  align-items: stretch;
}

.workspace-filter-submenu {
  position: absolute;
  right: calc(100% + 0.24rem);
  left: auto;
  top: 0;
  min-width: 170px;
  display: grid;
  gap: 0.12rem;
  padding: 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  z-index: 260;
}

/* ═══ INBOX PANE-2 GLASSHEAD — floating liquid-glass search + kind chips ═══
   (2026-07-26, Hakim's Liquid Glass instruction; replaces the boxed toolbar +
   bordered chip strip he rejected as "screams web view".)

   Structure (InboxListPane.tsx): the pane contains ONE scroll container, and the
   search capsule + chip strip sit INSIDE it as a sticky, transparent
   `.inbox-glasshead`. Rows genuinely scroll UNDER the capsules — the layered
   material still reads as floating instead of as a painted toolbar — and the
   pane can never regrow bare extra children, the failure mode the old
   positional `grid-template-rows: auto 1fr` pane hit twice (2026-07-25: a third
   child stole the `1fr` track and the strip rendered as a sliver or as
   full-height rectangles depending on list length).

   Compositor caveat (confirmed in beta on Chromium/Arc, 2026-07-29): a sticky
   backdrop-filter above hover-changing rows can invalidate the browser's backing
   texture on every pointer crossing and flash the whole window. Desktop uses
   opaque, theme-matched material plus a gradient rim instead of live backdrop
   sampling. The phone surface keeps its separate `.ph-*` glass system. */

/* The pane's grid is positional (`auto 1fr` = exactly two children). The inbox
   pane now has a single scroll child, so switch it to a flex column and let the
   scroll container take the full height. Copy THIS pattern — never extend the
   grid to `auto auto 1fr` — if another pane ever grows extra strips. */
.workspace-list-pane:has(> .workspace-list-scroll--inbox) {
  display: flex;
  flex-direction: column;
  /* Keep every row-hover repaint inside pane 2. This is also a defensive
     boundary against a future compositor-heavy decoration escaping the pane. */
  contain: paint;
  isolation: isolate;
}
.workspace-list-pane:has(> .workspace-list-scroll--inbox) > .workspace-list-scroll {
  flex: 1 1 0;
}
/* The glasshead supplies the top spacing; rows slide under it from 0. */
.workspace-list-scroll.workspace-list-scroll--inbox {
  padding-top: 0;
}

.inbox-glasshead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  gap: 7px;
  /* Bleed across the scroll container's own padding so capsules align with the
     pane edges and rows pass beneath the full head width. */
  margin: 0 -0.75rem 0.1rem -0.42rem;
  padding: 0.5rem 0.75rem 0.35rem 0.42rem;
  /* The wrapper itself is INVISIBLE — no slab, no border. Only the capsules are
     material. Clicks in the gaps fall through to the rows beneath. */
  background: transparent;
  pointer-events: none;
}
.inbox-glasshead > * {
  pointer-events: auto;
}
/* Soft scrim so row text entering the head zone dims instead of colliding with
   the pill text — a feather, not a border. */
.inbox-glasshead::before {
  content: "";
  position: absolute;
  inset: -1px 0 -14px 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg-deep) 88%, transparent) 0%,
    color-mix(in srgb, var(--bg-deep) 55%, transparent) 62%,
    transparent 100%
  );
}

/* ── The search capsule — same family as the phone's Ask Stavros bar: one
   rounded-full glass capsule holding the field and the pane's controls. ── */
.inbox-glasshead .workspace-list-toolbar {
  border-bottom: 0;
  flex-wrap: nowrap;
  gap: 2px;
  height: 42px;
  padding: 0 5px 0 12px;
  border-radius: 21px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--text-primary) 4%, transparent), transparent 52%),
    var(--glass-capsule-bg);
  border: 0.5px solid var(--glass-capsule-border);
  box-shadow: var(--glass-capsule-shadow), var(--glass-capsule-rim);
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}
.inbox-glasshead .workspace-list-toolbar:focus-within {
  border-color: color-mix(in srgb, var(--ring) 45%, var(--glass-capsule-border));
  box-shadow:
    var(--glass-capsule-shadow),
    var(--glass-capsule-rim),
    0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}
.inbox-glasshead .workspace-list-toolbar input {
  background: transparent;
  border: 0;
  box-shadow: none;
  outline: none;
  height: 100%;
  padding: 0;
  font-size: 0.8rem;
  color: var(--text-primary);
}
.inbox-glasshead .workspace-list-toolbar input::placeholder {
  color: var(--text-muted);
}
/* Controls dissolve into the capsule: borderless circular ghosts. The "+" keeps
   its accent fill as the one solid element, like the Stavros face glyph. */
.inbox-glasshead .workspace-list-filter-btn {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  transition: background 0.18s ease, transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.inbox-glasshead .workspace-list-filter-btn:hover,
.inbox-glasshead .workspace-list-filter-btn:focus-visible {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  border-color: transparent;
}
.inbox-glasshead .workspace-list-filter-btn.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.inbox-glasshead .workspace-list-filter-btn:active {
  transform: scale(0.9);
}
.inbox-glasshead .workspace-list-new-btn {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.inbox-glasshead .workspace-list-new-btn:active {
  transform: scale(0.9);
}
/* The dropdowns hang from the capsule, glass-skinned to match. */
.inbox-glasshead .workspace-filter-menu {
  border-radius: 14px;
  background: var(--glass-menu-bg);
  /* Override the shared menu's blur: this menu lives inside the sticky
     glasshead and must not reopen the hover-driven compositor path. */
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 0.5px solid var(--glass-capsule-border);
  box-shadow: var(--glass-capsule-shadow), var(--glass-capsule-rim);
  animation: glasshead-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.inbox-glasshead .workspace-filter-submenu {
  border-radius: 14px;
  background: var(--glass-menu-bg);
  border: 0.5px solid var(--glass-capsule-border);
  box-shadow: var(--glass-capsule-shadow), var(--glass-capsule-rim);
}

/* ── The kind chips — free-floating glass pills (no strip chrome). Wraps to a
   second line on a narrow pane instead of clipping; a dropdown lives inside, so
   this row must NEVER become overflow-x:auto (it would clip the menu). ── */
.workspace-quickchips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.workspace-quickchips > * {
  pointer-events: auto;
}
.workspace-quickchip {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: 14px;
  border: 0.5px solid var(--glass-capsule-border);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--text-primary) 4%, transparent), transparent 54%),
    var(--glass-capsule-bg);
  box-shadow: var(--glass-capsule-shadow-sm), var(--glass-capsule-rim);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
  animation: glasshead-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Staggered entrance, left to right. The row REMOUNTS (keyed) whenever the
   anchor combination changes, so each new pairing set "spawns" in sequence —
   that is the anchor-and-pair morph, not just a mount effect. */
.workspace-quickchip:nth-child(2) { animation-delay: 0.04s; }
.workspace-quickchip:nth-child(3) { animation-delay: 0.08s; }
.workspace-quickchip:nth-child(4) { animation-delay: 0.12s; }
.workspace-quickchip:nth-child(5) { animation-delay: 0.16s; }
.workspace-quickchip:nth-child(6) { animation-delay: 0.2s; }
.workspace-quickchip:nth-child(7) { animation-delay: 0.24s; }
.workspace-quickchip:nth-child(8) { animation-delay: 0.28s; }
.workspace-quickchip:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--text-primary) 18%, var(--glass-capsule-border));
}
.workspace-quickchip:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--ring) 55%, var(--glass-capsule-border));
}
.workspace-quickchip:active {
  transform: scale(0.94);
}
/* Active = the one solid object among the glass: brand gradient + a soft bloom.
   The gradient lives on ::after so it can FADE in/out (gradients can't
   transition); content stays above it. */
.workspace-quickchip::after {
  content: "";
  position: absolute;
  inset: -0.5px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #a855f7));
  opacity: 0;
  transition: opacity 0.22s ease;
}
.workspace-quickchip > * {
  position: relative;
  z-index: 1;
}
.workspace-quickchip.active {
  border-color: transparent;
  color: var(--accent-contrast);
  box-shadow:
    var(--glass-capsule-shadow-sm),
    0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}
.workspace-quickchip.active::after {
  opacity: 1;
}
.workspace-quickchip.portal-action {
  border-color: color-mix(in srgb, #f59e0b 48%, var(--glass-capsule-border));
  background: color-mix(in srgb, #f59e0b 14%, var(--glass-capsule-bg));
  color: color-mix(in srgb, #f59e0b 78%, var(--text-primary));
}
.workspace-quickchip.portal-action::after {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}
.workspace-quickchip.portal-action.active { color: #1f1300; }
.workspace-quickchip.portal-history { border-color: color-mix(in srgb, var(--accent, #6d5dfc) 32%, transparent); }
.workspace-quickchip-count {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-soft);
}
.workspace-quickchip.active .workspace-quickchip-count {
  color: color-mix(in srgb, var(--accent-contrast) 82%, transparent);
}
/* The ×'s only job is signalling "tap to clear" on an anchored chip. */
.workspace-quickchip-x {
  font-size: 0.82rem;
  line-height: 1;
  opacity: 0.9;
  margin-left: 1px;
}

/* Portal request history: the durable companion to the pending-only amber
   Guest actions queue. One responsive surface is shared by desktop and phone. */
.portal-history-overlay {
  position: fixed; inset: 0; z-index: 10050; display: grid; place-items: center;
  padding: 24px; background: rgba(4, 5, 9, .78);
}
.portal-history-dialog {
  width: min(920px, 100%); max-height: min(820px, calc(100dvh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--border-subtle); border-radius: 20px;
  background: var(--bg-elevated); color: var(--text-primary); box-shadow: var(--sp3-shadow-lg);
}
.portal-history-head { display: flex; justify-content: space-between; gap: 18px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border-subtle); }
.portal-history-title-wrap { display: flex; gap: 12px; min-width: 0; }
.portal-history-icon { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated)); color: var(--accent); }
.portal-history-title-wrap h2 { margin: 0; font-size: 19px; }
.portal-history-title-wrap p { margin: 3px 0 0; color: var(--text-muted); font-size: 13px; }
.portal-history-close { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 1px solid var(--border-subtle); border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.portal-history-controls { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 12px; padding: 16px 22px 12px; }
.portal-history-controls label { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.portal-history-controls label > span { color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.portal-history-controls select, .portal-history-controls input { min-width: 0; height: 39px; border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0 11px; background: var(--bg-input); color: inherit; font: inherit; font-size: 13px; }
.portal-history-date { display: grid; grid-template-columns: 38px 1fr 38px; gap: 7px; align-items: end; }
.portal-history-date > button { height: 39px; display: grid; place-items: center; border: 1px solid var(--border-subtle); border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.portal-history-summary { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 2px 22px 14px; font-size: 12px; color: var(--text-muted); }
.portal-history-summary strong { color: inherit; margin-right: 2px; }
.portal-history-summary span { padding: 4px 8px; border-radius: 999px; background: var(--surface-muted); }
.portal-history-summary span.is-pending { background: color-mix(in srgb, var(--state-warning) 14%, var(--bg-elevated)); color: var(--state-warning); }
.portal-history-body { overflow: auto; padding: 0 14px 16px; }
.portal-history-row { width: 100%; display: grid; grid-template-columns: minmax(0,1fr) minmax(210px,.55fr); gap: 18px; padding: 14px 10px; border: 0; border-top: 1px solid var(--border-subtle); background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.portal-history-row:hover { background: var(--table-row-hover); }
.portal-history-row:disabled { cursor: default; opacity: .8; }
.portal-history-row-main { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.portal-history-row-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.portal-history-row-top strong { font-size: 14px; }
.portal-history-row-top em { padding: 3px 7px; border-radius: 999px; background: var(--surface-muted); font-size: 10px; font-style: normal; font-weight: 800; text-transform: uppercase; letter-spacing: .035em; }
.portal-history-row-top em.is-needs-review { background: color-mix(in srgb, var(--state-warning) 14%, var(--bg-elevated)); color: var(--state-warning); }
.portal-history-row-top em.is-paid, .portal-history-row-top em.is-approved { background: color-mix(in srgb, var(--state-success) 13%, var(--bg-elevated)); color: var(--state-success); }
.portal-history-row-top em.is-declined, .portal-history-row-top em.is-refunded { background: color-mix(in srgb, var(--state-error) 12%, var(--bg-elevated)); color: var(--state-error); }
.portal-history-item { font-size: 13.5px; font-weight: 650; }
.portal-history-property, .portal-history-note { color: var(--text-muted); font-size: 12px; }
.portal-history-owner { width: fit-content; margin-top: 3px; padding: 3px 7px; border-radius: 7px; background: color-mix(in srgb, var(--state-success) 11%, var(--bg-elevated)); color: var(--state-success); font-size: 11px; font-weight: 750; }
.portal-history-owner.is-unclaimed { background: color-mix(in srgb, var(--state-warning) 14%, var(--bg-elevated)); color: var(--state-warning); }
.portal-history-note { margin-top: 3px; }
.portal-history-audit { display: flex; flex-direction: column; gap: 7px; color: var(--text-muted); font-size: 11px; }
.portal-history-audit > span { display: flex; flex-direction: column; gap: 1px; }
.portal-history-audit small { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .72; }
.portal-history-empty { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--text-muted); font-size: 13px; text-align: center; }
.portal-history-empty strong { color: var(--text-primary); font-size: 15px; }
.portal-history-empty.is-error { color: var(--state-error); }
.portal-history-empty > button { margin-top: 8px; min-height: 36px; padding: 0 13px; border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--bg-input); color: var(--text-primary); font: inherit; font-weight: 700; cursor: pointer; }
.portal-history-close:focus-visible,
.portal-history-date > button:focus-visible,
.portal-history-controls select:focus-visible,
.portal-history-controls input:focus-visible,
.portal-history-row:focus-visible,
.portal-history-empty > button:focus-visible { outline: none; box-shadow: var(--sp3-ring); }

@media (max-width: 680px) {
  .portal-history-overlay { padding: 0; place-items: stretch; }
  .portal-history-dialog { width: 100%; max-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; }
  .portal-history-head { padding: max(16px, env(safe-area-inset-top)) 16px 13px; }
  .portal-history-title-wrap p { max-width: 260px; }
  .portal-history-controls { grid-template-columns: 1fr 1fr; padding: 13px 16px 10px; }
  .portal-history-date { grid-column: 1 / -1; }
  .portal-history-summary { padding: 2px 16px 12px; }
  .portal-history-body { padding: 0 8px max(20px, env(safe-area-inset-bottom)); }
  .portal-history-row { grid-template-columns: 1fr; gap: 9px; padding: 14px 9px; }
  .portal-history-audit { display: grid; grid-template-columns: 1fr 1fr; }
}
/* "Lens edge" — a thin, masked gradient ring. This used to sample the backdrop
   a second time; paired with the sticky parent and row hover paints, that was
   the most expensive compositor path in the pane. Keep this decorative only. */
.inbox-glasshead .workspace-list-toolbar {
  position: relative;
  /* 🔴 STACKING, not just decoration. The "+" and filter dropdowns render INSIDE
     this positioned capsule, so `.workspace-filter-menu`'s own z-index (120) is
     trapped inside the head's stacking order and cannot rise above anything
     outside it. The chip row below is LATER in DOM order and the chips' entrance
     transforms create their own stacking contexts, so they painted straight over
     an open menu (Hakim 2026-07-27:
     the "New contact" menu came up behind the "Group threads" and "DMs" chips).
     Ordering the head's two rows explicitly is the only fix that works —
     raising the menu's z-index cannot escape its parent's stacking context. */
  z-index: 2;
}
.inbox-glasshead .workspace-quickchips {
  position: relative;
  z-index: 1;
}
.inbox-glasshead .workspace-list-toolbar::before,
.workspace-quickchip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2.5px;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--text-primary) 18%, transparent),
    transparent 42%,
    color-mix(in srgb, var(--text-primary) 7%, transparent)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.workspace-quickchip-type-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 2.6rem;
  left: auto;
  z-index: 140;
  min-width: 150px;
  max-height: 260px;
  overflow-y: auto;
  display: grid;
  gap: 0.15rem;
  padding: 0.35rem;
  border-radius: 14px;
  background: var(--glass-menu-bg);
  border: 0.5px solid var(--glass-capsule-border);
  box-shadow: var(--glass-capsule-shadow), var(--glass-capsule-rim);
  animation: glasshead-pop 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes glasshead-rise {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
}
@keyframes glasshead-pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-quickchip,
  .inbox-glasshead .workspace-filter-menu,
  .workspace-quickchip-type-menu {
    animation: none;
  }
}

.workspace-filter-option {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.76rem;
  padding: 0.3rem 0.45rem;
  text-align: left;
}

.workspace-filter-option:hover,
.workspace-filter-option:focus-visible {
  border-color: color-mix(in srgb, var(--ring) 25%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary-gradient-soft) 34%, var(--bg-input));
}

.workspace-filter-option.parent {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
}

.workspace-filter-option.active {
  border-color: color-mix(in srgb, var(--ring) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary-gradient-soft) 45%, var(--bg-input));
}

/* A tag in the ⚡ filter menu. Clicking the name filters the list by that tag;
   the × deletes the tag itself — from the catalog and off every listing wearing
   it. Deleting is the smaller, quieter target on purpose: it is the rarer and
   far more destructive of the two, and it is NOT the same act as removing a tag
   from the one listing you happen to be looking at (that × lives on the chip). */
.workspace-filter-tag-row {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.workspace-filter-tag-row .workspace-filter-option {
  flex: 1 1 auto;
  min-width: 0;
}

.workspace-filter-tag-delete {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.workspace-filter-tag-delete:hover,
.workspace-filter-tag-delete:focus-visible {
  border-color: color-mix(in srgb, var(--state-danger) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-danger) 14%, var(--bg-input));
  color: var(--state-danger);
}

/* The in-place rename editor takes the width the tag name had, so the row does
   not jump when you switch between reading and editing it. */
.workspace-filter-tag-input {
  flex: 1 1 auto;
  min-width: 0;
}

.workspace-filter-tag-error {
  color: var(--state-danger);
  white-space: normal;
}

.workspace-filter-submenu .properties-tag-picker-search {
  margin-bottom: 0.12rem;
}

.workspace-filter-submenu .workspace-filter-option {
  font-size: 0.74rem;
  padding: 0.28rem 0.4rem;
}

.quick-filter-tag-create {
  margin-top: 0.12rem;
}

.workspace-filter-reset:hover,
.workspace-filter-reset:focus-visible {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border-subtle));
  background: color-mix(in srgb, #f59e0b 16%, var(--bg-input));
}

/* Hairline between the filter facets and the bulk actions in the pane-2 filter
   menu. Token-driven so light/dark both inherit the right subtle border. */
.workspace-filter-divider {
  height: 1px;
  margin: 0.15rem 0.1rem;
  background: var(--border-subtle);
}

/* A bulk action with nothing to act on stays visible (discoverable) but calm:
   muted text, no hover chrome. */
.workspace-filter-option:disabled {
  color: var(--text-muted);
  cursor: default;
}
.workspace-filter-option:disabled:hover,
.workspace-filter-option:disabled:focus-visible {
  border-color: transparent;
  background: transparent;
}

.workspace-list-item {
  display: grid;
  gap: 0;
  position: relative;
  padding-top: 0.2rem;
}

.workspace-segment-banner {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 0.08rem 0.5rem 0.12rem 0.45rem;
  border-radius: 10px 0 8px 0;
  border: 1px solid var(--border-subtle);
  border-bottom: 0;
  background: var(--table-surface);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.workspace-segment-banner.segment-owner,
.workspace-segment-banner.segment-owners {
  border-color: color-mix(in srgb, #0ea5e9 55%, var(--border-subtle));
  /* token-anchored (hue 60% + --text-primary 40%) so it reads in BOTH modes — the
     old pale #7dd3fc-dominant mix failed light-mode contrast (~2.75:1). */
  color: color-mix(in srgb, #0284c7 60%, var(--text-primary));
}

.workspace-segment-banner.segment-contractor,
.workspace-segment-banner.segment-contractors,
.workspace-segment-banner.segment-cleaner,
.workspace-segment-banner.segment-cleaners {
  border-color: color-mix(in srgb, #a78bfa 55%, var(--border-subtle));
  color: color-mix(in srgb, #7c3aed 60%, var(--text-primary));
}

.workspace-list-card {
  display: grid;
  /* minmax(0,1fr) so the body column can shrink below its content's min-content —
     without this the inbox card grows to the longest preview/word and clips past
     the pane (the clamp ellipsis falls off-screen). */
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 0.58rem;
  padding: 0.46rem;
  position: relative;
  min-width: 0;
  text-align: left;
  border: 1px solid var(--border-subtle);
  background: var(--table-surface);
  border-radius: 10px;
  overflow: visible;
}

/* Contact-segment LEFT STRIPE — a 3px colour rail keyed to --seg-color (set inline
   per card). Present ONLY on non-guest cards (.has-segment); guests stay clean.
   A pseudo-element (not box-shadow) so it never fights the unread/active/selected
   box-shadows on the same card, and it matches the card's rounded left corners. */
.workspace-list-card.has-segment::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 10px 0 0 10px;
  background: var(--seg-color, transparent);
  pointer-events: none;
  z-index: 1;
}

/* Explicit segment CHIP (Owner / Contractor / Cleaner / custom) — sits in the
   card's top-right signals row next to (or instead of) the status pill. Colour
   rides the same --seg-color and mixes toward --text-primary so it reads in
   light AND dark (CLAUDE.md #5). */
.workspace-segment-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.5;
  padding: 0.02rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
  color: color-mix(in srgb, var(--seg-color, var(--text-soft)) 64%, var(--text-primary));
  border: 1px solid color-mix(in srgb, var(--seg-color, var(--text-soft)) 42%, transparent);
  background: color-mix(in srgb, var(--seg-color, var(--text-soft)) 15%, var(--table-surface));
}

/* Base body column (the inbox/conversation card uses this; the --property variant
   sets its own). min-width:0 lets the line-clamped title/subtitle truncate INSIDE
   the pane instead of pushing the card wider. */
.workspace-list-body {
  min-width: 0;
}

.workspace-list-card.is-selected {
  box-shadow: 0 0 0 1px color-mix(in srgb, #3b82f6 36%, transparent) inset;
  border-color: color-mix(in srgb, #3b82f6 60%, var(--border-subtle));
}

.workspace-select-chip {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
}

.workspace-list-card--property.selection-mode .workspace-select-chip {
  position: static;
  justify-self: center;
  align-self: center;
  margin: 0;
}

.workspace-select-chip.checked {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 70%, var(--bg-input));
  color: #f8fafc;
}

/* Unread vs selected are now ORTHOGONAL (Hakim 2026-06-14: the two borders looked
   identical, so you couldn't tell if the open thread was unread). UNREAD = a dot
   (rendered in the card's signals) + a bold title — NOT a coloured border, which
   was indistinguishable from selected. Keep the card itself neutral here. */
.workspace-list-card.is-unread {
  border-color: var(--border-subtle);
  /* A LEFT accent bar + a faint fill so unread rows scan instantly down the left
     edge — not only by the top-right dot/bold (Hakim 2026-06-14: those alone were
     hard to spot quickly). Selected (.is-active, defined AFTER) overrides the bar +
     fill with its stronger ring/fill on a selected+unread row; the dot + bold title
     still carry "unread" there. */
  box-shadow: inset 3px 0 0 0 color-mix(in srgb, #6366f1 85%, transparent);
  background: color-mix(in srgb, #6366f1 10%, var(--table-surface));
}

/* SELECTED = a clearly FILLED row + an accent ring. `.is-active` sits AFTER
   `.is-unread` in source order, so on a selected-and-unread card it wins the fill
   + ring while unread still contributes its dot + bold title — both read at once. */
.workspace-list-card.is-active {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border-subtle));
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 52%, transparent) inset;
  background: color-mix(in srgb, var(--accent) 14%, var(--table-surface));
}

.workspace-list-body {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding-right: 2px;
  padding-bottom: 2px;
  min-width: 0;
}

.workspace-list-card.has-tags .workspace-list-body {
  padding-bottom: 7px;
}

/* Inbox tags row (incl. the auto "Repeat guest"): the base margin-top was 0.03rem
   — basically zero — so it jammed up against the dates row. Give it real breathing
   room above and balance it against the body's bottom padding so it sits evenly at
   the bottom of the card rather than crammed under the meta row. Scoped to
   .workspace-list-item so property cards keep their own tags layout. */
.workspace-list-item .workspace-list-tags {
  margin-top: 0.34rem;
  margin-bottom: 0;
}

.workspace-list-row-top {
  display: block;
  min-width: 0;
}

.workspace-list-card--contact .workspace-list-row-top {
  display:flex;
  align-items:center;
  gap:0.4rem;
}
.workspace-list-card--contact .workspace-list-title {
  flex:0 1 auto;
  min-width:0;
  padding-right:0;
}
.workspace-list-card--contact .contact-type-marker {
  max-width:min(112px, 38%);
}
.workspace-list-card--contact .workspace-list-top-signals {
  position:static;
  margin-left:auto;
  flex:0 0 auto;
}

/* Pane-2 "Owners" mode row (PropertiesListPane) — icon inline beside the
   owner name, base on RegistryListRow's card. .ui-icon defaults to 18px,
   already clearing the >=16px inline-icon floor. */
.workspace-list-card--owner .workspace-list-row-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Owner rows reuse the canonical property card verbatim (workspace-list-card +
   avatar-wrap + workspace-list-body) — no owner-specific card styling. */

.workspace-list-card--owner .workspace-list-subtitle {
  margin-top: 0.15rem;
}

.workspace-list-card--owner .workspace-list-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The expand arrow on EVERY Owners-view row, left of the name. One fixed slot
   per card — an arrow when the group has live listings, an `is-empty` spacer
   when it has none — so every owner name shares the same left edge whether or
   not it can expand. Borderless muted caret, brightening on hover (the
   fin-ledger-caret-btn idiom); theme tokens only, works in light + dark. */
.workspace-owner-expand {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.workspace-owner-expand:hover,
.workspace-owner-expand:focus-visible {
  color: var(--text-primary);
  background: var(--bg-input);
}
.workspace-owner-expand.is-empty {
  cursor: default;
  pointer-events: none;
}
/* .ui-icon ships 18px; 16px keeps a breath of air inside the 20px slot while
   staying on the ≥16px inline-icon floor. */
.workspace-owner-expand .ui-icon {
  width: 16px;
  height: 16px;
}

/* "Owners" view — inactive pill (owners with no active property). */
.workspace-list-owner-pill {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 16%, transparent);
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
}

/* "Owners" view — count + include-inactive filter toolbar above the roster. */
.workspace-list-owner-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.1rem 0.35rem 0.4rem;
}

.workspace-list-owner-toolbar-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.workspace-list-owner-toggle {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.workspace-list-owner-toggle:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.workspace-list-owner-toggle.is-on {
  color: var(--ring);
}

/* Owners mode: the ⚡ quick-filter menu shows only the owner filter (Show
   inactive owners), hiding the listing presets. All other toolbar controls stay
   visible and are wired to owner-appropriate behaviour (identical to listings). */
.quick-filter-menu--owners > *:not(.quick-filter-item--owner) {
  display: none;
}

/* View switcher (Listings / Owners) — inline icons beside the mode label. */
.workspace-properties-mode-trigger-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.workspace-properties-mode-trigger-label > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-properties-mode-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.workspace-properties-mode-copy {
  display: grid;
  min-width: 0;
  gap: 0.05rem;
}

.workspace-properties-mode-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-properties-mode-copy > small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-properties-mode-picker .ui-icon.workspace-properties-mode-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  opacity: 0.85;
}

/* Properties calendar — Streams lens. Pane 2 is a selector, while pane 3 keeps
   the existing property resource grid and filters its task layer. These rows
   deliberately use task Stream colour tokens rather than raw palette values. */
.workspace-calendar-stream-list {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

.workspace-calendar-stream-group {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.workspace-calendar-stream-group > h3 {
  margin: 0;
  padding: 0.08rem 0.38rem;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-calendar-stream-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.58rem;
  padding: 0.58rem 0.62rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--table-surface);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace-calendar-stream-row:hover,
.workspace-calendar-stream-row:focus-visible {
  border-color: color-mix(in srgb, var(--ring) 44%, var(--border-subtle));
  background: color-mix(in srgb, var(--ring) 8%, var(--table-surface));
}

.workspace-calendar-stream-row.is-active {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border-subtle));
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 48%, transparent)
    inset;
  background: color-mix(in srgb, var(--accent) 13%, var(--table-surface));
}

.workspace-calendar-stream-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 10%, transparent);
}

.workspace-calendar-stream-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.workspace-calendar-stream-copy strong,
.workspace-calendar-stream-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-calendar-stream-copy strong {
  font-size: 0.78rem;
  font-weight: 700;
}

.workspace-calendar-stream-copy small {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.workspace-calendar-stream-private.ui-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* ── Owner detail — pane content for /properties?owner=<contactId> ───────── */
.owner-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  padding: 1rem 1.1rem 2rem;
  gap: 1rem;
}

.owner-detail-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.owner-detail-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ring) 14%, transparent);
  color: var(--ring);
}

.owner-detail-avatar .ui-icon.owner-detail-avatar-icon {
  width: 24px;
  height: 24px;
}

.owner-detail-headings {
  min-width: 0;
}

.owner-detail-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-detail-subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.owner-detail-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.1rem;
}

.owner-detail-tab {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.owner-detail-tab:hover {
  color: var(--text-primary);
}

.owner-detail-tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--ring);
}

.owner-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  max-width: 720px;
}

.workspace-list-top-signals {
  position: absolute;
  top: 3px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  flex: 0 0 auto;
  z-index: 1;
}

.workspace-list-platform-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-list-actions {
  display: inline-flex;
  gap: 0.2rem;
  position: absolute;
  left: 8px;
  bottom: 6px;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(2px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

/* Quick actions reveal on HOVER/FOCUS only — being the SELECTED conversation
   does NOT pin them open (Hakim, 2026-06-10: "the hover menu is persisting on
   conversations that I have selected"). `.has-active` still shows active
   states (e.g. a filled star) so starred threads keep their indicator. */
.workspace-list-card:hover .workspace-list-actions,
.workspace-list-card:focus-within .workspace-list-actions,
.workspace-list-actions.has-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.workspace-list-actions-menu {
  left: auto;
  right: 8px;
  top: 8px;
  bottom: auto;
  z-index: 80;
  transform: none;
}

.workspace-list-card:hover .workspace-list-actions-menu,
.workspace-list-card:focus-within .workspace-list-actions-menu,
.workspace-list-actions-menu.has-active {
  transform: none;
}

.workspace-list-item.is-menu-open {
  isolation: isolate;
  z-index: 1000;
}

.workspace-list-item.is-menu-open .workspace-list-card {
  z-index: 1000;
}

.workspace-row-menu-trigger {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border-color: color-mix(in srgb, var(--nav-border-accent) 55%, var(--border-subtle));
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.workspace-row-menu-trigger:hover,
.workspace-row-menu-trigger:focus-visible,
.workspace-row-menu-trigger.active {
  border-color: color-mix(in srgb, var(--nav-border-accent) 85%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-elevated) 84%, var(--nav-border-accent));
  color: var(--text-primary);
}
.workspace-contact-sort-note {
  display: block;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.25;
  padding: 0.25rem 0.75rem 0.1rem;
}

/* "Possible duplicates" review surface (contacts pane + contact drawer).
   Shares the pane's design language: token colors only (light/dark parity). */
.dup-review {
  display: grid;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem 0.45rem;
}

.dup-review--drawer {
  padding: 0;
}

.dup-review-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}

.dup-review-pill:hover {
  border-color: var(--border-strong, var(--border-subtle));
}

.dup-review-pill-toggle {
  color: var(--accent, var(--text-soft));
  font-weight: 700;
}

.dup-review-card {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 0.5rem 0.65rem 0.55rem;
}

.dup-review-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.dup-review-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dup-review-card-count {
  font-size: 0.72rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.dup-review-evidence {
  font-size: 0.72rem;
  color: var(--text-primary);
}

.dup-review-members {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dup-review-member {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.dup-review-member-open {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.dup-review-member-open:hover {
  text-decoration: underline;
}

.dup-review-member-meta {
  font-size: 0.7rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dup-review-error {
  font-size: 0.72rem;
  color: var(--danger, #b42318);
}

.dup-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.dup-review-btn {
  font-size: 0.74rem;
  padding: 0.32rem 0.6rem;
}

.workspace-row-menu-dots {
  display: block;
  margin-top: -0.26rem;
  font-size: 1rem;
  font-weight: 850;
  letter-spacing: -0.08em;
  line-height: 1;
}

.workspace-thread-menu {
  position: fixed;
  top: var(--thread-menu-top, 0);
  left: var(--thread-menu-left, 0);
  display: grid;
  min-width: 188px;
  gap: 0.12rem;
  padding: 0.3rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  pointer-events: auto;
  z-index: 10000;
}

.workspace-thread-menu button,
.workspace-thread-menu input {
  font: inherit;
}

.workspace-thread-menu button {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 0.42rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.1;
  text-align: left;
  padding: 0.42rem 0.5rem;
  cursor: pointer;
}

.workspace-thread-menu button:hover,
.workspace-thread-menu button:focus-visible {
  background: var(--surface-muted);
  outline: none;
}

.workspace-thread-menu button:disabled {
  cursor: not-allowed;
  color: var(--text-soft);
  opacity: 0.6;
}

.workspace-thread-menu-icon {
  width: 16px;
  height: 16px;
  color: color-mix(in srgb, var(--nav-border-accent) 82%, var(--text-primary));
}

.workspace-thread-menu-feedback {
  margin-top: 0.12rem;
  border-radius: 8px;
  padding: 0.36rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
}

.workspace-thread-menu-feedback.tone-success {
  background: color-mix(in srgb, #22c55e 14%, var(--bg-elevated));
  color: color-mix(in srgb, #22c55e 70%, var(--text-primary));
}

.workspace-thread-menu-feedback.tone-error {
  background: color-mix(in srgb, #ef4444 14%, var(--bg-elevated));
  color: color-mix(in srgb, #ef4444 76%, var(--text-primary));
}

.workspace-thread-menu-rename {
  display: grid;
  gap: 0.28rem;
  min-width: 220px;
}

.workspace-thread-menu-rename input {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 0.42rem 0.5rem;
}

/* Item 4 — Save/Cancel row under the inline thread-title rename input. The
   base `.workspace-thread-menu button` selector is a 2-col grid (for icon+label
   menu items); reset to inline-flex here so the two compact buttons sit side by
   side. Tokens via the shared `.btn` classes — identical light + dark. */
.workspace-thread-menu-rename-actions {
  display: flex;
  gap: 0.3rem;
}

.workspace-thread-menu-rename-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  padding: 0.32rem 0.5rem;
  font-size: 0.74rem;
}

/* Restate the DS button tokens at matching specificity — the shared
   `.workspace-thread-menu button` rule (used for icon+label menu items) would
   otherwise flatten these. */
.workspace-thread-menu-rename-actions .btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.workspace-thread-menu-rename-actions .btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
}

.workspace-list-actions.has-active .workspace-inline-icon:not(.active) {
  display: none;
}

.workspace-list-card:hover .workspace-list-actions.has-active .workspace-inline-icon,
.workspace-list-card:focus-within .workspace-list-actions.has-active .workspace-inline-icon {
  display: inline-flex;
}

/* The hover-menu (tag / star / archive / …) is always anchored to the
   card's bottom-right corner — independent of whether the card content
   is top-aligned (config tab) or vertically centred (calendar tab). The
   `!important`s defeat the `.workspace-list-actions` base rule (which
   wants left:8px / bottom:6px) without rewriting the entire selector. */
.workspace-list-card--property .workspace-list-actions.workspace-list-property-actions {
  position: absolute !important;
  right: 0.4rem !important;
  bottom: 0.32rem !important;
  left: auto !important;
  top: auto !important;
  justify-content: flex-end;
  transform: none;
  z-index: 2;
}
/* The Active / Inactive listing pill is always anchored to the card's
   top-right corner, regardless of how the rest of the card content is
   laid out. We force the pill's positioning context up to the card
   itself (which has `position: relative`) by neutralising the body's
   `position: relative` for property cards — without this, the pill
   anchors to the body and gets pushed *down* onto the title row,
   visibly obscuring the listing nickname in comfortable mode. */
.workspace-list-card--property .workspace-list-body {
  position: static;
}
.workspace-list-card--property .workspace-list-property-pill {
  position: absolute;
  top: 0.42rem;
  right: 0.42rem;
  z-index: 3;
}
.workspace-list-card--property .workspace-list-row-top {
  padding-right: 4.2rem;
}
/* Property card body fills the card vertically (`align-self: stretch`)
   so its absolute children — the Active pill (top-right) and the
   action tray (bottom-right) — anchor to the body's box, which now
   spans the full card. With the body's grid set to
   `align-content: center`, short content sits visually centred in
   the middle of taller cards (calendar tab forces a uniform
   tallest-card height); when content is naturally tall, the rows
   pack from the centre outward without overflowing the card.

   We deliberately do NOT add `padding-bottom` here. Earlier I tried
   reserving ~1.55rem for the absolute action tray, but that padding
   inflates the body's natural height, which the calendar tab then
   measures as the new "tallest card" — so every card gets stretched
   another 25 px taller than the tallest natural card. The action
   tray's absolute positioning means it never participates in flow,
   so no padding reservation is needed in the first place. */
.workspace-list-card--property .workspace-list-body {
  align-self: stretch;
  align-content: center;
}

.workspace-list-card--property.is-stack-release {
  animation: workspacePropertyStackRelease 240ms ease;
}

@keyframes workspacePropertyStackRelease {
  from {
    transform: translateY(-16px);
  }
  to {
    transform: translateY(0);
  }
}

.workspace-inline-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.workspace-list-actions-menu .workspace-row-menu-trigger {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  border-color: color-mix(in srgb, var(--nav-border-accent) 55%, var(--border-subtle));
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.workspace-list-actions-menu .workspace-row-menu-trigger:hover,
.workspace-list-actions-menu .workspace-row-menu-trigger:focus-visible,
.workspace-list-actions-menu .workspace-row-menu-trigger.active {
  border-color: color-mix(in srgb, var(--nav-border-accent) 85%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-elevated) 84%, var(--nav-border-accent));
  color: var(--text-primary);
}

.workspace-inline-icon.active {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--nav-border-accent) 65%, var(--border-subtle));
  background: var(--primary-gradient-soft);
}

.workspace-inline-icon-unread.active {
  color: #f8fafc;
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 75%, var(--bg-input));
}

.workspace-inline-icon-archive {
  border-color: color-mix(in srgb, #f59e0b 55%, var(--border-subtle));
  color: color-mix(in srgb, #fbbf24 80%, var(--text-primary));
}

.workspace-inline-icon-archive:hover,
.workspace-inline-icon-archive:focus-visible {
  border-color: color-mix(in srgb, #f97316 58%, var(--border-subtle));
  color: #fed7aa;
  background: color-mix(in srgb, #f97316 22%, var(--bg-input));
}

.workspace-status-pill,
.workspace-age-pill {
  font-size: 0.68rem;
  color: var(--text-soft);
}

.workspace-age-pill {
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.workspace-age-pill-bottom {
  position: absolute;
  right: 8px;
  bottom: 4px;
  font-weight: 600;
}

.workspace-status-pill {
  /* Figma (Core-Lite list rows): status is a plain coloured TEXT label — no
     pill background, no border, no dot. Hue mixed toward --text-primary so it
     reads in light AND dark (the old translucent pill background was what
     looked washed-out in light mode — Hakim, 2026-06-10). */
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  max-width: 100%;
  color: color-mix(in srgb, var(--text-soft) 80%, var(--text-primary));
}

.workspace-status-pill.tone-positive {
  color: color-mix(in srgb, #16a34a 68%, var(--text-primary));
}

.workspace-status-pill.tone-pending {
  color: color-mix(in srgb, #d97706 72%, var(--text-primary));
}

.workspace-status-pill.tone-negative {
  color: color-mix(in srgb, #dc2626 68%, var(--text-primary));
}

.workspace-status-pill.tone-neutral {
  color: color-mix(in srgb, var(--text-soft) 80%, var(--text-primary));
}

/* Last-message direction arrow on the list preview (incoming vs outgoing). The
   reply-curve glyph points left for received; mirrored (scaleX) for sent. Subtle
   colour so it reads as a hint, not a badge — readable in light + dark. */
.workspace-msg-dir {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 0.3em;
  vertical-align: -2px;
}
.workspace-msg-dir svg {
  width: 12px;
  height: 12px;
}
.workspace-msg-dir.is-in {
  color: color-mix(in srgb, var(--text-soft) 68%, var(--text-primary));
}
.workspace-msg-dir.is-out {
  color: color-mix(in srgb, #2563eb 58%, var(--text-primary));
  transform: scaleX(-1);
}

/* Inbox card top row → responsive flex: the title truncates and the status pill
   reserves exactly its own width at ANY pane size (no absolute-overlap clipping on
   narrow/mobile widths). Scoped to .workspace-list-item so property cards — which
   are NOT wrapped in that element — keep their own absolute-pill layout. */
.workspace-list-item .workspace-list-row-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.workspace-list-item .workspace-list-title {
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 0;
  /* Read rows sit at a calmer weight so UNREAD rows (bolded below) clearly pop —
     the inbox's primary scannability signal, mirroring the reference inbox. */
  font-weight: 600;
}
.workspace-list-item .workspace-list-top-signals {
  position: static;
  top: auto;
  right: auto;
  flex: 0 0 auto;
}
/* Unread emphasis: bold name + a stronger preview, so unread threads jump out
   (was only a faint border — too weak to scan). */
.workspace-list-item .workspace-list-card.is-unread .workspace-list-title {
  font-weight: 800;
}
.workspace-list-item .workspace-list-card.is-unread .workspace-list-subtitle {
  color: color-mix(in srgb, var(--text-primary) 92%, transparent);
  font-weight: 600;
}

.workspace-list-contact {
  margin: 0.02rem 0 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text-muted) 88%, transparent);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-list-item .workspace-list-card.is-pinned {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--nav-border-accent) 76%, transparent);
}

.workspace-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  align-self: center;
  background: linear-gradient(135deg, #22d3ee, #6366f1);
  box-shadow: 0 0 0 3px color-mix(in srgb, #6366f1 22%, transparent);
}

.workspace-pin-dot {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 0.36rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--nav-border-accent) 70%, var(--border-subtle));
  color: var(--text-primary);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--nav-border-accent) 24%, var(--bg-elevated));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, white 8%, transparent);
}

.workspace-platform-badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  color: var(--text-soft);
}

.workspace-platform-row {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.workspace-platform-logo {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.56rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

.workspace-platform-fallback {
  font-size: 0.64rem;
  color: var(--text-soft);
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-logo-image {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: block;
}

/* .corelite-mark* (legacy <img> mark + "CL" text fallback) removed 2026-07-11 —
   collapsed rail now renders <Wordmark markOnly /> (self-contained gradient chip). */

.workspace-platform-badge.platform-airbnb {
  border-color: rgba(255, 90, 95, 0.55);
  color: #ff8a8f;
}

.workspace-platform-badge.platform-booking-com {
  border-color: rgba(0, 113, 194, 0.55);
  color: #6db7ff;
}

.workspace-platform-badge.platform-vrbo {
  border-color: rgba(37, 64, 143, 0.55);
  color: #8ca7ff;
}

.workspace-platform-logo.platform-airbnb {
  border-color: rgba(255, 90, 95, 0.55);
  color: #ff8a8f;
}

.workspace-platform-logo.platform-booking-com {
  border-color: rgba(0, 113, 194, 0.55);
  color: #6db7ff;
}

.workspace-platform-logo.platform-vrbo {
  border-color: rgba(37, 64, 143, 0.55);
  color: #8ca7ff;
}

.workspace-platform-logo.platform-whatsapp {
  border-color: rgba(37, 211, 102, 0.55);
  color: #7ae9ad;
}

.workspace-platform-logo.platform-stays {
  border-color: rgba(93, 168, 61, 0.65);
}

/* Email + SMS use inline SVG (currentColor) so we paint them the
   same way platform brand logos are painted — a soft-tinted square
   with a subtle border. The colour palette here matches the brand
   conventions used elsewhere (envelope-blue, message-violet). */
.workspace-platform-logo.platform-email {
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.55);
  background: color-mix(in srgb, #60a5fa 12%, transparent);
}
.workspace-platform-logo.platform-sms {
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.55);
  background: color-mix(in srgb, #c084fc 12%, transparent);
}
/* Call — accent (indigo), matching the Wave-1 Call=accent intent and avoiding a
   clash with WhatsApp's green. Token-based so it tracks light/dark. */
.workspace-platform-logo.platform-call {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
/* UOS — the internal Upgraded-OS channel (master plan §3). Brand indigo (accent),
   matching the design system; the rounded-square "U" glyph keeps it distinct from
   the Call handset that shares the accent. Token-based so it tracks light/dark. */
.workspace-platform-logo.platform-uos {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.workspace-draft-pill {
  display: inline-flex;
  margin-top: 0.14rem;
  font-size: 0.66rem;
  color: color-mix(in srgb, var(--state-warning) 72%, var(--text-primary));
}

.workspace-list-thumb {
  width: 52px;
  height: 52px;
  border-radius: 9px;
  object-fit: cover;
  background: var(--bg-input);
}

.workspace-list-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
}

/* Loading state on a property row — appears immediately on click (optimistic)
   and stays until the editor reports the load is done. Avatar dims slightly
   so the spinner overlay reads as the focal point. */
.workspace-list-loading-spinner {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: inherit;
  background: color-mix(in srgb, var(--bg-deep) 60%, transparent);
  backdrop-filter: blur(2px) saturate(140%);
  -webkit-backdrop-filter: blur(2px) saturate(140%);
  animation: workspace-list-spinner-fade 0.14s ease-out;
}

/* The glyph itself is `.properties-loading-spinner` — the SAME ring the
   property editor shows while a property loads, so the list row and the main
   pane agree. It replaced a hand-rolled three-quarter arc on 2026-07-31: the
   arc's box was centred but a quarter of its ring was missing, so the ink you
   actually see sat low and left of centre and the spinner read as misaligned.
   A complete ring is symmetric, so it looks centred at every frame.
   Sized down here because a property row's thumbnail is 40px wide (32px and
   28px in the calendar variants), not the editor's roomier header. */
.workspace-list-loading-spinner .properties-loading-spinner {
  width: 18px;
  height: 18px;
  border-width: 1.8px;
}

@keyframes workspace-list-spinner-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Subtle row-level cue while loading — gives feedback even if the avatar
   isn't visible (e.g. tight scroll position). */
.workspace-list-card--property.is-loading {
  background: color-mix(in srgb, var(--brand-primary) 4%, var(--bg-elevated));
}

.workspace-list-card--property.is-loading .workspace-list-thumb,
.workspace-list-card--property.is-loading .workspace-list-avatar-fallback {
  filter: brightness(0.72);
  transition: filter 0.14s ease;
}

@media (prefers-reduced-motion: reduce) {
  .workspace-list-loading-spinner .properties-loading-spinner { animation: none; }}

.workspace-list-avatar-platform {
  position: absolute;
  left: -3px;
  bottom: -3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.workspace-platform-logo-mini {
  width: 16px;
  height: 16px;
}

.workspace-list-avatar-fallback {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  object-fit: cover;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--primary-gradient-soft) 55%, var(--bg-input));
}

/* The tone palette is defined ONCE here — .task-avatar joined in Plan 4B
   (2026-07-24) so Tasks assignee/share avatars match the app canon. */
.workspace-list-avatar-fallback.tone-indigo, .task-avatar.tone-indigo { background: color-mix(in srgb, #6366f1 35%, var(--bg-input)); }
.workspace-list-avatar-fallback.tone-cyan, .task-avatar.tone-cyan { background: color-mix(in srgb, #06b6d4 35%, var(--bg-input)); }
.workspace-list-avatar-fallback.tone-emerald, .task-avatar.tone-emerald { background: color-mix(in srgb, #10b981 35%, var(--bg-input)); }
.workspace-list-avatar-fallback.tone-amber, .task-avatar.tone-amber { background: color-mix(in srgb, #f59e0b 35%, var(--bg-input)); }
.workspace-list-avatar-fallback.tone-rose, .task-avatar.tone-rose { background: color-mix(in srgb, #f43f5e 35%, var(--bg-input)); }
.workspace-list-avatar-fallback.tone-violet, .task-avatar.tone-violet { background: color-mix(in srgb, #8b5cf6 35%, var(--bg-input)); }

.workspace-list-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  padding-right: 50px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.workspace-list-subtitle,
.workspace-list-meta {
  margin: 0.08rem 0 0 0;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--text-muted) 88%, var(--text-primary));
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-right: 8px;
  -webkit-line-clamp: 1;
}

.workspace-list-meta-row {
  margin-top: 0;
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  padding-right: 8px;
}

.workspace-list-tags {
  display: flex;
  gap: 0.22rem;
  margin-top: 0.03rem;
  margin-bottom: 0.04rem;
  max-width: calc(100% - 8px);
  overflow: hidden;
  position: relative;
}

.workspace-list-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.02rem 0.28rem;
  font-size: 0.6rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Auto/system tag (e.g. "Repeat guest", id `auto-*`) — a subtle filled tint of its
   own colour so it reads as system-generated (intentional), not a stuck user tag.
   currentColor = the tag's colour set inline on the span. */
.workspace-list-tag.is-auto {
  background: color-mix(in srgb, currentColor 14%, var(--table-surface));
  font-weight: 600;
}

/* "User" type — an app user surfaced as a contact (master plan §2). Indigo accent so it
   reads as a first-class type alongside guest/owner, legible in both light and dark. */
.workspace-list-tag--user {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-weight: 600;
}

.workspace-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 35;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  min-width: 230px;
  max-width: 320px;
  padding: 0.5rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.workspace-toast p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-primary);
}

.workspace-toast button {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.7rem;
  padding: 0.16rem 0.42rem;
}

.workspace-share-toast {
  position: fixed;
  right: 16px;
  bottom: 74px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 250px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 9px 10px 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  border-radius: 12px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  animation: workspace-share-toast-in 180ms ease-out both;
}
.workspace-share-toast p {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-share-toast button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 4px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}
.workspace-share-toast .workspace-share-toast-dismiss {
  width: 32px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
}
@keyframes workspace-share-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-alert-toast {
  position: fixed;
  right: 16px;
  bottom: 74px;
  z-index: 36;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  min-width: 260px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 0.55rem 0.62rem;
  display: grid;
  gap: 0.32rem;
}

.workspace-alert-toast.is-success {
  border-color: color-mix(in srgb, var(--state-success) 45%, var(--border-subtle));
}

.workspace-alert-toast.is-error {
  border-color: color-mix(in srgb, var(--state-error) 45%, var(--border-subtle));
}

.workspace-alert-toast.is-info {
  border-color: color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
}

.workspace-alert-toast strong {
  font-size: 0.75rem;
  color: var(--text-primary);
}

.workspace-alert-toast p {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-soft);
  line-height: 1.35;
}

.workspace-alert-toast-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.workspace-alert-toast-actions button {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.68rem;
  padding: 0.16rem 0.4rem;
}

[data-theme="light"] .workspace-status-pill.status-accepted {
  border-color: color-mix(in srgb, #16a34a 60%, #86efac);
  background: color-mix(in srgb, #dcfce7 92%, #ffffff);
  color: #166534;
}

[data-theme="light"] .workspace-status-pill.status-pending {
  border-color: color-mix(in srgb, #d97706 62%, #fcd34d);
  background: color-mix(in srgb, #fef3c7 92%, #ffffff);
  color: #92400e;
}

[data-theme="light"] .workspace-status-pill.status-cancelled {
  border-color: color-mix(in srgb, #dc2626 58%, #fca5a5);
  background: color-mix(in srgb, #fee2e2 92%, #ffffff);
  color: #991b1b;
}

.workspace-list-listing,
.workspace-list-dates {
  display: inline-flex;
  align-items: center;
  gap: 0.16rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  min-width: 0;
}

.workspace-list-context {
  font-size: 0.74rem;
  color: color-mix(in srgb, var(--text-soft) 90%, var(--text-primary));
}

.workspace-list-listing .ui-icon,
.workspace-list-dates .ui-icon {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

.workspace-list-dates {
  font-variant-numeric: tabular-nums;
}

.workspace-list-listing span,
.workspace-list-dates span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-main-pane {
  display: grid;
  grid-template-rows: 1fr;
  min-width: 0;
}

/* Top-bar tab changes are optimistic: every visible workspace pane moves to the
   requested section in the same render, while Next settles the URL behind it.
   A short compositor-only entrance makes that intentional swap legible without
   slowing it down or turning it into a page-transition spectacle. */
@keyframes workspace-route-enter {
  from {
    opacity: 0.84;
    transform: translateX(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.workspace-shell[data-route-transition="true"] > .workspace-list-pane,
.workspace-shell[data-route-transition="true"] > .workspace-main-pane,
.workspace-shell[data-route-transition="true"] > .workspace-property-nav-pane {
  animation: workspace-route-enter 150ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .workspace-shell[data-route-transition="true"] > .workspace-list-pane,
  .workspace-shell[data-route-transition="true"] > .workspace-main-pane,
  .workspace-shell[data-route-transition="true"] > .workspace-property-nav-pane {
    animation: none;
  }
}

/* Compact master-detail: only when a minimum list plus a useful working pane no
   longer fit. The inactive pane is display:none; the active main pane becomes a
   flex column so the "‹ back" pill sits above the full-height, internally-scrolling
   content instead of squishing a stub of the list on top of it. */
.workspace-main-pane.is-compact-hidden {
  display: none;
}
.workspace-main-pane.is-compact-main {
  display: flex;
  flex-direction: column;
}
.workspace-main-pane.is-compact-main > .workspace-compact-back {
  flex: 0 0 auto;
}
.workspace-main-pane.is-compact-main > :not(.workspace-compact-back) {
  flex: 1 1 auto;
  min-height: 0;
}
.workspace-compact-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  align-self: flex-start;
  margin: 0.5rem 0.5rem 0.4rem;
  padding: 0.4rem 0.75rem 0.4rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--border-subtle) 38%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.workspace-compact-back:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
}
.workspace-compact-back-chevron {
  font-size: 1.15rem;
  line-height: 1;
  margin-top: -1px;
}

.workspace-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow: auto;
  /* Take available width and shrink (scroll) instead of crushing the right cluster. */
  flex: 1 1 auto;
  min-width: 0;
  scrollbar-width: thin;
}

/* Inline rename input — sits where the tab label would be. */
.workspace-tab-rename {
  all: unset;
  box-sizing: border-box;
  min-width: 6ch;
  max-width: 16ch;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  border-radius: 5px;
  padding: 0.1rem 0.34rem;
  cursor: text;
}

.workspace-tab,
.workspace-tab-add {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  /* Never let flex crush a tab: at tablet widths the ACTIVE tab was the one that
     truncated ("Unified I…") while inactive ones kept full labels (iPad 2026-07-20).
     The strip scrolls (overflow:auto above) instead. */
  flex: 0 0 auto;
  padding: 0.22rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 7px;
  /* Inactive tabs are deliberately RECESSED (muted text, no fill, no border) so
     the active tab reads as clearly "you are here" by contrast. */
  color: var(--text-muted);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  min-height: 28px;
  transition: border-color 0.14s, color 0.14s, background 0.14s, box-shadow 0.14s;
}

.workspace-tab:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
}

.workspace-tab-add {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1;
  color: var(--text-muted);
  padding: 0.22rem 0.5rem;
  min-width: 28px;
  justify-content: center;
}

.workspace-tab-add:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--ring) 28%, var(--border-subtle));
}

/* Active tab = "you are here": lifted elevated fill + a crisp accent ring + bold
   text + accent icon. Scoped with .workspace-tabs so it outranks .workspace-tab
   .pinned (which sets its own border-color and comes later in the file). */
.workspace-tabs .workspace-tab.active {
  color: var(--text-primary);
  font-weight: 700;
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px var(--accent),
    0 4px 12px color-mix(in srgb, var(--accent) 20%, transparent);
}

.workspace-tab.active .workspace-tab-label {
  color: var(--text-primary);
}

.workspace-tab-link {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.34rem;
  min-width: 0;
}

.workspace-tab-icon {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.8;
}

.workspace-tab.active .workspace-tab-icon {
  opacity: 1;
  color: var(--accent);
}

.workspace-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 13ch;
}

/* Pin / favourite affordance — quiet until hover or pinned. */
.workspace-tab-pin {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, color 0.12s;
}

.workspace-tab:hover .workspace-tab-pin,
.workspace-tab-pin:focus-visible {
  opacity: 0.6;
}

.workspace-tab-pin:hover {
  opacity: 1;
  color: var(--text-primary);
}

.workspace-tab-star {
  width: 16px;
  height: 16px;
}

/* Pinned (favourite) tab: star always shown + filled in the accent colour, plus
   a subtle accent border so it reads as "sticky". */
.workspace-tab.pinned .workspace-tab-pin {
  opacity: 1;
  color: var(--accent);
}

.workspace-tab.pinned {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
}

/* Drag-to-reorder feedback */
.workspace-tab.dragging {
  opacity: 0.45;
}

.workspace-tab.drag-over {
  box-shadow: inset 2px 0 0 var(--accent);
}

/* Right-click context menu */
.workspace-tab-menu {
  position: fixed;
  z-index: 60;
  min-width: 184px;
  display: flex;
  flex-direction: column;
  padding: 0.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text-primary) 16%, transparent);
}

.workspace-tab-menu button {
  all: unset;
  box-sizing: border-box;
  display: block;
  padding: 0.38rem 0.55rem;
  border-radius: 5px;
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
}

.workspace-tab-menu button:hover:not(:disabled),
.workspace-tab-menu button:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-input));
}

.workspace-tab-menu button:disabled {
  color: var(--text-muted);
  cursor: default;
  opacity: 0.55;
}

/* Keyboard focus ring for tab navigation (Left/Right arrows). */
.workspace-tab-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 6px;
}

/* Overflow "all tabs" menu (shown when the strip overflows). */
.workspace-tab-overflow {
  position: relative;
  flex: none;
}

.workspace-tab-overflow-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  max-height: 60vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 0.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--text-primary) 16%, transparent);
}

.workspace-tab-overflow-menu button {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.5rem;
  border-radius: 5px;
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
}

.workspace-tab-overflow-menu button:hover,
.workspace-tab-overflow-menu button:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-input));
}

.workspace-tab-overflow-menu button.active {
  font-weight: 600;
  color: var(--accent);
}

.workspace-tab-overflow-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Narrow viewports: collapse the right-cluster buttons to icon-only (keep their
   count badges) so the tab strip isn't crushed. Icons keep their aria-labels.
   Breakpoint = the right cluster's full labelled width (~1140px incl. nav rail);
   below it labels either wrapped ("What's new" on two lines) or clipped, so
   they go icon-only instead. */
@media (max-width: 1160px) {
  .workspace-topbar-right .workspace-history-btn span,
  .workspace-channel-notifications-btn > span,
  .workspace-ai-toggle > span,
  .workspace-search-btn .workspace-kbd {
    display: none;
  }
  /* …but keep the "what's new" dot visible when the button is icon-only
     (it's a span, so the rule above would otherwise hide it). */
  .workspace-topbar-right .workspace-whatsnew-btn .workspace-whatsnew-dot {
    display: block;
  }
}

/* Narrow viewports: INACTIVE workspace tabs collapse to icon-only chips (label,
   pin-star + close hide) so the tab strip stays on one row instead of scrolling
   and clipping the leftmost tab into "…perties". The ACTIVE tab keeps a
   (truncated) label so you always know where you are, and the "…" overflow menu
   still lists every tab by name for jumping. Mirrors the right-cluster collapse
   above — one consistent narrow-screen language. Tooltips carry each tab's name. */
@media (max-width: 900px) {
  .workspace-tab:not(.active) .workspace-tab-label,
  .workspace-tab:not(.active) .workspace-tab-pin,
  .workspace-tab:not(.active) .workspace-tab-close {
    display: none;
  }
  .workspace-tab:not(.active) {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
  /* Active tab: keep the label (truncated), drop the pin-star to save width. */
  .workspace-tab.active .workspace-tab-pin {
    display: none;
  }
  .workspace-tab.active .workspace-tab-label {
    max-width: 12ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Touch devices (iPad et al) get the SAME two collapses at ANY width — a tablet
   in landscape (1194px) sat just above both width breakpoints and rendered the
   full desktop top bar: labels everywhere, the active tab clipped, right-edge
   icons pushed off screen (Hakim 2026-07-20). Width stays the desktop signal;
   hover: none is the touch signal. */
@media (hover: none) {
  .workspace-topbar-right .workspace-history-btn span,
  .workspace-channel-notifications-btn > span,
  .workspace-ai-toggle > span {
    display: none;
  }
  .workspace-topbar-right .workspace-whatsnew-btn .workspace-whatsnew-dot {
    display: block;
  }
  .workspace-tab:not(.active) .workspace-tab-label,
  .workspace-tab:not(.active) .workspace-tab-pin,
  .workspace-tab:not(.active) .workspace-tab-close {
    display: none;
  }
  .workspace-tab:not(.active) {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
  .workspace-tab.active .workspace-tab-pin {
    display: none;
  }
}

/* Small keycap chip — used for the ⌘K hint on the search button and could be
   reused for other shortcut hints. */
.workspace-kbd {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.05rem 0.3rem;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text-muted);
  background: var(--bg-input);
}
/* Hidden on touch-first devices (hover: none): a shortcut keycap on an iPad top
   bar is noise even when a hardware keyboard happens to be attached (2026-07-20). */
@media (hover: none) {
  .workspace-kbd { display: none; }
}

/* Lucide ×/+/⋯ glyphs inside tab close / add / overflow buttons. Slightly larger
   than the 13px label icons so the affordance reads at small sizes. */
.workspace-tab-glyph {
  width: 16px;
  height: 16px;
  display: block;
}

/* ── "+ New" quick-create menu (#3) ──────────────────────────────────────────
   Dropdown anchored under the New button (reuses .workspace-history-wrap for
   positioning). Each item navigates to the surface that owns the create flow,
   which auto-opens it via a URL param (?compose=1 / ?create=1). */
.workspace-quick-create-menu,
.workspace-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 26;
  min-width: 232px;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}

.workspace-quick-create-menu button,
.workspace-account-menu button {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  cursor: pointer;
}

.workspace-quick-create-menu button:hover,
.workspace-quick-create-menu button:focus-visible,
.workspace-account-menu button:hover,
.workspace-account-menu button:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-input));
}

.workspace-quick-create-menu .ui-icon,
.workspace-account-menu .ui-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-soft);
}

.workspace-quick-create-text {
  display: grid;
  gap: 0.05rem;
}

.workspace-quick-create-text strong {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.workspace-quick-create-text small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Account menu (#2) ───────────────────────────────────────────────────── */
.workspace-account-btn .ui-icon {
  width: 20px;
  height: 20px;
}

.workspace-account-head {
  padding: 0.35rem 0.55rem 0.5rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  gap: 0.1rem;
}

.workspace-account-head strong {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-account-head small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.workspace-account-signout {
  margin-top: 0.15rem;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 8px 8px;
}

/* Specificity must beat ".workspace-account-menu button" (0,1,1), so qualify
   with the menu + button element, not the class alone. */
.workspace-account-menu button.workspace-account-signout,
.workspace-account-menu button.workspace-account-signout .ui-icon {
  color: var(--state-error);
}

/* ── "What's new" / changelog (top bar) ─────────────────────────────────── */
.workspace-whatsnew-btn {
  position: relative;
}
.workspace-whatsnew-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}
.workspace-whatsnew-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 26;
  width: 360px;
  max-width: 90vw;
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}
.workspace-whatsnew-list {
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.workspace-whatsnew-entry {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
}
.workspace-whatsnew-entry header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.workspace-whatsnew-entry header strong {
  font-size: 0.82rem;
  color: var(--text-primary);
}
.workspace-whatsnew-entry header small {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.workspace-whatsnew-entry ul {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.workspace-whatsnew-entry li {
  font-size: 0.78rem;
  color: var(--text-soft);
  line-height: 1.35;
}

/* Roadmap panel — mirrors the What's-new panel chrome and adds status chips/dots.
   All colours are theme tokens, so light/dark parity is automatic. Live = success
   green, In progress = accent, Planned = muted. */
.workspace-roadmap-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 26;
  width: 380px;
  max-width: 92vw;
  max-height: min(74vh, 560px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}
.workspace-roadmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0.05rem 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.workspace-roadmap-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.workspace-roadmap-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--roadmap-dot, var(--text-muted));
}
.workspace-roadmap-chip.is-live {
  --roadmap-dot: var(--state-success);
}
.workspace-roadmap-chip.is-in_progress {
  --roadmap-dot: var(--accent);
}
.workspace-roadmap-chip.is-planned {
  --roadmap-dot: var(--text-muted);
}
.workspace-roadmap-list {
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.workspace-roadmap-area {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
}
.workspace-roadmap-area header {
  margin-bottom: 0.4rem;
}
.workspace-roadmap-area header strong {
  display: block;
  font-size: 0.82rem;
  color: var(--text-primary);
}
.workspace-roadmap-area header small {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.1rem;
}
.workspace-roadmap-area ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.workspace-roadmap-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  line-height: 1.3;
}
.workspace-roadmap-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--roadmap-dot, var(--text-muted));
}
.workspace-roadmap-item.is-live {
  --roadmap-dot: var(--state-success);
}
.workspace-roadmap-item.is-in_progress {
  --roadmap-dot: var(--accent);
}
.workspace-roadmap-item.is-planned {
  --roadmap-dot: var(--text-muted);
}
.workspace-roadmap-item.is-planned .workspace-roadmap-item-label {
  color: var(--text-muted);
}
.workspace-roadmap-item-status {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--roadmap-dot, var(--text-muted));
}

.workspace-tab-close {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0 0.05rem;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: color 0.12s, background 0.12s, opacity 0.12s;
}

.workspace-tab:hover .workspace-tab-close,
.workspace-tab.active .workspace-tab-close,
.workspace-tab-close:focus-visible {
  opacity: 1;
}

.workspace-tab-close:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--border-subtle) 50%, transparent);
}

.workspace-main-content {
  overflow: auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  container-name: workspace-main;
}

.workspace-main-content > .page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.workspace-pane-resizer {
  width: 7px;
  cursor: col-resize;
  background: color-mix(in srgb, var(--border-subtle) 70%, transparent);
  border-radius: 999px;
}

.workspace-pane-resizer:hover {
  background: color-mix(in srgb, var(--nav-border-accent) 55%, transparent);
}

.workspace-pane-resizer.left {
  grid-column: auto;
}

.workspace-pane-resizer.right {
  grid-column: auto;
}

.workspace-right-pane {
  overflow: auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  contain: content;
}

.workspace-ai-tabs {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
}

.workspace-ai-tab {
  font-size: 0.78rem;
  padding: 0.35rem 0.55rem;
}

.workspace-ai-cards {
  padding: 0 0.75rem 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.workspace-ai-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--table-surface);
  padding: 0.52rem 0.56rem;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
  box-sizing: border-box;
}

.workspace-ai-card h3 {
  margin: 0 0 0.25rem;
  font-size: 0.84rem;
}

.workspace-ai-card p {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.workspace-pane-restore {
  position: fixed;
  right: 10px;
  top: 10px;
  z-index: 40;
}

/* (The old "+" tab-launcher card-grid was removed — "+" now opens the ⌘K command
   palette. Its .workspace-tab-launcher / .workspace-launcher-card styles went with it.) */

.icon-only {
  min-width: 1.75rem;
  width: 1.75rem;
  min-height: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 9px;
}

.ui-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.money-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.money-workbench {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr) minmax(260px, 320px);
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}

.money-workbench.money-workbench-scoped {
  grid-template-columns: minmax(0, 1fr);
}

.money-filters-pane,
.money-results-pane,
.money-scope-pane {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-deep);
  padding: 0.65rem;
  min-height: 0;
}

.money-filters-pane,
.money-results-pane,
.money-scope-pane {
  overflow: auto;
}

.money-filters-grid {
  grid-template-columns: 1fr;
}

.money-scope-panel {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin: 0.45rem 0 0.8rem;
  padding: 0.6rem;
  background: var(--table-surface);
}

.money-scope-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.money-scope-head h3 {
  margin: 0;
  font-size: 0.85rem;
}

.money-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.5rem;
  max-height: 260px;
  overflow: auto;
}

.money-scope-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  background: var(--bg-input);
  text-align: left;
}

.money-scope-card.active {
  border-color: var(--nav-border-accent);
  background: var(--primary-gradient-soft);
}

.money-scope-card p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.money-scope-card span,
.money-scope-card small {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-muted);
}

.money-row-inspector {
  margin-top: 0.7rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
}

.money-row-inspector h4 {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
}

.money-row-inspector p {
  margin: 0;
  font-size: 0.85rem;
}

.money-row-inspector strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

tr.clickable.is-active {
  background: color-mix(in srgb, var(--primary-gradient-soft) 65%, transparent);
}

.money-error-card {
  margin-bottom: 0.5rem;
}

.money-phase-table thead th {
  text-align: center;
}

.money-results-pane {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  justify-items: stretch;
}

.money-section {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-input) 65%, transparent);
  padding: 0.72rem 0.74rem;
  width: 100%;
  max-width: 100%;
}

.money-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: -0.2rem -0.2rem 0.75rem;
  padding: 0.45rem 0.5rem 0.6rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 75%, transparent);
}

.money-section-title {
  min-width: 0;
}

.money-section-head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.money-section-head p {
  margin: 0;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.money-period-section {
  min-width: min(100%, 640px);
}

.money-period-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.55rem;
}

.money-input-labelless span {
  display: none;
}

.money-input-labelless input,
.money-input-labelless .selectmenu-trigger {
  margin-top: 0;
}

.money-multi-toggle-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.6rem;
}

.money-multi-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-input) 86%, transparent);
  padding: 0.3rem 0.52rem;
  font-weight: 600;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.money-multi-toggle strong {
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.money-multi-toggle:hover {
  border-color: color-mix(in srgb, var(--nav-border-accent) 45%, var(--border-subtle));
}

.money-multi-toggle.is-on {
  border-color: color-mix(in srgb, var(--nav-border-accent) 60%, var(--border-subtle));
  background: color-mix(in srgb, var(--primary-gradient-soft) 38%, var(--bg-input));
}

.money-multi-toggle.is-on strong {
  color: var(--text-main);
  border-color: color-mix(in srgb, #7c8cff 52%, var(--border-subtle));
  background: color-mix(in srgb, #7c8cff 20%, transparent);
}

.money-multi-toggle-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 70%, transparent);
}

.money-multi-toggle.is-on .money-multi-toggle-dot {
  background: color-mix(in srgb, #7c8cff 72%, var(--text-main));
}

.money-multi-toggle-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 0.38rem);
  z-index: 8;
  min-width: 280px;
  max-width: 360px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-deep) 92%, transparent);
  padding: 0.38rem 0.46rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.money-multi-toggle-wrap:hover .money-multi-toggle-tooltip,
.money-multi-toggle-wrap:focus-within .money-multi-toggle-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.money-totals-section,
.money-breakdown-section {
  min-width: min(100%, 1080px);
}

.money-phase-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  min-width: 0;
}

.money-col-gross-divider {
  border-right: 1.5px solid color-mix(in srgb, var(--text-muted) 35%, transparent);
}

.money-col-balance-divider {
  border-right: 1.5px solid color-mix(in srgb, var(--text-muted) 35%, transparent);
}

.money-breakdown-block {
  margin-top: 0;
}

.money-breakdown-head {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 0.45rem;
}

.money-breakdown-head .field {
  min-width: 240px;
}

.money-phase-table th.money-group-col-head {
  width: 210px;
  min-width: 210px;
  vertical-align: top;
  padding: 0.2rem 0.35rem;
}

.money-groupby-head-select {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-main);
  padding: 0.28rem 0.45rem;
  font-size: 0.79rem;
  font-weight: 600;
}

.money-phase-table th,
.money-phase-table td {
  text-align: center;
  vertical-align: middle;
}

.money-breakdown-table td:first-child {
  text-align: left;
}

.money-phase-table thead th {
  background: color-mix(in srgb, var(--bg-deep) 55%, var(--bg-input));
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  padding-top: 0.58rem;
  padding-bottom: 0.58rem;
}

.money-totals-table td,
.money-breakdown-table td {
  font-size: 0.85rem;
}

.money-value-cell {
  font-weight: 700;
}

.money-booking-stack {
  display: grid;
  gap: 0.12rem;
}

.money-booking-stack strong {
  font-size: 0.82rem;
  line-height: 1.2;
}

.money-booking-stack span {
  font-size: 0.78rem;
  line-height: 1.2;
}

.money-booking-stack small {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.2;
}

.money-booking-modal-backdrop {
  z-index: 70;
}

.money-booking-modal {
  width: min(760px, calc(100vw - 2rem));
  max-height: min(82vh, 700px);
  overflow: auto;
}

.money-booking-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
}

.money-booking-modal-head h3 {
  margin: 0;
  font-size: 1.03rem;
}

.money-booking-modal-head p {
  margin: 0.18rem 0 0;
  font-size: 0.79rem;
}

.money-booking-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.55rem;
}

.money-booking-detail-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-input) 80%, transparent);
  padding: 0.5rem 0.55rem;
  display: grid;
  gap: 0.18rem;
}

.money-booking-detail-card strong {
  font-size: 0.83rem;
  line-height: 1.2;
}

@media (max-width: 1320px) {
  /* .workspace-shell responsive collapse is JS-driven now (responsive-layout.ts
     + WorkspaceShell pane display toggles). WHY these rules were
     removed: the shell sets grid-template-columns inline, which ALWAYS beats an
     @media rule, so the old collapse template was dead; and hiding every
     .workspace-pane-resizer.right also wrongly hid the support-pane resizer on
     5-pane routes (Properties/Registry/Mailbox), which the JS path keeps visible
     at this tier. Only the unrelated .money-workbench collapse remains. */
  .money-workbench {
    grid-template-columns: 1fr;
  }}

/* The inbox no longer collapses by VIEWPORT width. It collapses by its own PANE
   width via the @container query below — so a narrow viewport and a wide-but-starved
   pane (list + AI rail both open) are handled by the same, correct signal. The old
   @media (≤980) / (≤1180) inbox-shell collapses force-stacked the rail under the
   composer and crushed the message list to a sliver (Hakim 2026-06-23). */

/* Full-bleed from the nav rail to the viewport edge (overrides .page max-width + padding). */
.page.page-inbox {
  position: fixed;
  left: var(--content-offset);
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.45rem 0 0 0.35rem;
  box-sizing: border-box;
  background: var(--bg-deep);
}

.inbox-shell {
  flex: 1;
  height: 100%;
  min-height: 0;
  position: relative; /* containing block for the narrow-pane rail drawer + backdrop */
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px minmax(220px, 300px);
  gap: 0.45rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

/* The inbox pane is a SIZE CONTAINER so the conversation/detail split collapses on
   the inbox pane's OWN width — not the viewport. The shell can starve pane-3 (list
   + AI rail both open) to ~540px even on a 1400px viewport, where the viewport
   @media (≤1180) below never fired, so the chat column was crushed to ~200px and
   the address wrapped one word per line (Hakim 2026-06-23). Below ~800px of pane
   width we go single-column: full-width conversation, detail stacks beneath. */
.inbox-workspace-page {
  container-type: inline-size;
  container-name: inboxpane;
}
@container inboxpane (max-width: 800px) {
  /* Pane too narrow for a comfortable two-column split → the conversation takes the
     FULL pane width and the support rail becomes an overlay DRAWER (Gmail / Missive
     pattern) instead of stacking under the composer and crushing the message list.
     Scoped to conversation mode; saved Contact records keep the simple flow,
     while New Contact omits the still-empty rail and owns one track. */
  .inbox-shell {
    grid-template-columns: 1fr !important;
    min-height: 0;
  }
  .inbox-pane-resizer {
    display: none;
  }
  .inbox-chat {
    min-height: 280px;
  }
  .inbox-bubbles {
    min-height: 160px;
  }

  .inbox-shell--conversation .inbox-detail-toggle,
  .inbox-shell--conversation .inbox-detail-close {
    display: inline-flex;
  }

  .inbox-shell--conversation .inbox-detail {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(380px, 90%);
    z-index: 46;
    margin: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    box-shadow: -12px 0 32px color-mix(in srgb, var(--bg-deep) 45%, transparent);
    display: none;
  }
  .inbox-shell--conversation.is-detail-open .inbox-detail {
    display: flex;
    animation: inboxDrawerIn 0.2s ease;
  }
  .inbox-shell--conversation.is-detail-open .inbox-detail-backdrop {
    display: block;
  }
}
/* Very narrow pane (calendar pane-4 embed, or /inbox with the pane dragged tight):
   the header action cluster alone is ~390px, so space-between crushed
   .inbox-chat-head-main down to just the avatar and the name/address wrapped one
   word per line. Wrap the head instead: identity gets its own full-width row,
   the actions flow beneath it. */
@container inboxpane (max-width: 560px) {
  .inbox-chat-head {
    flex-wrap: wrap;
  }
  .inbox-chat-head-main {
    flex: 1 1 100%;
  }
  .inbox-chat-head-actions {
    flex-wrap: wrap;
    margin-left: 0;
    row-gap: 4px;
  }
}

/* Drawer chrome — inert (display:none) on wide screens; the @container query above
   switches the toggle/close/backdrop on when the inbox pane is too narrow for the
   side-by-side rail. Token-based → light + dark parity is automatic. */
.inbox-detail-toggle {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-soft);
  cursor: pointer;
}
.inbox-detail-toggle:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
/* Match the other header icon buttons (was a too-small ~14px glyph). */
.inbox-detail-toggle .ui-icon {
  width: 22px;
  height: 22px;
}
.inbox-detail-toggle .ui-icon path {
  stroke-width: 2.1;
}
/* Slice 3b — room make-public/private toggle. A header icon button matching
   .inbox-detail-toggle's box, but ALWAYS visible (the detail-toggle is
   container-query gated to narrow panes; reusing its class hid this one on wide
   panes). Icon sized to match the other header buttons. */
.rc-visibility-toggle {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-soft);
  cursor: pointer;
}
.rc-visibility-toggle:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.rc-visibility-toggle:disabled {
  opacity: 0.55;
  cursor: default;
}
.rc-visibility-toggle svg {
  width: 20px;
  height: 20px;
}
.inbox-detail-close {
  display: none;
  align-self: flex-end;
  width: 1.7rem;
  height: 1.7rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
}
.inbox-detail-close:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.inbox-detail-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 45;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: color-mix(in srgb, var(--bg-deep) 55%, transparent);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  animation: inboxBackdropIn 0.18s ease;
}
@keyframes inboxDrawerIn {
  from { opacity: 0; transform: translateX(6%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes inboxBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.inbox-main-column {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.inbox-main-column .inbox-chat {
  flex: 1 1 auto;
}

.inbox-pane-resizer {
  width: 7px;
  cursor: col-resize;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-subtle) 70%, transparent);
  /* Pointer-driven drag: without this, a touch drag scrolls the page instead of
     resizing (the handle is Pointer Events + keyboard now). */
  touch-action: none;
}

.inbox-pane-resizer:hover {
  background: color-mix(in srgb, var(--nav-border-accent) 55%, transparent);
}

.inbox-pane-resizer:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 1px;
}

.inbox-detail {
  background: var(--bg-elevated);
  padding: 0.65rem 0.75rem;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.inbox-detail-section {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-input) 45%, transparent);
  padding: 0.55rem 0.6rem;
}

/* The reservation rail is a sequence of distinct operational sections. Keep
   the vertical rhythm here instead of relying on every child to invent its own
   margins (which previously left some cards touching and others double-spaced). */
.inbox-reservation-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.inbox-reservation-stack > * {
  flex: 0 0 auto;
}

.reservation-section-disclosure {
  margin-block: 0.35rem;
}

.reservation-section-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.reservation-section-disclosure > summary::-webkit-details-marker {
  display: none;
}

.reservation-section-disclosure > summary::after {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.reservation-section-disclosure[open] > summary::after {
  transform: rotate(225deg);
}

.reservation-section-disclosure-body {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle);
}

/* Wave 5 — pane-4 support-rail tab switcher (Internal chat / Portal / Tasks).
   Sticks to the top of the scrolling rail; token-based so light + dark parity is
   automatic, and the buttons flex to share the width on small screens. */
.inbox-rail-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 0.25rem;
  padding-bottom: 0.5rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}

.inbox-rail-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--bg-input) 45%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.inbox-rail-tab:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
}

.inbox-rail-tab.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
}

@media (max-width: 768px) {
  .inbox-rail-tab {
    font-size: 0.72rem;
    padding: 0.35rem 0.3rem;
  }
}

/* ——————————————————————————————————————————————————————————————————————————
   Pane-4 "Thread" detail (InboxThreadDetail) — Replies + Details sub-tabs.
   Replaces the retired internal-chat feed. Tokens only → light/dark parity.
   ——————————————————————————————————————————————————————————————————————————*/
.inbox-td {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-width: 0;
}

/* Sub-tab pills — lighter than the rail tabs above them so the hierarchy reads. */
.inbox-td-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  background: color-mix(in srgb, var(--bg-input) 45%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  align-self: flex-start;
}
.inbox-td-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-soft);
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.inbox-td-tab:hover {
  color: var(--text-primary);
}
.inbox-td-tab.is-active {
  color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.inbox-td-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  font-size: 0.66rem;
  font-weight: 700;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.inbox-td-body {
  min-width: 0;
}

/* Empty states (no replies / no contacts / no attachments). */
.inbox-td-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.8rem 1rem;
  text-align: center;
  color: var(--text-soft);
}
.inbox-td-empty p {
  margin: 0;
  font-size: 0.82rem;
}
.inbox-td-empty .muted,
.inbox-td-emptyline {
  font-size: 0.78rem;
  color: var(--text-soft);
}
.inbox-td-emptyline {
  margin: 0.2rem 0 0;
}

/* ── Replies sub-tab — a calm, ClickUp-style comment thread ──────────────────
   No nesting arrows, no toy footers: an overview of threads as clean cards, and
   a focused thread that reads top-to-bottom with a WRITABLE composer at the foot. */
.inbox-td-overview {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.inbox-td-card {
  display: flex;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.65rem;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.inbox-td-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.inbox-td-card-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}
.inbox-td-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}
.inbox-td-card-author {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-td-card-time {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-soft);
}
.inbox-td-card-text {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-soft);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inbox-td-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
}
.inbox-td-card-meta svg {
  color: var(--accent);
}

/* Focused thread */
.inbox-td-thread-view {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.inbox-td-back {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  align-self: flex-start;
  padding: 0.25rem 0.45rem 0.25rem 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  background: none;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.inbox-td-back:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.inbox-td-thread-stream {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.inbox-td-thread-rule {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.4rem 0 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
}
.inbox-td-thread-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* A single comment — flat row, no arrows */
.inbox-td-comment {
  --inbox-td-comment-bg: var(--bg-elevated);
  position: relative;
  display: flex;
  gap: 0.55rem;
  padding: 0.5rem 0.4rem;
  border-radius: 10px;
  transition: background 0.12s ease;
}
.inbox-td-comment:hover,
.inbox-td-comment:focus-within {
  --inbox-td-comment-bg: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
  background: var(--inbox-td-comment-bg);
}
.inbox-td-comment.is-lead {
  padding-bottom: 0.6rem;
}
.inbox-td-comment.is-agent-object {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  padding-inline: 0;
}
.inbox-td-comment.is-agent-object:hover,
.inbox-td-comment.is-agent-object:focus-within {
  background: transparent;
}
.inbox-td-comment.is-agent-object .inbox-td-comment-reactions {
  padding-inline: 0.4rem;
}
.inbox-td .agent-change-set-plan,
.inbox-td .agent-change-set-options {
  grid-template-columns: minmax(0, 1fr);
}
.inbox-td-comment-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.inbox-td-comment-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) fit-content(55%);
  align-items: baseline;
  gap: 0.45rem;
  min-width: 0;
}
.inbox-td-comment-author {
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-td-comment.is-lead .inbox-td-comment-author {
  font-size: 0.86rem;
}
.inbox-td-comment-time {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.75rem;
  color: var(--text-soft);
  justify-self: end;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-td-comment-jump {
  color: var(--accent);
}
.inbox-td-comment-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}
/* Hover tools float over the right side of the header instead of participating
   in its grid. `opacity: 0` alone still reserves flex width; that old shape left
   only a few characters for the author and timestamp in the 220–300px rail. */
.inbox-td-comment-tools {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 2px 0 2px 12px;
  background: linear-gradient(90deg, transparent, var(--inbox-td-comment-bg) 12px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%);
  transition: opacity 0.12s ease;
}
.inbox-td-comment:hover .inbox-td-comment-tools,
.inbox-td-comment-tools:focus-within {
  opacity: 1;
  pointer-events: auto;
}
.inbox-td-comment-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.inbox-td-comment-tool:hover { color: var(--accent); background: var(--bg-input); }
.inbox-td-comment-tool--danger:hover { color: #ef4444; background: color-mix(in srgb, #ef4444 12%, var(--bg-input)); }
/* Reactions row under a comment — the chips themselves are the shared
   .inbox-reaction-chip (theme-token styled, light+dark). */
.inbox-td-comment-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0.3rem;
}
/* Stavros face slot — the presence glyph draws its own disc. */
.inbox-td-avatar-agent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}
/* Mini-task widget + inline editor reuse the canvas styles; just rein the
   widths in for the narrow rail. */
.inbox-td-comment-main .uos-mini-tasks { margin-top: 0.35rem; }
.inbox-td-comment-main .inbox-edit { min-width: 0; margin-top: 0.25rem; }
.inbox-td-comment-text {
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.inbox-td-comment.is-lead .inbox-td-comment-text {
  color: var(--text-primary);
}

/* Writable reply box */
/* Pane-4 reply composer — full pane-3 parity (2026-07-02): the rich editor sits in
   a bordered box with a tool row (attach · emoji · send) beneath, mirroring the
   main compose bar's anatomy at rail width. */
.inbox-td-composer {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 0.4rem;
  padding: 0.4rem 0.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.inbox-td-composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.inbox-td-composer-editor {
  min-width: 0;
}
.inbox-td-composer-editor .inbox-rich-editor {
  font-size: 0.84rem;
}
.inbox-td-composer-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}
.inbox-td-composer-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 18px glyphs in 32px hitboxes — the app-wide icon floor ("icons too small in
     the reply box", Hakim 2026-07-02). padding:0 matters: the global button
     padding (≈9×11px) was squeezing the glyph to ~8px wide inside the fixed box. */
  flex: 0 0 auto; /* the narrow drawer must not shrink the hitbox */
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.inbox-td-composer-tool:hover,
.inbox-td-composer-tool.is-active {
  background: var(--surface-muted);
  color: var(--text-primary);
}
/* The ClickUp cross-post choice gets a deliberate full-width row. It cannot share
   a 220–300px toolbar with two 32px tools and a 34px Send button without pushing
   the Send button outside the composer. */
.inbox-td-composer-also {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
  font-size: 0.76rem;
  line-height: 1.3;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: normal;
}
.inbox-td-composer-also input {
  flex: 0 0 auto;
  margin: 0.05rem 0 0;
  accent-color: var(--accent, var(--brand));
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}
.inbox-td-composer-also span { min-width: 0; }

.inbox-td-composer-spacer {
  flex: 1;
}
.inbox-td-composer-send {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--accent-contrast, #fff);
  background: var(--accent);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.12s ease, opacity 0.12s ease;
}
.inbox-td-composer-send:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 85%, #000);
}
.inbox-td-composer-send:disabled {
  opacity: 0.45;
  cursor: default;
}
.inbox-td-composer-err {
  font-size: 0.75rem;
  color: var(--state-error);
}
/* Files on a reply that AREN'T inlined in its body — small strip under the text. */
.inbox-td-comment-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.inbox-td-comment-img {
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: none;
  overflow: hidden;
  cursor: zoom-in;
  line-height: 0;
}
.inbox-td-comment-img img {
  display: block;
  max-width: 150px;
  max-height: 110px;
  object-fit: cover;
}
.inbox-td-comment-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 0.78rem;
  cursor: pointer;
}
.inbox-td-comment-file:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.inbox-td-comment-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inline attachments INSIDE a rendered UOS body (feed bubble + pane-4 reply rows) —
   the persisted form of the composer's inline atoms: the image sits in the text
   flow at the position the operator placed it (ClickUp-style), click → viewer. */
.inbox-uos-body img.uos-inline-img {
  display: block;
  width: min(320px, 100%);
  aspect-ratio: 4 / 3;
  margin: 5px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  object-fit: contain;
  cursor: zoom-in;
  background: var(--bg-deep);
}
.inbox-uos-body a.uos-inline-file {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 0;
  padding: 3px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 0.82em;
  text-decoration: none;
  cursor: pointer;
}
.inbox-uos-body a.uos-inline-file::before {
  content: "📎";
  font-size: 0.9em;
}
.inbox-uos-body a.uos-inline-file:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}

/* ── Details sub-tab ─────────────────────────────────────────────────────── */
.inbox-td-details {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.inbox-td-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-soft);
}
.inbox-td-search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-subtle));
}
.inbox-td-search-input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-primary);
  background: none;
  border: none;
  outline: none;
}
.inbox-td-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.inbox-td-result {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.inbox-td-result:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-color: var(--border-subtle);
}
.inbox-td-result-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.inbox-td-result-author {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}
.inbox-td-result-time {
  font-size: 0.75rem; /* 12px floor — sibling card/comment times already sit here */
  color: var(--text-soft);
}
.inbox-td-result-text {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-soft);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inbox-td-noresults {
  font-size: 0.8rem;
  color: var(--text-soft);
}
/* Current-stay summary card at the top of the Details sub-tab (guest threads). */
.inbox-td-stay-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.65rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  min-width: 0;
}
/* Clickable variant — the stay card drills the rail into its property. Resets the
   <button> chrome back to the card look and adds an accent hover, matching the
   clickable contact cards below it. */
.inbox-td-stay-card.is-clickable {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.inbox-td-stay-card.is-clickable:hover {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  border-color: var(--accent);
}
.inbox-td-stay-card.is-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.inbox-td-stay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
}
.inbox-td-stay-chevron {
  flex: none;
  color: var(--text-soft);
}
.inbox-td-stay-card.is-clickable:hover .inbox-td-stay-chevron {
  color: var(--accent);
}
.inbox-td-stay-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.inbox-td-stay-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.inbox-td-stay-dates {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  min-width: 0;
}
.inbox-td-stay-dates svg {
  flex: none;
  color: var(--text-soft);
}
.inbox-td-stay-phase {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}
.inbox-td-stay-phase[data-phase="upcoming"] {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.inbox-td-stay-phase[data-phase="checked-in"] {
  background: color-mix(in srgb, var(--state-success) 16%, transparent);
  color: var(--state-success);
}
.inbox-td-stay-phase[data-phase="completed"],
.inbox-td-stay-phase[data-phase="cancelled"] {
  background: color-mix(in srgb, var(--text-soft) 14%, transparent);
  color: var(--text-soft);
}
/* Not-yet-real statuses (pending / inquiry / payment failed …) — the status IS
   the chip; warning tone so it never reads as a settled stay. */
.inbox-td-stay-phase[data-phase="pending"] {
  background: color-mix(in srgb, var(--state-warning) 16%, transparent);
  color: color-mix(in srgb, var(--state-warning) 80%, var(--text-primary));
}

/* Pane-4 Reservation tab — linked-reservation cards (chrome shared with
   .inbox-td-stay-card; only the extras live here). */
.inbox-reslink-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.inbox-reslink-ref {
  font-size: 0.75rem;
  color: var(--text-soft);
}
.inbox-reslink-more {
  font-size: 0.78rem;
  margin: 0.25rem 0 0;
  width: 100%;
}
/* The card body as the OBJECT's click target (opens ReservationQuickView).
   A bare-chrome button so the card keeps its stay-card look; the Unlink row
   below stays outside it (nested buttons are invalid). */
.inbox-reslink-open {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0;
  margin: 0;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.inbox-reslink-open:hover .inbox-td-stay-name {
  color: var(--accent);
}
.inbox-reslink-open .inbox-crm-property-chevron {
  margin-left: auto;
}

/* Pane-4 support: the reservation OBJECT quick view (ReservationQuickView) —
   the click target of every reservation card. Token-only (CLAUDE.md #5). */
.inbox-resqv-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}
.inbox-resqv-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}
.inbox-resqv-dates {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
}
.inbox-resqv-facts {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0.65rem 0 0;
  border-top: 1px solid var(--border-subtle);
}
.inbox-resqv-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.inbox-resqv-fact dt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
}
.inbox-resqv-fact dd {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
/* The reservation's MONEY — the viewer's own waterfall (BookingMoneyWaterfall).
   It gets a raised card because it is the substance of the panel: the previous
   design gave the money the same weight as a reference number, so £348.44 read
   like filing metadata (Hakim 2026-07-27). The fall's own internal hierarchy
   (bold start, muted deductions, ruled payout) comes from .booking-money-*. */
.inbox-resqv-money {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.7rem 0.75rem 0.75rem;
}
.inbox-resqv-money > h3 {
  margin-bottom: 0.4rem;
}
/* The money SECTION of a reservation is one component (ReservationMoneyCard);
   inside this box it renders frameless, because the box above is already the
   frame. Stacks the fall, the attach-fees line and the adjustments editor. */
.reservation-money-bare {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.reservation-money-disclosure {
  min-width: 0;
}

.reservation-money-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6rem, 0.7fr) minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  padding: 0.15rem 0;
  list-style: none;
  cursor: pointer;
}

.reservation-money-summary::-webkit-details-marker {
  display: none;
}

.reservation-money-summary-value {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.reservation-money-summary-value small {
  color: var(--text-soft);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reservation-money-summary-value strong {
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.2;
}

.reservation-money-summary-value.is-payout {
  align-items: flex-end;
  text-align: right;
}

.reservation-money-summary-compression {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: var(--text-soft);
}

.reservation-money-summary-compression > span {
  flex: 1 1 auto;
  height: 1px;
  background: var(--border-subtle);
}

.reservation-money-summary-compression em {
  flex: 0 0 auto;
  font-size: 0.67rem;
  font-style: normal;
  white-space: nowrap;
}

.reservation-money-summary-compression svg {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.reservation-money-disclosure[open] .reservation-money-summary-compression svg {
  transform: rotate(180deg);
}

.reservation-money-detail {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 640px) {
  .reservation-money-summary {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .reservation-money-summary-compression em {
    display: none;
  }
}
/* Give the terminal line real presence — it is the answer to "what did this
   stay actually make", and in a narrow rail it was easy to miss. */
.inbox-resqv-money .booking-money-row[data-role="payout"] .booking-money-label,
.inbox-resqv-money .booking-money-row[data-role="payout"] .booking-money-amount {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}
/* Compact property jump. Replaced a full PropertyObjectCard that duplicated the
   identical Property card in the Details tab beside this panel — same photo,
   same address, on screen twice (Hakim 2026-07-27). The jump survives, the
   duplicate does not. */
.inbox-resqv-property-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.inbox-resqv-property-link:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.inbox-resqv-property-link > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-resqv-property-link > svg:last-child {
  flex: 0 0 auto;
  opacity: 0.55;
}

.inbox-td-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.inbox-td-section-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-soft);
}
.inbox-td-section-title svg {
  color: var(--text-soft);
}
.inbox-td-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.22rem;
  font-size: 0.64rem;
  font-weight: 700;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-soft) 18%, transparent);
  color: var(--text-soft);
}
.inbox-td-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.inbox-td-contact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.4rem;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.inbox-td-contact:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.inbox-td-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--bg-input);
}
.inbox-td-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.inbox-td-contact-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-td-contact-status {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-soft);
  text-transform: capitalize;
}
.inbox-td-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.inbox-td-attachments-more {
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.inbox-td-attachments-more:hover,
.inbox-td-attachments-more:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--text-primary);
}
.inbox-td-attach {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.inbox-td-attach:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
}
.inbox-td-attach-img {
  width: 56px;
  height: 56px;
  overflow: hidden;
  position: relative; /* anchors the per-attachment comment chip overlay */
}
.inbox-td-attach-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.inbox-td-attach-file {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  color: var(--text-soft);
}
.inbox-td-attach-file svg {
  flex: 0 0 auto;
  color: var(--text-soft);
}
.inbox-td-attach-name {
  font-size: 0.8rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pane-4 Details "Posts" — the thread's titled UOS posts, one click from the
   real bubble. Kind accent rides the shared [data-post-kind] --post-c hook, so
   a post-type hue still has exactly ONE definition. Tokens only → light/dark
   parity for free. */
.inbox-td-posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.inbox-td-post {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.inbox-td-post:hover {
  background: color-mix(in srgb, var(--post-c, var(--accent)) 8%, transparent);
  border-color: var(--border-subtle);
}
.inbox-td-post-icon {
  flex: 0 0 auto;
  display: inline-flex;
  margin-top: 1px;
  color: var(--post-c, var(--accent));
}
.inbox-td-post-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.inbox-td-post-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inbox-td-post-meta {
  font-size: 0.75rem; /* 12px floor — matches sibling result/comment times */
  color: var(--text-soft);
}

/* Clickable in-canvas reply quote → opens its container in pane-4. */
.inbox-quote.is-clickable {
  cursor: pointer;
  transition: background 0.12s ease;
}
.inbox-quote.is-clickable:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* Jump-to-message flash — when pane-4 scrolls the canvas to a bubble. */
.inbox-msg.is-focused {
  animation: inbox-msg-flash 1.8s ease;
}
@keyframes inbox-msg-flash {
  0%,
  28% {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  100% {
    background: transparent;
    box-shadow: 0 0 0 2px transparent;
  }
}

/* ——————————————————————————————————————————————————————————————————————————
   MyStay checklist — pane-4 guest-portal progress section
   Sits inside .inbox-detail-section; uses design tokens only (light + dark
   parity ensured by token design — no [data-theme] overrides needed here).
   ——————————————————————————————————————————————————————————————————————————*/

/* Remove the default section padding so the header fills edge-to-edge. */
.mystay-section {
  padding: 0;
  overflow: hidden;
  /* Pane 4 is a flex scroller. Let the scroller own overflow instead of
     shrinking this card under the Reservation card below it. */
  flex: 0 0 auto;
}

/* ── Header ── */
.mystay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font: inherit;
  gap: 0.35rem;
  border-radius: 9px 9px 0 0;
  transition: background 120ms ease;
}

.mystay-header:hover {
  background: color-mix(in srgb, var(--border-subtle) 60%, transparent);
}

.mystay-header-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mystay-header-icon {
  flex-shrink: 0;
  opacity: 0.75;
}

.mystay-header-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Body ── */
.mystay-body {
  padding: 0.35rem 0.6rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-top: 1px solid var(--border-subtle);
}

.mystay-chunk-loading .mystay-header {
  cursor: default;
}

.mystay-chunk-overview {
  min-height: 112px;
  align-content: start;
}

.mystay-chunk-title {
  width: 44%;
  height: 14px;
}

.mystay-chunk-line {
  width: 76%;
  height: 11px;
}

.mystay-chunk-action {
  width: 38%;
  height: 28px;
}

.mystay-chunk-rows {
  display: grid;
  gap: 8px;
  min-height: 94px;
}

.mystay-chunk-rows .skel {
  width: 100%;
  height: 26px;
}

/* ── Operational overview ── */
.mystay-overview {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.1rem 0 0.35rem;
  padding: 0.7rem;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-strong);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-input) 72%, transparent);
}

.mystay-overview--success { border-left-color: var(--state-success); }
.mystay-overview--warning { border-left-color: var(--state-warning); }
.mystay-overview--danger { border-left-color: var(--state-error); }

.mystay-overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.mystay-overview-head > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.mystay-overview-head strong {
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.25;
}

.mystay-overview-head small {
  color: var(--text-muted);
  font-size: 0.73rem;
  line-height: 1.35;
}

.mystay-overview-count {
  flex-shrink: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: 0.69rem;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
}

.mystay-overview-facts {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.mystay-overview-facts > span {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.3;
}

.mystay-overview-facts svg { flex-shrink: 0; color: var(--text-muted); }

.mystay-timing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.mystay-timing > span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.48rem 0.52rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
}

.mystay-timing > span > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mystay-timing small {
  color: var(--text-muted);
  font-size: 0.64rem;
  line-height: 1.2;
}

.mystay-timing strong {
  color: var(--text-primary);
  font-size: 0.8rem;
  line-height: 1.3;
}

.mystay-answers {
  padding: 0.62rem 0.68rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-input) 55%, transparent);
}

.mystay-answers h4 {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.mystay-answers dl {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.mystay-answers dl > div {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.55rem;
  padding: 0.38rem 0;
  border-top: 1px solid var(--border-subtle);
}

.mystay-answers dl > div:first-child { border-top: 0; padding-top: 0; }
.mystay-answers dl > div:last-child { padding-bottom: 0; }

.mystay-answers dt,
.mystay-answers dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  line-height: 1.35;
}

.mystay-answers dt { color: var(--text-muted); }
.mystay-answers dd { color: var(--text-primary); font-weight: 550; }

@media (max-width: 430px) {
  .mystay-timing { grid-template-columns: 1fr; }
}

.mystay-overview-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.mystay-open-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 68%, var(--border-strong));
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
}

.mystay-open-portal:hover:not(:disabled) { filter: brightness(1.06); }
.mystay-open-portal:disabled { opacity: 0.6; cursor: default; }

.mystay-overview-actions .mystay-copy-link {
  min-height: 30px;
  margin-top: 0;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

/* ── not_invited state ── */
.mystay-not-invited-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.4rem;
}

.mystay-invite-btn {
  font-size: 0.78rem;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.mystay-invite-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ── Copy guest-link affordance (ready state footer) ── */
.mystay-copy-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  align-self: flex-start;
  margin-top: 0.45rem;
  padding: 3px 6px;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-size: 0.72rem;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
}
.mystay-copy-link:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
/* The verification-report affordance reuses the class on an <a>; anchors
   default to underline, buttons don't — keep the two visually identical. */
a.mystay-copy-link {
  text-decoration: none;
}

/* Visually-hidden, screen-reader-only utility (for aria-live status text). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Step rows list ── */
.mystay-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* ── Single step row ── */
.mystay-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.15rem;
  min-width: 0;
}

/* ── Row body: label + caption ── */
.mystay-row-body {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  flex: 1 1 0;
  min-width: 0;
}

.mystay-row-label {
  font-size: 0.81rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tone tints the caption (subtle, not the label) */
.mystay-row-caption {
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* secondary line under the label: caption · timestamp */
.mystay-row-sub {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  min-width: 0;
}

.mystay-row-dot {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mystay-row--success .mystay-row-caption { color: var(--state-success); }
.mystay-row--warning .mystay-row-caption { color: var(--state-warning); }
.mystay-row--muted   .mystay-row-caption { color: var(--text-muted); }
.mystay-row--neutral .mystay-row-caption { color: var(--text-muted); }
.mystay-row--danger  .mystay-row-caption { color: var(--state-error); }

/* ── Timestamp ── */
.mystay-row-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Visible staff waiver control. This stays out of the overflow menu so Skip
   cannot be mistaken for, or hidden beside, the separate Access release. */
.mystay-row-direct-action {
  flex: 0 0 auto;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent, var(--text-link));
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.2;
  padding: 0.3rem 0.4rem;
  white-space: nowrap;
}

.mystay-row-direct-action:not(:disabled):hover {
  background: color-mix(in srgb, var(--accent, var(--text-link)) 10%, transparent);
}

.mystay-row-direct-action:disabled {
  color: var(--text-muted);
  cursor: default;
  opacity: 0.65;
}

/* ── ⋯ overflow button ── */
.mystay-row-more {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: default;
  opacity: 0.45;
  padding: 0;
}

.mystay-row-more:not(:disabled):hover {
  background: color-mix(in srgb, var(--border-subtle) 80%, transparent);
  opacity: 1;
  cursor: pointer;
}

/* ── Status circles ── */
.mystay-circle {
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* done — filled success green */
.mystay-circle--done {
  background: var(--state-success);
  color: #fff;
}

/* overridden — filled warning amber */
.mystay-circle--overridden {
  background: var(--state-warning);
  color: #fff;
}

/* skipped — grey ring + muted fill */
.mystay-circle--skipped {
  background: color-mix(in srgb, var(--border-strong) 30%, transparent);
  border: 1.5px solid var(--border-strong);
  color: var(--text-muted);
}

/* pending — hollow ring only, no fill, no glyph */
.mystay-circle--pending {
  background: transparent;
  border: 1.5px solid var(--border-strong);
}

/* blocked — filled danger/error red */
.mystay-circle--blocked {
  background: var(--state-error);
  color: #fff;
}

/* ── ⋯ button states when actions are available ── */
.mystay-row-more:not(:disabled) {
  opacity: 0.6;
  cursor: pointer;
}
.mystay-row-more--open,
.mystay-row-more:not(:disabled):hover {
  background: color-mix(in srgb, var(--border-subtle) 80%, transparent);
  opacity: 1;
}
.mystay-row-more--busy {
  opacity: 0.4 !important;
  cursor: default !important;
}

/* ── Busy spinner animation ── */
.mystay-row-spinner {
  animation: mystay-spin 0.75s linear infinite;
}
@keyframes mystay-spin {
  to { transform: rotate(360deg); }
}

/* ── Inline error line under a row ── */
.mystay-row-error {
  font-size: 0.7rem;
  color: var(--state-error);
  margin-top: 1px;
}

/* ── Override menu card — portalled to body, position:fixed ──
   Sits above every rail/pane (z 200 > 100 task-desc menus because
   the rail can stack on top of the task drawer at z 90). */
.mystay-menu {
  position: fixed;
  z-index: 200;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mystay-menu-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 5px;
  font-size: 0.81rem;
  font-family: inherit;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.mystay-menu-item:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.mystay-menu-item--danger {
  color: var(--state-error);
}
.mystay-menu-item--danger:hover {
  background: color-mix(in srgb, var(--state-error) 12%, transparent);
  color: var(--state-error);
}

/* ── Activity feed subsection ── */
.mystay-activity {
  margin-top: 0.3rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.25rem;
}

.mystay-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.2rem 0.1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  gap: 0.3rem;
  font: inherit;
  color: var(--text-muted);
  border-radius: 4px;
  transition: background 100ms ease;
}
.mystay-activity-header:hover {
  background: color-mix(in srgb, var(--border-subtle) 50%, transparent);
}

.mystay-activity-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mystay-activity-list {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.mystay-activity-item {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding: 0.1rem 0.1rem;
}

.mystay-activity-item-label {
  font-size: 0.78rem;
  color: var(--text-primary);
}

.mystay-activity-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   Duty card — components/comms/DutyCard.tsx (Task 12, Duty Intelligence).
   Sits inside .inbox-detail-section at the top of the rail's Portal tab,
   above MyStayChecklist. Same collapsible-section shape as .mystay-*
   (see banner comment there) — token-based, light + dark parity automatic.
   Icons ≥16px throughout (CLAUDE.md recurring "icons too small" rule).
   ═══════════════════════════════════════════════════════════════════════ */
.duty-card {
  padding: 0;
  overflow: hidden;
  /* The rail (.inbox-detail) is a flex column: without this the card SHRINKS to fit
     and overflow:hidden clips its last row (the Ask-AI button) instead of letting
     the rail scroll. */
  flex-shrink: 0;
}

.duty-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.45rem 0.6rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font: inherit;
  gap: 0.35rem;
  border-radius: 9px 9px 0 0;
  transition: background 120ms ease;
}
.duty-card-header:hover {
  background: color-mix(in srgb, var(--border-subtle) 60%, transparent);
}
.duty-card-header-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.duty-card-header-icon {
  flex-shrink: 0;
  color: var(--accent);
}
.duty-card-header-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.duty-card-body {
  padding: 0.5rem 0.6rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border-top: 1px solid var(--border-subtle);
}

.duty-card-guest {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.duty-card-guest-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.duty-card-guest-precis {
  font-size: 0.78rem;
  color: var(--text-soft);
  line-height: 1.4;
}

/* THREAD BRIEF (2026-07-21) — the roster line that replaces the single-contact name
   on a multi-contact thread, and the open point that replaces the sentiment read.
   Same tokens as the contact brief above so both cards are one card. */
.duty-card-roster {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--text-soft);
}
.duty-card-roster svg {
  flex: none;
  align-self: center;
}
.duty-card-roster-names {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  /* Four names wrap; they must never push the count chip off the card. */
  min-width: 0;
}
.duty-card-roster-count {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.duty-card-open-point {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-soft);
}
.duty-card-open-point svg {
  flex: none;
  margin-top: 0.12rem;
}
.duty-card-open-point strong {
  color: var(--text-primary);
  font-weight: 600;
}

.duty-card-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}
.duty-card-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  color: color-mix(in srgb, var(--state-warning) 82%, var(--text-primary));
  background: color-mix(in srgb, var(--state-warning) 16%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
}

.duty-card-property {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--text-soft);
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-subtle);
}
.duty-card-property-name {
  font-weight: 600;
  color: var(--text-primary);
}
.duty-card-property-dates {
  font-size: 0.8rem;
  color: var(--text-soft);
}
.duty-card-property-status {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--text-soft) 12%, var(--bg-elevated));
  border: 1px solid var(--border-subtle);
}

.duty-card-issues {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-subtle);
}
.duty-card-issues-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.duty-card-issues-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.duty-card-issue {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  font-size: 0.79rem;
}
.duty-card-issue-category {
  color: var(--text-primary);
  font-weight: 600;
  /* no text-transform: labels arrive properly cased from categoryLabel() — capitalize
     would mangle "Check-in and check-out" into "Check-in And Check-out" */
}
.duty-card-issue-count {
  font-weight: 400;
  color: var(--text-muted);
}
.duty-card-issue-fix {
  color: var(--text-soft);
  padding-left: 1.35rem;
}
/* Clickable known-issue row: plain button reset + chevron, whole row is the hit target */
.duty-card-issue-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.duty-card-issue-toggle:hover .duty-card-issue-category {
  color: var(--accent);
}
/* Drill-down examples behind a known-issue count */
.duty-card-issue-examples {
  list-style: none;
  margin: 0.2rem 0 0.1rem;
  padding: 0 0 0 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.duty-card-issue-example {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.76rem;
  color: var(--text-soft);
  border-left: 2px solid var(--border-subtle);
  padding-left: 0.5rem;
}
.duty-card-issue-example.muted {
  border-left: none;
  padding-left: 1.35rem;
}
.duty-card-issue-example-date {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}
.duty-card-issue-example-fix {
  color: var(--text-muted);
}
.duty-card-no-playbook {
  font-size: 0.78rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border-subtle);
}

.duty-card-ask-ai {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.duty-card-ask-ai:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

@media (max-width: 768px) {
  .duty-card-body {
    gap: 0.45rem;
  }
}

/* Reservation link controls — the per-link Unlink on reservation cards
   (ContactReservationLinks; the old Orphaned/Reattach mechanic was deleted
   2026-07-23). Token-only for light/dark parity (CLAUDE.md #5). */
.booking-assoc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.booking-assoc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.6rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.booking-assoc-btn:hover:not(:disabled) {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.booking-assoc-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.booking-assoc-btn.is-quiet {
  border-color: transparent;
  color: var(--text-muted);
}
.booking-assoc-btn.is-danger {
  color: var(--state-error);
  border-color: color-mix(in srgb, var(--state-error) 40%, var(--border-subtle));
}
.booking-assoc-btn.is-danger:hover:not(:disabled) {
  color: var(--state-error);
  background: color-mix(in srgb, var(--state-error) 10%, transparent);
}
.booking-assoc-note {
  font-size: 0.76rem;
  line-height: 1.45;
}

.booking-assoc-error {
  font-size: 0.74rem;
  color: var(--state-error);
}
.inbox-chat {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.inbox-list.slim {
  display: none;
}

.inbox-placeholder {
  padding: 1rem 0;
  margin: 0;
}

.inbox-error {
  color: var(--state-error);
  font-size: 0.88rem;
}

.inbox-load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.inbox-load-error .workspace-list-retry {
  flex: 0 0 auto;
  margin-top: 0;
}

.inbox-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem 0.65rem;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border-subtle);
  /* Paired with the min-width floor on .inbox-chat-head-main below: when the name
     and the action cluster cannot both fit, the actions drop to their own row
     rather than the name shrinking away. */
  flex-wrap: wrap;
}

.inbox-chat-head-text {
  min-width: 0;
}

.inbox-chat-head-actions {
  margin-left: auto;
  display: inline-flex;
  /* center (was flex-start): the Inbox|Details pill-group is taller than the
     bare Activity chip, so flex-start left them off-line (Hakim 2026-06-13). */
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.inbox-chat-head-main {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  /* The thread name IS the identity of a group chat, so it must not be the thing
     that yields. The action cluster measures ~413px and could not shrink (its
     buttons are fixed), so `space-between` handed the whole deficit to the name:
     "Operations" rendered as "Operatio…" in 89px of a 582px header (measured
     2026-07-21). Below this floor the actions wrap instead. */
  min-width: min(100%, 240px);
  flex: 1 1 auto;
}

.inbox-chat-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}

/* #145 — thread-photo edit affordance: a small camera badge on the avatar's
   bottom-right corner. ALWAYS visible (Hakim couldn't find the upload), subtle,
   lifts on hover. Token-based border/accent → light/dark parity. */
.inbox-chat-avatar-edit {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--bg-elevated);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.inbox-chat-avatar-edit:hover {
  transform: scale(1.08);
  filter: brightness(1.08);
}
.inbox-chat-avatar-edit:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.inbox-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex: 0 0 auto;
}

.inbox-chat-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--ring) 32%, transparent);
}

.inbox-chat-title {
  font-size: 1.08rem;
  margin: 0 0 0.15rem;
  font-weight: 800;
  line-height: 1.2;
}

.inbox-chat-sub {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
}

/* Header stay dates are the thread's resolved reservation OBJECT — clicking
   opens the reservation quick view in pane-4, never the listing page
   (2026-07-23). Bare chrome so it reads as part of the sub-line; hover reveals
   the affordance. Token-only — inherits the muted colour in both themes. */
.inbox-chat-sub-stay {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.inbox-chat-sub-stay:hover,
.inbox-chat-sub-stay:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

.inbox-tag-trigger {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.inbox-tag-trigger .ui-icon {
  width: 23px;
  height: 23px;
}

.inbox-tag-trigger:hover,
.inbox-tag-trigger:focus-visible {
  color: var(--text-primary);
}

/* Header action icon button (Export transcript). */
.inbox-head-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}
.inbox-head-action-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.inbox-head-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
/* Thread-header glyph cluster (Call / export / thread-actions / tag). The base
   .ui-icon is 14px and the inline 1.8 stroke reads wispy at small sizes, so the
   icons looked tiny regardless of width. Make them clearly larger AND bolder —
   the CSS stroke-width on the <path> overrides the inline strokeWidth="1.8"
   attribute from icons.tsx. (Hakim 2026-06-22.) */
.inbox-head-action-btn .ui-icon,
.inbox-tag-trigger .ui-icon {
  width: 24px;
  height: 24px;
}
.inbox-head-action-btn .ui-icon path,
.inbox-tag-trigger .ui-icon path {
  stroke-width: 2;
}
/* Open state for the "…" thread-actions trigger (Item 4). */
.inbox-head-action-btn.is-on {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ── Wave 6 — team-collaboration cluster (assign / snooze / resolve / presence) ──
   Lives in .inbox-chat-head-actions; the buttons reuse .inbox-head-action-btn. */
.inbox-collab {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-right: 0.25rem;
  flex-wrap: wrap;
}
.inbox-agent-head-presence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 0.2rem;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 7%, transparent);
}
.inbox-collab-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}
/* Snooze popover reuses .inbox-head-menu (absolute, right-aligned). */
.inbox-collab-menu {
  min-width: 168px;
  max-width: 240px;
}
.inbox-collab-menu-head {
  margin: 0.1rem 0.35rem 0.25rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}
/* Snooze date+time picker (Hakim 2026-06-23 — the 3-preset menu was useless;
   pick any moment). color-scheme themes the native picker for dark mode. */
.inbox-snooze-menu {
  min-width: 232px;
  padding: 0.5rem;
}
.inbox-snooze-input {
  width: 100%;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color-scheme: light dark;
}
.inbox-snooze-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}
.inbox-snooze-confirm {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 100ms ease;
}
.inbox-snooze-confirm:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 88%, #000);
}
.inbox-snooze-confirm:disabled {
  opacity: 0.45;
  cursor: default;
}
/* Presence — overlapping avatar stack of OTHER current viewers (collision warning). */
.inbox-collab-presence {
  display: inline-flex;
  align-items: center;
  margin-right: 0.15rem;
}
.inbox-collab-viewer {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-left: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: color-mix(in srgb, var(--accent) 65%, var(--text-primary));
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.inbox-collab-viewer:first-child {
  margin-left: 0;
}
.inbox-collab-viewer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 768px) {
  .inbox-collab {
    gap: 0;
    margin-right: 0.1rem;
  }
  .inbox-collab-menu {
    max-width: calc(100vw - 1rem);
  }
}

/* ── Wave 7 — Portal rail de-noise (Hakim 2026-06-22): the rail keeps only a
   glanceable booking header + MyStay + the contact-type control; the full guest
   & booking record, reservation context and stay history live in the Details
   tab. Token-based → light/dark parity; min-width:0 + wrap → small-screen safe. */
.inbox-portal-glance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  min-width: 0;
}
.inbox-portal-listing {
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
  overflow-wrap: anywhere;
}
.inbox-portal-dates {
  font-size: 0.8125rem;
  color: var(--text-soft);
}
.inbox-portal-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--text-soft) 12%, var(--bg-elevated));
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.inbox-portal-status.is-cancelled {
  color: color-mix(in srgb, var(--state-warning) 78%, var(--text-primary));
  background: color-mix(in srgb, var(--state-warning) 16%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
}
.inbox-portal-hint {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.inbox-resqv-availability-action {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  text-decoration: none;
}

/* Multi-reservation invoice rail — a merged thread can link several bookings, so
   each reservation gets its OWN "Copy invoice link" row (the single-booking case
   still renders one bare button above, unchanged). Token-based → light + dark
   parity is automatic. See the invoice section in InboxClient.tsx. */
.inbox-invoice-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.inbox-invoice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-input) 45%, transparent);
}
.inbox-invoice-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.inbox-invoice-item-title {
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-invoice-item-dates {
  font-size: 0.75rem;
  color: var(--text-soft);
}
.inbox-portal-detail-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.inbox-portal-detail-link:hover {
  text-decoration-thickness: 2px;
}
@media (max-width: 768px) {
  .inbox-portal-glance {
    gap: 0.3rem 0.4rem;
  }
}

/* Positioned wrapper so the absolute tag menu anchors to the trigger (not a
   distant ancestor — which used to fling it off-screen, the "tag button does
   nothing" bug). */
.inbox-tag-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.inbox-tag-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 40;
  min-width: 280px;
  max-width: 320px;
  padding: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}

.inbox-tag-menu-scope-head {
  display: grid;
  gap: 0.12rem;
  padding: 0.05rem 0.1rem 0.45rem;
}

.inbox-tag-menu-scope-head strong {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.inbox-tag-menu-scope-head span {
  color: var(--text-soft);
  font-size: 0.68rem;
  line-height: 1.35;
}

.inbox-tag-menu-contact-scope {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle);
}

.inbox-tag-menu-contact-scope .inbox-tag-menu-scope-head {
  padding-bottom: 0.1rem;
}

.inbox-tag-menu-contact-list {
  display: grid;
  gap: 0.3rem;
  max-height: 8.5rem;
  overflow-y: auto;
}

.inbox-tag-contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.inbox-tag-contact-link:hover,
.inbox-tag-contact-link:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface));
}

.inbox-tag-contact-link > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 650;
}

.inbox-tag-contact-link > small {
  flex: none;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 650;
}

.inbox-tag-menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.45rem 0 0.4rem;
}

.inbox-tag-create-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.inbox-tag-create-row input[type="color"] {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0;
}

/* Item 4 — thread-title "…" header menu (Rename thread / Auto-name AI). Anchored
   to its trigger and RIGHT-aligned so it opens toward the pane interior and never
   clips off the right pane edge — the tooltips/menus-escape-overflow rule. The
   header is not an overflow scroller, so absolute positioning escapes cleanly.
   Token-styled; identical in light + dark. */
.inbox-head-menu-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.inbox-head-menu {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  z-index: 60;
  min-width: max-content;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.3rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}

.inbox-head-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.6rem 0.4rem 0.45rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.inbox-head-menu-item .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--text-soft);
}

.inbox-head-menu-item:hover:not(:disabled),
.inbox-head-menu-item:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.inbox-head-menu-item:hover:not(:disabled) .ui-icon {
  color: var(--accent);
}

.inbox-head-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

/* On narrow screens keep the menu fully on-screen: clamp its left edge to the
   viewport via a max-width and let it sit flush to the trigger's right edge. */
@media (max-width: 768px) {
  .inbox-head-menu {
    max-width: calc(100vw - 1rem);
  }
}

.inbox-tag-search {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 0.08rem 0.32rem;
  background: var(--bg-input);
  min-height: 28px;
}

.inbox-tag-search .ui-icon {
  width: 12px;
  height: 12px;
  color: var(--text-soft);
}

.inbox-tag-search input {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  width: 100%;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.2;
}

.inbox-bubbles {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  /* Tight WITHIN a short same-sender turn; a new turn adds its own margin.
     Was 0.5rem flat, which made grouped runs look ungrouped. */
  gap: 0.16rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.65rem 0.85rem;
}

.inbox-history-sentinel {
  align-self: stretch;
  flex: 0 0 auto;
  min-height: 1px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.inbox-history-loader {
  display: block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 0.15rem 0 0.55rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: var(--text-muted);
  animation: inbox-history-spin 0.75s linear infinite;
}
@keyframes inbox-history-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .inbox-history-loader { animation: none; }
}

/* Wave 2 — "N new messages" pill. Sticky to the bottom of the scroll viewport so it
   floats over the latest messages while you read history; clicking it jumps down.
   --accent (indigo) + white reads correctly in both light and dark. */
.inbox-new-pill {
  position: sticky;
  bottom: 10px;
  align-self: center;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  padding: 0.32rem 0.75rem;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: filter 0.12s ease, transform 0.12s ease;
}
.inbox-new-pill:hover {
  filter: brightness(1.06);
}
.inbox-new-pill:active {
  transform: translateY(1px);
}

/* A new turn (sender/channel change or a five-minute pause) gets breathing room
   above it. New-DAY turns are separated by the day divider instead, so they
   don't also get this margin. */
.inbox-msg.is-turn-start {
  margin-top: 0.6rem;
}

/* Outgoing: right-align the body's contents so the (now per-turn) channel chip
   sits above the right-aligned bubble, not stranded on the opposite side. */
.inbox-msg.out .inbox-msg-body {
  align-items: flex-end;
}

/* Each calendar day is its own group so the divider can STICK while that day is
   in view (Hakim 2026-06-14, restoring the sticky he liked). The group bounds the
   sticky, so exactly ONE label is ever pinned — the next day pushes the last one
   out instead of stacking (the 2026-06-10 pile-up of layered pills is gone).
   Mirror .inbox-bubbles' flex column + within-turn gap so message left/right
   alignment and turn spacing are identical to an unwrapped list. */
.inbox-day-group {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
}
/* Day divider — a centred uppercase pill (Figma's "TODAY") that pins to the top
   of the thread while scrolling its day. Pill background + hairline keep it
   legible floating over the bubbles. */
.inbox-day-sep {
  position: sticky;
  top: 4px;
  z-index: 3;
  display: flex;
  justify-content: center;
  margin: 0.55rem 0 0.35rem;
  pointer-events: none;
}
.inbox-day-sep span {
  font-size: 0.64rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.18rem 0.66rem;
  box-shadow: var(--shadow-soft, 0 1px 2px rgba(0, 0, 0, 0.06));
  transition: opacity 0.3s ease;
}
/* WhatsApp behaviour for the STUCK pill: while it floats over bubbles it shows only
   during active scrolling, then fades out — at rest it was reading as content of
   whatever card it happened to cover ("CALL SUMMARY  YESTERDAY", iPad 2026-07-20),
   and it duplicated the turn footer's own "yesterday" right beneath it. Inline
   (non-stuck) pills between day groups stay visible; InboxClient stamps is-stuck /
   is-scrolling from the bubbles scroller. */
.inbox-day-sep.is-stuck span { opacity: 0; }
.inbox-bubbles.is-scrolling .inbox-day-sep.is-stuck span { opacity: 1; }

.inbox-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: -8px;
}

/* New compact context bar that replaces the format-button toolbar
   per the user's reference screenshot. Holds a small sparkle icon,
   the prefix ("{guest} is"), and the sentiment dropdown chip. The
   row is borderless on top of the composer surface and a hairline
   divider below separates it from the message textarea. */
.inbox-context-bar {
  /* No divider (Hakim ×2, 2026-06-10) — the sentiment row stays borderless on the
     composer surface like the Figma toolbar row. But a few px of breathing room
     below so the chip isn't sitting literally on the textarea's top edge
     (Hakim 2026-06-23 "sentiment dropdown is touching the type bar"). */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.6rem;
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
/* Collapse toggle for the (chonky) insight strip — pinned to the right of the
   sentiment row; a pulsing dot signals there's a read to expand. */
.inbox-insight-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  padding: 2px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.inbox-insight-toggle:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
}
.inbox-insight-toggle-spark {
  display: inline-flex;
  color: var(--accent);
}
.inbox-insight-toggle-label {
  letter-spacing: 0.01em;
}
.inbox-insight-toggle-chev {
  transition: transform 0.15s ease;
}
.inbox-insight-toggle.is-open .inbox-insight-toggle-chev {
  transform: rotate(180deg);
}
.inbox-insight-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-elevated);
  animation: inbox-insight-dot-pulse 2s ease-in-out infinite;
}
@keyframes inbox-insight-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}
.inbox-insight-toggle.is-loading .inbox-insight-toggle-spark {
  animation: inbox-insight-spark-pulse 1.1s ease-in-out infinite;
}
@keyframes inbox-insight-spark-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@media (max-width: 520px) {
  .inbox-insight-toggle-label { display: none; }
}
.inbox-context-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--text-soft);
  flex: 0 0 auto;
}
.inbox-sentiment-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-sentiment-prefix {
  color: var(--text-muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.inbox-sentiment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.18rem 0.55rem 0.18rem 0.42rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  max-width: 220px;
  /* Tone-driven tinting comes from data-tone attributes below so
     the chip mirrors the dropdown's coloured swatches without any
     extra inline styles. */
}
.inbox-sentiment-chip:hover {
  filter: brightness(1.06);
}
/* Tone TEXT mixes toward --text-primary so it tracks the theme: near-black in
   light (≈ the old fixed hexes), near-white in dark — the flat literals were
   light-tuned and went muddy/low-contrast on the dark tinted background. */
.inbox-sentiment-chip[data-tone="good"] {
  background: color-mix(in srgb, #22c55e 18%, var(--bg-input));
  border-color: color-mix(in srgb, #22c55e 45%, var(--border-subtle));
  color: color-mix(in srgb, #16a34a 62%, var(--text-primary));
}
.inbox-sentiment-chip[data-tone="warm"] {
  background: color-mix(in srgb, #84cc16 18%, var(--bg-input));
  border-color: color-mix(in srgb, #84cc16 45%, var(--border-subtle));
  color: color-mix(in srgb, #65a30d 62%, var(--text-primary));
}
.inbox-sentiment-chip[data-tone="neutral"] {
  background: color-mix(in srgb, #94a3b8 18%, var(--bg-input));
  border-color: color-mix(in srgb, #94a3b8 45%, var(--border-subtle));
  color: var(--text-primary);
}
.inbox-sentiment-chip[data-tone="warn"] {
  background: color-mix(in srgb, #f59e0b 18%, var(--bg-input));
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border-subtle));
  color: color-mix(in srgb, #d97706 62%, var(--text-primary));
}
.inbox-sentiment-chip[data-tone="bad"] {
  background: color-mix(in srgb, #ef4444 18%, var(--bg-input));
  border-color: color-mix(in srgb, #ef4444 45%, var(--border-subtle));
  color: color-mix(in srgb, #dc2626 62%, var(--text-primary));
}
.inbox-sentiment-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: 0 0 auto;
  /* Avatar-style: a Lucide mood glyph in a mid-tone colour on a subtle same-tone
     disc. currentColor-based disc adapts to both themes; the mid-tones below all
     clear the 3:1 non-text contrast bar on light and dark surfaces. */
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.inbox-sentiment-emoji[data-tone="good"] { color: #16a34a; }
.inbox-sentiment-emoji[data-tone="warm"] { color: #65a30d; }
.inbox-sentiment-emoji[data-tone="neutral"] { color: #64748b; }
.inbox-sentiment-emoji[data-tone="warn"] { color: #d97706; }
.inbox-sentiment-emoji[data-tone="bad"] { color: #dc2626; }
.inbox-sentiment-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.inbox-sentiment-menu .inbox-sentiment-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 6px 10px;
}
.inbox-sentiment-item[data-tone="good"]:hover { background: color-mix(in srgb, #22c55e 14%, transparent); }
.inbox-sentiment-item[data-tone="warm"]:hover { background: color-mix(in srgb, #84cc16 14%, transparent); }
.inbox-sentiment-item[data-tone="neutral"]:hover { background: color-mix(in srgb, #94a3b8 14%, transparent); }
.inbox-sentiment-item[data-tone="warn"]:hover { background: color-mix(in srgb, #f59e0b 14%, transparent); }
.inbox-sentiment-item[data-tone="bad"]:hover { background: color-mix(in srgb, #ef4444 14%, transparent); }
.inbox-sentiment-item.is-active { background: color-mix(in srgb, var(--ring) 14%, transparent); }

/* Template picker — the toolbar "templates" button's popover (portal to body). */
.inbox-template-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  z-index: 1200;
  max-height: 300px;
  overflow-y: auto;
}
.inbox-template-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.inbox-template-item:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.inbox-template-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}
.inbox-template-hint {
  font-size: 0.75rem;
  color: var(--text-soft);
}
/* "+ New template" quick-add row pinned to the top of the picker. */
.inbox-template-item--manage {
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 7px 7px 0 0;
  margin-bottom: 2px;
}
.inbox-template-item--manage .inbox-template-label {
  color: var(--accent);
}
.inbox-template-empty {
  margin: 0;
  padding: 8px 9px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Staged outbound attachments — removable chips above the composer toolbar. */
/* Inline staged-attachment chip — the `attachment` TipTap node. It flows WITH the
   composer text (replacing the old detached chip stack) and reads as a small file
   pill sitting on the text baseline, mirroring the mention-chip aesthetic. */
.inbox-inline-attach {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  margin: 0 2px;
  padding: 1px 4px 1px 6px;
  vertical-align: -3px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-size: 0.82em;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: nowrap;
  user-select: none;
}
.inbox-inline-attach.is-ready {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
}
.inbox-inline-attach.is-error {
  border-color: color-mix(in srgb, var(--state-error) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-error) 8%, var(--bg-elevated));
}
/* PM selects the atom (click / shift-arrow) before a backspace deletes it. */
.inbox-inline-attach.ProseMirror-selectednode {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
}
/* Full inline image — the actual picture sits in the text flow (ClickUp-style):
   caret lands before/after, text wraps around it, ✕ appears on hover. */
.inbox-inline-attach.is-img {
  position: relative;
  display: inline-block;
  max-width: min(340px, 100%);
  padding: 0;
  margin: 3px 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  vertical-align: bottom;
  white-space: normal;
  line-height: 0;
}
.inbox-inline-attach-img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
}
.inbox-inline-attach.is-img .inbox-inline-attach-x {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgb(15 15 18 / 0.62);
  color: #fff;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.inbox-inline-attach.is-img:hover .inbox-inline-attach-x,
.inbox-inline-attach.is-img.ProseMirror-selectednode .inbox-inline-attach-x {
  opacity: 1;
}
.inbox-inline-attach.is-img .inbox-inline-attach-x:hover {
  background: rgb(15 15 18 / 0.82);
  color: #fff;
}
/* Upload-in-flight veil over the live preview. */
.inbox-inline-attach-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: color-mix(in srgb, var(--bg-elevated) 55%, transparent);
}
.inbox-inline-attach-media {
  display: inline-flex;
  align-items: center;
  color: var(--text-soft);
  flex: none;
}
.inbox-inline-attach.is-ready .inbox-inline-attach-media {
  color: var(--accent);
}
.inbox-inline-attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.inbox-inline-attach-progress {
  flex: none;
  color: var(--text-soft);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.inbox-inline-attach-veil .inbox-inline-attach-progress {
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  background: rgb(15 15 18 / 0.72);
}
.inbox-inline-attach-err {
  color: var(--state-error);
  font-weight: 600;
  flex: none;
}
.inbox-inline-attach-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.05em;
  line-height: 1;
  padding: 0 1px;
  flex: none;
  border-radius: 4px;
}
.inbox-inline-attach-x:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-muted) 18%, transparent);
}
.inbox-attach-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  animation: inbox-attach-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes inbox-attach-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Templates management modal (portal). Mirrors the app's modal pattern. */
.inbox-tmpl-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.inbox-tmpl-modal {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.inbox-tmpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.inbox-tmpl-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.inbox-tmpl-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  padding: 0 4px;
}
.inbox-tmpl-close:hover {
  color: var(--text-primary);
}
.inbox-tmpl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
}
.inbox-tmpl-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.inbox-tmpl-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 1rem 1rem;
  overflow-y: auto;
}
.inbox-tmpl-empty {
  margin: 0.5rem 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.inbox-tmpl-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
}
.inbox-tmpl-card-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.inbox-tmpl-input,
.inbox-tmpl-body {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  min-width: 0;
}
.inbox-tmpl-input {
  flex: 1 1 160px;
}
.inbox-tmpl-input--hint {
  flex: 1 1 140px;
}
.inbox-tmpl-body {
  width: 100%;
  resize: vertical;
  line-height: 1.4;
}
.inbox-tmpl-input:focus,
.inbox-tmpl-body:focus {
  outline: none;
  border-color: var(--accent);
}
.inbox-tmpl-error {
  margin: 0;
  font-size: 0.75rem;
  color: var(--state-error);
}
.inbox-tmpl-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.inbox-tmpl-del {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--state-error);
  padding: 0.3rem 0.2rem;
}
.inbox-tmpl-del:hover {
  text-decoration: underline;
}
.inbox-tmpl-del:disabled {
  opacity: 0.5;
  cursor: default;
}
.inbox-tmpl-save,
.inbox-tmpl-add {
  font-size: 0.8125rem;
}
@media (max-width: 768px) {
  .inbox-tmpl-modal {
    max-width: 100%;
    max-height: 92vh;
  }
}

/* Call-confirm bar (Hakim 2026-06-22): selecting "Call" arms this instead of
   auto-dialing; explicit Call / Cancel. Token-based, wraps on small screens. */
.inbox-call-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin: 0.35rem 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
}
.inbox-call-confirm-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.inbox-call-confirm-go {
  white-space: nowrap;
}
/* "Call via" FROM-number chooser inside the call panel. */
.inbox-call-via {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-soft);
  white-space: nowrap;
}
.inbox-call-via-label {
  color: var(--text-muted);
}
.inbox-call-via-select {
  max-width: 11rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input, var(--bg-elevated));
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: inherit;
}
.inbox-call-via-single {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.inbox-call-confirm-note {
  display: inline-block;
  margin: 0.35rem 0;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.inbox-bubble {
  /* Figma bubbles: flat fills, no border, 12px radius, roomier padding. */
  max-width: 85%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: none;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Email bubbles render a whole email (its own white card / sandboxed iframe), so
   let them use the FULL conversation width instead of the 85% chat-bubble cap, and
   drop the bubble padding/fill so the email card stands on its own — otherwise the
   email is clipped into a ~400px box (Hakim 2026-06-23). */
.inbox-bubble.is-email {
  max-width: 100%;
  width: 100%;
  padding: 0;
  background: transparent;
}
/* An email bubble must NOT carry the .in/.out chat-bubble fill — those rules live
   later in the file and outrank the plain .is-email selector, which left a tinted
   frame behind the now-borderless card + meta strip. Force transparent (higher
   specificity) so ONLY the .inbox-emailcard-doc box reads as a container (Hakim
   2026-06-25). */
.inbox-bubble.in.is-email,
.inbox-bubble.out.is-email {
  background: transparent;
  padding: 0;
}

/* Email cards are documents, not chat balloons. Keep the sender avatar on the
   appropriate side, but let the document itself use the conversation's full
   available width — feedback #5681 showed that the old 88% body cap still made
   ordinary email needlessly cramped. :has() targets it without a JSX change. */
.inbox-msg:has(> .inbox-msg-body > .inbox-bubble.is-email) > .inbox-msg-body {
  width: 100%;
  max-width: 100%;
}
/* Beats `.inbox-msg > .inbox-msg-body > .inbox-bubble { width: fit-content }` (same
   chain + .is-email = higher specificity), so the email card fills its row. */
.inbox-msg > .inbox-msg-body > .inbox-bubble.is-email {
  width: 100%;
  max-width: 100%;
}

.inbox-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Clickable URLs inside chat bubbles + internal notes (linkify()). color:inherit so
   the link stays legible on BOTH the light incoming bubble and the accent outgoing
   bubble, in either theme — the underline is what signals it's a link. */
.inbox-inline-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.inbox-inline-link:hover {
  opacity: 0.82;
}

/* WhatsApp reply-quote chip inside a bubble — the message being replied to, shown
   as an accent-bordered inset above the reply text (mirrors the native client).
   Both in/out bubbles use dark-on-light fills, so one token set reads in either. */
.inbox-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0 0 0.4rem;
  padding: 0.25rem 0.5rem;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-elevated));
  max-width: 100%;
}
.inbox-quote-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.3;
}
.inbox-quote-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* #5 (Hakim 2026-06-30) — "N replies" pill under a parent UOS note. Replies collapse
   OUT of the canvas; this is the single entry point into the pane-4 Replies view. */
.inbox-replies-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  margin: 1px 0 0.35rem;
  padding: 2px 9px 2px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.12s ease;
}
.inbox-replies-chip:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
}
.inbox-replies-chip svg {
  flex-shrink: 0;
}
/* Match the bubble's side — internal notes are outbound, so the pill sits on the right. */
.inbox-replies-chip.out {
  align-self: flex-end;
  margin-left: auto;
}
.inbox-replies-chip.in {
  align-self: flex-start;
  margin-right: auto;
}
/* Internal (UOS) notes are outbound → the chip sits on the RIGHT, matching the bubble.
   (Root cause of the "bottom-left" bug: side==="internal" had no align rule and fell to
   the base flex-start while the bubble was flex-end.) Hakim 2026-07-01. */
.inbox-replies-chip.internal {
  align-self: flex-end;
  margin-left: auto;
}
/* Facepile of who replied — up to 3 overlapping avatars ahead of the count. */
.inbox-replies-avatars {
  display: inline-flex;
  align-items: center;
}
.inbox-replies-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  overflow: hidden;
  margin-left: -6px;
  border: 1.5px solid var(--bg-elevated);
  background: color-mix(in srgb, var(--accent) 22%, var(--bg-elevated));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.inbox-replies-avatar:first-child {
  margin-left: 0;
}
.inbox-replies-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* (No `.inbox-replies-avatar-fallback` any more — the reply faces render the
   canonical ContactAvatar, which brings its own seeded disc. 2026-07-26.) */
.inbox-replies-count {
  white-space: nowrap;
}

/* Per-message metadata tooltip — a styled, INSTANT hover bubble showing
   channel · number · time · delivery for each message. Replaces the slow, hidden
   native title (Hakim wanted per-message source actually visible). */
.inbox-bubble[data-meta] {
  position: relative;
}
.inbox-bubble[data-meta]:hover::after {
  content: attr(data-meta);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 70;
  white-space: nowrap;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
/* Right-aligned (outbound) bubbles anchor the tooltip to their right edge. */
.inbox-bubble.out[data-meta]:hover::after {
  left: auto;
  right: 0;
}

/* Internal-note composer state — make it UNMISTAKABLE you're writing a private note
   (Hakim: "not obvious enough that im in internal messaging mode"). */
.inbox-compose.is-note {
  background: color-mix(in srgb, var(--state-warning) 9%, var(--bg-elevated));
}

/* WhatsApp 24h session-window countdown — the live "free replies for Xh Ym"
   pill above the composer (components/inbox/WhatsAppWindowStatus.tsx). Open =
   success; final hour = warning; lapsed = error; never-opened = muted. */
.inbox-wa-window {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.45rem;
  font-size: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}
.inbox-wa-window-text strong {
  font-weight: 700;
}
.inbox-wa-window-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.inbox-wa-window--open {
  color: color-mix(in srgb, var(--state-success) 80%, var(--text-primary));
  background: color-mix(in srgb, var(--state-success) 12%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-success) 35%, var(--border-subtle));
}
.inbox-wa-window--open .inbox-wa-window-dot {
  background: var(--state-success);
}
.inbox-wa-window--open.is-soon {
  color: color-mix(in srgb, var(--state-warning) 85%, var(--text-primary));
  background: color-mix(in srgb, var(--state-warning) 14%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-warning) 45%, var(--border-subtle));
}
.inbox-wa-window--open.is-soon .inbox-wa-window-dot {
  background: var(--state-warning);
}
.inbox-wa-window--closed {
  color: color-mix(in srgb, var(--state-error) 82%, var(--text-primary));
  background: color-mix(in srgb, var(--state-error) 12%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-error) 38%, var(--border-subtle));
}
.inbox-wa-window--closed .inbox-wa-window-dot {
  background: var(--state-error);
}
.inbox-wa-window--none {
  color: var(--text-soft, var(--text-soft));
  background: var(--bg-elevated);
  border-style: dashed;
}
.inbox-wa-window--none .inbox-wa-window-dot {
  background: var(--text-soft, var(--text-soft));
}

/* --- Thread Insight strip (pane 3) ---------------------------------------
   Sits flush under the sentiment chip. Calm by default: renders nothing on a
   quiet thread, lights up on an active one. Aligns with the context bar's
   0.6rem inset so the fairness pill lines up under the chip. */
.inbox-insight {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem 0.1rem;
  min-width: 0;
  font-size: 0.8125rem; /* 13px — readable; never below the 12px body floor */
}
.inbox-insight--loading {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  font-size: 0.8125rem;
}
.inbox-insight-spark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: inbox-insight-pulse 1.2s ease-in-out infinite;
}
@keyframes inbox-insight-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.inbox-insight-read {
  display: flex;
  flex-wrap: wrap;
  /* flex-start (not baseline) + line-heights matched to the pill keeps the
     fairness chip aligned with the first line of the summary, not floating. */
  align-items: flex-start;
  gap: 0.35rem 0.45rem;
  min-width: 0;
}
.inbox-insight-prose {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-insight-summary {
  color: var(--text-soft);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.inbox-insight-fairness-note {
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
/* Fairness pill — three calm, distinct hues so a glance reads how warranted the
   grievance is: amber = justified (act), grey = part-fair, indigo = overstated
   (stay measured). NOT the red/green sentiment palette — that's the chip's job. */
.inbox-insight-fairness {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex: 0 0 auto;
  padding: 0.08rem 0.4rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.inbox-insight-fairness[data-fairness="justified"] {
  color: color-mix(in srgb, var(--state-warning) 85%, var(--text-primary));
  background: color-mix(in srgb, var(--state-warning) 13%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-warning) 42%, var(--border-subtle));
}
.inbox-insight-fairness[data-fairness="mixed"] {
  color: var(--text-soft);
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}
.inbox-insight-fairness[data-fairness="overstated"] {
  color: color-mix(in srgb, var(--accent) 78%, var(--text-primary));
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
}
/* Suggested next step — a gentle indigo action card. Display-only guidance; the
   hand-off to the Pane-5 assistant is roadmapped (its receiver lives there). */
.inbox-insight-next {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  min-width: 0;
}
.inbox-insight-next-arrow {
  display: inline-flex;
  margin-top: 1px;
  color: var(--accent);
  flex: 0 0 auto;
}
.inbox-insight-next-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.inbox-insight-next-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--accent);
}
.inbox-insight-next-text {
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.inbox-insight-next-why {
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* Media message (e.g. WhatsApp photo) — a thumbnail in the bubble that opens the
   full image in a new tab on click. Keeps a small gap before a caption/footer. */
.inbox-bubble-media {
  display: block;
  margin-bottom: 0.3rem;
  border-radius: 8px;
  overflow: hidden;
  width: min(240px, 100%);
  max-width: 240px;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  cursor: zoom-in;
  position: relative; /* anchors the per-attachment comment chip overlay */
}
.inbox-bubble-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A WhatsApp provider can emit one multi-photo selection as several message
   rows. The read-side album deliberately has a stable card width, so they become a
   compact 2×2 mosaic instead of inheriting the single-photo bubble's intrinsic
   width. The normal tokenised in/out bubble still supplies both themes. */
.inbox-msg > .inbox-msg-body > .inbox-bubble.is-photo-album {
  width: min(100%, 420px);
  padding: 4px;
}

/* #32 — 3+ photos on ONE message render as a compact mosaic, not a stack (a
   140-photo email used to render 140 full-size blocks under each other). Square
   aspect-ratio tiles = zero post-load layout shift, so the thread's scroll
   anchor holds without the re-anchor dance the full-size media path needs.
   Rest state caps at 8 tiles; the last tile wears the "+N" scrim (its own photo
   counts as hidden too). Tokens only → light/dark parity; the scrim is fixed
   white-on-dark, readable on any photo. */
.inbox-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 4px;
  width: min(100%, 480px);
  margin-bottom: 0.3rem;
}
.inbox-photo-grid.is-whatsapp-album {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 412px);
  margin-bottom: 0;
}
.inbox-photo-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  cursor: zoom-in;
}
.inbox-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.inbox-photo-more-scrim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 18, 34, 0.58);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.inbox-photo-grid-less {
  align-self: flex-start;
  margin: 0 0 0.3rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}
.inbox-photo-grid-less:hover { text-decoration: underline; }


/* #29 — read-only preview of the WhatsApp quick-reply buttons we offered the guest,
   beneath our own sent bubble's text. They look like the tappable buttons the guest
   sees but are inert for staff; their own elevated fill keeps them legible on the
   lavender .inbox-bubble.out. Token-based → light/dark + small-screen parity. */
.inbox-qr-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.inbox-qr-caption {
  flex-basis: 100%;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.inbox-qr-button {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
}

/* #24 — INBOUND interactive reply on the guest bubble. A quick-reply/list tap shows
   a small tag (the answer itself is the bubble body); a shared location shows a
   tappable card. Tokens give light/dark for free; both wrap on small screens. */
.inbox-interactive-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 2px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.inbox-interactive-tag svg {
  flex: none;
  opacity: 0.8;
}

.inbox-loc-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: 320px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.inbox-loc-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.inbox-loc-pin {
  display: inline-flex;
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}
.inbox-loc-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.inbox-loc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.inbox-loc-addr {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.inbox-loc-link {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.inbox-bubble.in {
  /* Figma inbound: soft neutral gray (#F1F1F2 on white). Token mix gives the
     dark-mode equivalent (slightly lifted surface) for free. */
  align-self: flex-start;
  background: color-mix(in srgb, var(--text-primary) 6%, var(--bg-elevated));
}

.inbox-bubble.out {
  /* Figma outbound: soft lavender fill with normal (dark-in-light) text. */
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
}

.inbox-bubble.out.is-automated {
  /* Dashed amber border re-declared in full — the base bubble is borderless. */
  border: 1px dashed color-mix(in srgb, #f59e0b 45%, var(--border-subtle));
  background: color-mix(in srgb, #f59e0b 12%, var(--bg-elevated));
}

.inbox-bubble.in.is-internal {
  /* OTHER people's UOS / internal posts render FLAT like ClickUp/Slack, not as a
     chat bubble: transparent surface, no border (higher specificity beats the
     .inbox-bubble.in gray fill). Identity comes from the avatar + name + time
     header above (.inbox-msg-head); the whole-row hover wash frames it.
     Scoped to .in ONLY — YOUR OWN posts are side "out" and keep the standard
     lavender sent-bubble like every other message you send (Hakim 2026-07-02:
     "uos text is still on left side … when im the sender"). */
  background: transparent;
  border: none;
  /* Flat rows carry no bubble chrome, so drop the bubble padding too — the text
     sits flush on the content column, exactly under the sender name. */
  padding: 0.05rem 0;
}

/* Per-message row = avatar + (channel chip + bubble). M4: sender/recipient
   profile + transport shown ON each message (mirrors the calendar reservation
   thread). The ROW owns left/right alignment, so the bubble no longer self-aligns. */
.inbox-msg {
  /* Card = one turn: avatar+name+meta header (top), bubble(s), reactions (bottom).
     A COLUMN — the avatar/name/meta live in the header now (Hakim 2026-06-12 avatar
     then name; 2026-07-23 time+tick joined the name line). The ROW spans the FULL
     pane width so the hover wash frames the WHOLE row, not just a 75% card (Hakim
     2026-07-23: "highlight the whole row … hover anywhere on that row"). */
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
}
/* The 75% content cap lives on the BODY now (was on .inbox-msg): an inbound (left)
   and outbound (right) bubble must leave clear whitespace on the OPPOSITE side or the
   chat loses its left/right sidedness (Hakim 2026-06-17). align-items sides the body
   within the full-width row; align-self is gone (the row no longer self-sizes). */
.inbox-msg.in {
  align-items: flex-start;
}
.inbox-msg.out {
  align-items: flex-end;
}
/* Whole-message hover affordance — EVERY message (guest or internal, any transport)
   gets a clear hover state, not just internal bubbles (Hakim 2026-06-30: "an effect on
   the whole row when you hover, regardless of transport"). A subtle indigo wash frames
   the card; the bubble + meta sit on top. */
.inbox-msg {
  border-radius: 14px;
  padding: 2px 8px;
  transition: background 0.12s ease;
}
.inbox-msg:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
/* Internal UOS posts use one ClickUp-style anatomy for every author. They are
   not inbound/outbound speech bubbles: the avatar is always in a left rail and
   the message content stays in one readable column. Guest transports retain
   the sided chat treatment below. */
.inbox-msg.is-uos-feed {
  align-items: stretch;
}
.inbox-msg.is-uos-feed .inbox-msg-body,
.inbox-msg.is-uos-feed.out .inbox-msg-body {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 3px;
  align-items: start;
  width: 100%;
  max-width: 100%;
}
.inbox-msg.is-uos-feed .inbox-msg-body > * {
  grid-column: 2;
  justify-self: start;
}
.inbox-msg.is-uos-feed .inbox-msg-head {
  display: contents;
}
.inbox-msg.is-uos-feed .inbox-msg-avatar {
  grid-column: 1;
  grid-row: 1;
  width: 32px;
  height: 32px;
}
.inbox-msg.is-uos-feed .inbox-msg-headline {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-height: 32px;
}
.inbox-msg.is-uos-feed .inbox-msg-sender {
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 650;
}
.inbox-msg.is-uos-feed .inbox-bubble.is-internal,
.inbox-msg.is-uos-feed .inbox-bubble.in.is-internal {
  width: 100%;
  max-width: none;
  padding: 0.05rem 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
/* ClickUp-parity flatten (approved 2026-07-26): a mention-of-you row keeps the
   SAME silhouette as every other message — a thin accent edge + the @pill carry
   the highlight. The old full-card 9% wash broke the feed into mixed species. */
.inbox-msg.is-uos-feed.is-mention-for-me {
  box-shadow: inset 3px 0 0 var(--accent);
}
/* (Removed the old .inbox-msg.internal right-align override. UOS messages now
   align by SENDER via .inbox-msg.in / .inbox-msg.out — the viewer's own posts
   right, everyone else's left, like a real team chat. sideOf() drives it.) */
.inbox-msg-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  /* Content cap moved here from .inbox-msg so the ROW can be full-width for the
     whole-row hover while the bubble still leaves whitespace on the opposite side. */
  max-width: 75%;
}
.inbox-msg.out .inbox-msg-body {
  align-items: flex-end;
}
/* Flat-feed anatomy for the LEFT side (guest inbound, email, UOS): a ClickUp-style
   avatar rail + one aligned content column. The body becomes a grid — avatar in the
   rail, everything else (name, body, replies, meta) starts on the SAME vertical
   line, instead of the old ragged stack where the text hugged the pane edge under
   the avatar (Hakim 2026-07-02: "all text is on the left side of the screen. just
   make it consistent"). Outbound keeps the right-bubble chat anatomy. */
.inbox-msg.in .inbox-msg-body {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 3px;
}
.inbox-msg.in .inbox-msg-body > * {
  grid-column: 2;
}
.inbox-msg.in .inbox-msg-head {
  display: contents;
}
.inbox-msg.in .inbox-msg-avatar {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 30px;
  height: 30px;
}
/* The whole headline (name + meta) rides the content column, aligned with the bubble
   below; the avatar stays in the rail. (Was the bare sender at col2 — the meta line
   joined it 2026-07-23.) */
.inbox-msg.in .inbox-msg-headline {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}
.inbox-msg.in .inbox-msg-sender {
  font-size: 0.8rem;
  color: var(--text-primary);
}
.inbox-msg > .inbox-msg-body > .inbox-bubble {
  align-self: auto;
  max-width: 100%;
  width: fit-content;
}
/* Card header — avatar + a headline (sender name · meta) at the TOP, on the sender's
   side. Outbound puts the avatar on the RIGHT of the headline (top-right corner). */
.inbox-msg-head {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0.15rem 0.28rem;
}
.inbox-msg.out .inbox-msg-head {
  flex-direction: row-reverse;
}
/* Name + meta on ONE line (Hakim 2026-07-23: "tick and time next to the sender name").
   Wraps only when the row is genuinely too narrow. */
.inbox-msg-headline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.1rem 0.5rem;
  min-width: 0;
}
.inbox-msg-sender {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-soft);
}
/* Meta cluster, moved up from the old turn-end footer: channel logo · time · route
   disclosure. Delivery state is per-bubble below; a turn header may own several
   bubbles and therefore cannot truthfully own one delivery result. */
.inbox-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.inbox-msg-meta .workspace-platform-logo-mini { flex: 0 0 auto; }
.inbox-msg-meta .inbox-bubble-time { white-space: nowrap; }
.inbox-msg-avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}
.inbox-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* (No `.inbox-msg-avatar-fallback` any more — BOTH sides of the thread render the
   canonical ContactAvatar, which brings its own seeded disc. 2026-07-26.) */
/* ContactAvatar silhouette placeholder filling the 26px message-bubble avatar. */
.inbox-msg-avatar-ph {
  width: 100%;
  height: 100%;
}

/* Lives OUTSIDE the bubble (a sibling under .inbox-msg-body) — bubbles carry
   content only; metadata sits beneath, auto-aligned per side by the body flex. */
.inbox-bubble-foot {
  margin-top: 0.2rem;
  padding: 0 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
}
.inbox-bubble-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.inbox-bubble-meta .workspace-platform-logo-mini {
  flex: 0 0 auto;
}

/* Per-message delivery state -------------------------------------------------
   A Slack-style turn head can group several consecutive messages. Delivery is
   message-specific, so the receipt lives INSIDE the exact outbound bubble it
   describes. Failed sends spell out the state as well as showing the icon; that
   removes any "which message does the exclamation belong to?" ambiguity. */
.inbox-bubble-delivery {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  width: 100%;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  line-height: 1;
}
.inbox-bubble-delivery .inbox-foot-tick {
  gap: 0.25rem;
}
.inbox-bubble-delivery .inbox-foot-tick--fail {
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--state-error);
  font-weight: 600;
}
.inbox-bubble-delivery .inbox-foot-tick--web-chat {
  color: var(--text-muted);
  font-weight: 500;
}
.inbox-foot-tick-label {
  white-space: nowrap;
}
.ph-message-delivery {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.68rem;
}
.ph-message-delivery .inbox-foot-tick {
  gap: 0.25rem;
}

/* Unconfirmed group-chat messages -------------------------------------------
   A message between Users is painted the instant Enter is pressed and confirmed
   a moment later (lib/inbox/optimistic-uos.ts). While it is in flight it reads
   slightly back, so the difference between "on screen" and "everyone has it" is
   visible without being loud. A send that fails keeps its bubble and offers the
   way out, because text that silently reappears in the composer is exactly what
   made this feel unreliable. */
.inbox-bubble.is-sending {
  opacity: 0.62;
}
.inbox-bubble.is-unsent {
  /* color-mix keeps this honest in both themes — no hardcoded red. */
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--state-error) 45%, transparent);
}
.inbox-bubble.out.is-widget-pending {
  border: 1px dashed color-mix(in srgb, var(--accent) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  box-shadow: none;
}
.inbox-widget-pending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem 0.65rem;
  margin-top: 0.38rem;
  max-width: 100%;
  color: var(--text-soft);
  font-size: 0.75rem;
}
.inbox-widget-pending-status,
.inbox-widget-pending-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.inbox-widget-pending-status {
  font-weight: 600;
  color: var(--text-primary);
}
.inbox-widget-pending-actions button,
.inbox-widget-control-actions button {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0.32rem 0.55rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.inbox-widget-pending-actions button:hover:not(:disabled),
.inbox-widget-control-actions button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong));
  color: var(--accent);
}
.inbox-widget-pending-actions button:disabled,
.inbox-widget-control-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
}
.inbox-widget-pending-error {
  flex-basis: 100%;
  color: var(--state-error);
  text-align: right;
}
.inbox-bubble-unsent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: color-mix(in srgb, var(--state-error) 78%, var(--text-primary));
  font-weight: 500;
}
.inbox-bubble-retry {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  /* Comfortable to hit on a phone without changing the footer's height. */
  min-height: 24px;
}
.inbox-bubble-retry:hover,
.inbox-bubble-retry:focus-visible {
  color: color-mix(in srgb, var(--accent) 80%, var(--text-primary));
}
/* Guest sends (TestFlight #39) add two things to that footer: WHY it failed, in
   plain words, and a way to drop the message instead of resending it. Discard is
   deliberately the quiet one — Retry is what we expect the operator to want. */
.inbox-bubble-unsent-reason {
  display: block;
  color: var(--text-muted);
  max-width: 34rem;
}
.inbox-bubble-discard {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  min-height: 24px;
}
.inbox-bubble-discard:hover,
.inbox-bubble-discard:focus-visible {
  color: var(--text-primary);
}
.inbox-bubble-reactions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
/* The only footer left is the pending "Sending… / Not sent + Retry" line (confirmed
   meta moved up to the head 2026-07-23). On an outbound self-send it hugs the right,
   the sender's corner. */
.inbox-msg.out .inbox-bubble-meta {
  margin-left: auto;
}
/* Reactions now sit on the LEFT, directly under the message (Hakim 2026-07-23) — no
   longer shoved to the opposite corner. The inbound left-align (justify-self:start in
   the grid) lives with .inbox-bubble-reactions.in below. */

.inbox-compose {
  flex: 0 0 auto;
  margin-top: auto;
  position: sticky;
  bottom: 0;
  /* 0.7rem top (was 0.25rem): the sentiment row sits EQUALLY between the top
     border and the resizer pill — ~11px air each side, like the Figma composer
     toolbar band (Hakim, 2026-06-11: "isn't sitting equally in the middle").
     Paired with the -18px resizer pull below so the pill/editor don't move. */
  padding: 0.7rem 0.85rem 0.85rem;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-deep) 55%, var(--bg-elevated));
}

.inbox-channel {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
}

.inbox-channel .selectmenu-trigger,
.inbox-detail .selectmenu-trigger {
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
}

.inbox-textarea {
  width: 100%;
  resize: vertical;
  min-height: 4rem;
  padding: 0.5rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
}

/* Long-message mode hint — appears inside the enter-sends composer the moment a
   draft goes multi-line (Enter now adds lines; send = button / ⌘Enter). Muted and
   tiny so it informs without shouting; theme tokens keep light/dark parity. */
.inbox-editor-enter-hint {
  padding: 0.15rem 0.1rem 0;
  font-size: 0.68rem;
  color: var(--text-tertiary, var(--text-muted));
  user-select: none;
}

.inbox-rich-editor {
  width: 100%;
  min-height: var(--inbox-editor-min-h, 2.8rem);
  /* Compact by default so a long draft can't swallow the thread; the compose
     bar's expand toggle relaxes this (.is-expanded), then it scrolls. */
  max-height: min(9.5rem, 30vh);
  overflow-y: auto;
  padding: 0.5rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  cursor: text;
  display: flex;
  flex-direction: column;
}
.inbox-rich-editor:focus-within {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 70%, var(--border-strong));
}
/* Email mode — a roomy, document-style editor (not a chat sliver). Same theme
   tokens (light/dark parity), just generous height, padding + line-height so
   composing an email reads like writing a letter rather than a text. */
.inbox-rich-editor.is-email {
  /* COMPACT until you actually write — a permanent 12rem empty editor left the
     email itself ~100px of reading room (Hakim 2026-07-02, the Perk thread).
     Focus opens the roomy document-style writing area; a blurred draft keeps
     its height naturally (content sizes it). */
  min-height: 3.4rem;
  max-height: 60vh;
  padding: 0.85rem 0.95rem;
  line-height: 1.55;
  transition: min-height 160ms ease;
}
.inbox-rich-editor.is-email:focus-within {
  min-height: 12rem;
}
.inbox-rich-editor.is-email:focus-within .ProseMirror {
  min-height: 11rem;
}
/* Expanded — the compose bar's expand toggle opens a taller writing area (chat +
   email both), still capped so it never fully hides the conversation. */
.inbox-rich-editor.is-expanded {
  max-height: min(22rem, 55vh);
}
.inbox-rich-editor.is-email.is-expanded {
  max-height: 78vh;
}
.inbox-rich-editor .ProseMirror {
  flex: 1 1 auto;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: calc(var(--inbox-editor-min-h, 2.8rem) - 1rem);
}
.inbox-editor-content-shell {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-editor-content-shell > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-rich-editor.has-predictive-reply {
  min-height: 5.15rem;
}
.inbox-rich-editor.has-predictive-reply .ProseMirror p.is-editor-empty:first-child::before {
  content: "";
}
.inbox-predictive-ghost {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-width: 0;
  color: color-mix(in srgb, var(--text-primary) 42%, transparent);
}
.inbox-predictive-ghost.is-desktop {
  pointer-events: none;
  padding: 0 5.8rem 1.45rem 0;
}
.inbox-predictive-ghost.is-desktop .inbox-predictive-ghost-text {
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.inbox-predictive-ghost-text {
  display: -webkit-box;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.inbox-predictive-ghost-use {
  pointer-events: auto;
  position: absolute;
  right: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border: 0;
  border-radius: 999px;
  padding: 0.2rem 0.42rem;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-elevated));
  color: var(--text-muted);
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}
.inbox-predictive-ghost-use:hover {
  background: color-mix(in srgb, var(--accent) 15%, var(--bg-elevated));
  color: var(--text-primary);
}
.inbox-predictive-ghost-use kbd {
  min-width: 1.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.3rem;
  padding: 0.04rem 0.24rem;
  background: var(--bg-input);
  color: var(--text-soft);
  font-family: inherit;
  font-size: inherit;
  text-align: center;
  box-shadow: 0 1px 0 var(--border-subtle);
}
.inbox-rich-editor.has-agent-intervention {
  min-height: 7rem;
  border-color: color-mix(in srgb, var(--accent) 46%, var(--border-subtle));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent);
}
.inbox-rich-editor.has-agent-active-draft {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 6%, transparent);
}
.inbox-agent-intervention-ghost.is-desktop {
  padding: 0 0 2.15rem;
  pointer-events: none;
}
.inbox-agent-working-ghost.is-desktop {
  padding-top: 0.15rem;
}
.inbox-agent-intervention-ghost.is-compact {
  position: sticky;
  inset: auto;
  bottom: -0.5rem;
  z-index: 2;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 0;
  margin: 0.4rem -0.55rem -0.5rem;
  padding: 0.4rem 0.55rem 0.5rem;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-input) 94%, var(--accent) 6%);
  pointer-events: auto;
}
.inbox-agent-intervention-ghost.is-compact .inbox-agent-working-copy {
  flex: 1 1 auto;
}
.inbox-agent-intervention-ghost.is-compact .inbox-agent-intervention-actions {
  position: static;
  flex: 0 0 auto;
  width: auto;
}
.inbox-agent-working-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 680;
}
.inbox-agent-working-copy > span:not(.inbox-agent-working-dots) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-agent-working-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.inbox-agent-working-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent);
  animation: inbox-agent-working-dot 900ms ease-in-out infinite;
}
.inbox-agent-working-dots i:nth-child(2) { animation-delay: 120ms; }
.inbox-agent-working-dots i:nth-child(3) { animation-delay: 240ms; }
@keyframes inbox-agent-working-dot {
  0%, 65%, 100% { transform: translateY(0); opacity: 0.35; }
  32% { transform: translateY(-3px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .inbox-agent-working-dots i {
    animation: none !important;
  }
}
.inbox-agent-intervention-actions {
  pointer-events: auto;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.inbox-agent-intervention-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  margin-right: auto;
  color: var(--text-muted);
  font-size: 0.68rem;
}
.inbox-agent-intervention-state > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-agent-intervention-state strong { color: var(--accent); font-weight: 750; }
.inbox-agent-intervention-actions button,
.inbox-agent-handoff-notice button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 26px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 680;
  cursor: pointer;
  white-space: nowrap;
}
.inbox-agent-intervention-actions button.is-send {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 15%, var(--bg-elevated));
  color: var(--text-primary);
}
.inbox-agent-intervention-actions button:hover:not(:disabled),
.inbox-agent-handoff-notice button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text-primary);
}
.inbox-agent-intervention-actions button:disabled,
.inbox-agent-handoff-notice button:disabled { opacity: 0.55; cursor: default; }
.inbox-agent-typing-caret {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--accent);
  animation: inbox-agent-caret 720ms steps(1, end) infinite;
}
@keyframes inbox-agent-caret { 50% { opacity: 0; } }
.inbox-agent-handoff-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  padding-top: 0.42rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.7rem;
}
.inbox-agent-handoff-notice > span { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.inbox-rich-editor.has-agent-review {
  min-height: 0;
  max-height: min(28rem, 62vh);
  overflow-y: auto;
  padding: 0;
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border-subtle));
  background: var(--bg-elevated);
  cursor: default;
}
.inbox-rich-editor.is-email.has-agent-review:focus-within {
  min-height: 0;
}
.inbox-rich-editor.has-agent-review > .inbox-editor-content-shell {
  min-height: var(--inbox-editor-min-h, 2.8rem);
  padding: 0.5rem 0.55rem;
  background: var(--bg-input);
}
.inbox-agent-review-panel {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 0;
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.inbox-agent-review-panel > header,
.inbox-agent-review-panel > footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
}
.inbox-agent-review-panel > header {
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
}
.inbox-agent-review-panel > header > .inbox-agent-intervention-actions {
  position: static;
  flex: 0 1 auto;
  width: auto;
}
.inbox-agent-review-panel > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
}
.inbox-agent-review-heading {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent);
}
.inbox-agent-review-heading > span {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}
.inbox-agent-review-heading strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-agent-review-heading small,
.inbox-agent-review-panel > footer > small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-agent-review-preview {
  overflow: hidden;
  margin: 0;
  padding: 0.65rem;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}
.inbox-agent-review-preview > strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 750;
}
.inbox-agent-review-preview > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  white-space: pre-wrap;
}
.inbox-agent-review-editor {
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem;
}
.inbox-agent-review-editor > span,
.inbox-agent-review-reason strong {
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 750;
}
.inbox-agent-review-editor > p {
  margin: 0;
  padding: 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.inbox-agent-review-reason {
  margin: 0;
  padding: 0 0.65rem 0.65rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}
.inbox-agent-review-panel button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.26rem 0.65rem;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.inbox-agent-review-panel button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--text-primary);
}
.inbox-agent-review-panel button.is-review,
.inbox-agent-review-panel button.is-approve {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast, #fff);
}
.inbox-agent-review-panel button.is-reject { color: var(--text-muted); }
.inbox-agent-review-panel button:disabled { opacity: 0.55; cursor: default; }
.agent-review-translation {
  min-width: 0;
  margin: 0 0.65rem 0.65rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-muted));
  color: var(--text-soft);
  font-size: 0.7rem;
  line-height: 1.45;
}
.agent-review-translation.is-loading,
.agent-review-translation.is-unavailable {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
}
.agent-review-translation.is-loading { color: var(--text-muted); }
.agent-review-translation.is-unavailable {
  border-color: color-mix(in srgb, var(--state-warning, #d97706) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning, #d97706) 8%, var(--surface-muted));
  color: var(--state-warning, #b45309);
}
.agent-review-translation.is-unavailable > span { display: grid; gap: 0.08rem; }
.agent-review-translation.is-unavailable strong { color: var(--text-primary); }
.agent-review-translation.is-unavailable small { color: var(--text-muted); font-size: 0.64rem; }
.agent-review-translation.is-unavailable button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.agent-review-translation.is-translated { display: grid; gap: 0.35rem; }
.agent-review-translation.is-translated > header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.agent-review-translation.is-translated > header > span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent);
}
.agent-review-translation.is-translated > header strong { color: var(--text-primary); }
.agent-review-translation.is-translated > header small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-review-translation.is-translated > p {
  margin: 0;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.agent-review-translation.is-compact.is-translated > p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}
.inbox-agent-intervention-error {
  width: 100%;
  margin: 0.3rem 0 0;
  color: var(--state-error);
  font-size: 0.68rem;
  line-height: 1.35;
}
@media (prefers-reduced-motion: reduce) {
  .inbox-agent-typing-caret { animation: none; }
}
.inbox-rich-editor .ProseMirror > p { margin: 0 0 0.35rem; }
.inbox-rich-editor .ProseMirror > p:last-child { margin-bottom: 0; }
.inbox-rich-editor .ProseMirror ul,
.inbox-rich-editor .ProseMirror ol { margin: 0.2rem 0; padding-left: 1.2rem; }
.inbox-rich-editor .ProseMirror blockquote {
  margin: 0.2rem 0;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border-strong);
  color: var(--text-soft);
}
.inbox-rich-editor .ProseMirror code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--bg-elevated);
  padding: 0.05rem 0.25rem;
  border-radius: 4px;
}
/* Block-level rich items — only reachable on the email composer (see `emailOnly`
   in InboxComposerEditor). Tokens resolve per-theme, so this is light/dark-safe. */
.inbox-rich-editor .ProseMirror h1,
.inbox-rich-editor .ProseMirror h2,
.inbox-rich-editor .ProseMirror h3 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0.5rem 0 0.3rem;
  color: var(--text-primary);
}
.inbox-rich-editor .ProseMirror h1 { font-size: 1.3rem; }
.inbox-rich-editor .ProseMirror h2 { font-size: 1.1rem; }
.inbox-rich-editor .ProseMirror h3 { font-size: 0.95rem; }
.inbox-rich-editor .ProseMirror h1:first-child,
.inbox-rich-editor .ProseMirror h2:first-child,
.inbox-rich-editor .ProseMirror h3:first-child { margin-top: 0; }
.inbox-rich-editor .ProseMirror ul[data-type="taskList"] {
  list-style: none;
  margin: 0.25rem 0;
  padding-left: 0.1rem;
}
.inbox-rich-editor .ProseMirror ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.15rem 0;
}
.inbox-rich-editor .ProseMirror ul[data-type="taskList"] li > label {
  display: inline-flex;
  align-items: center;
  margin-top: 0.12rem;
  user-select: none;
}
.inbox-rich-editor .ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: #4f46e5;
  cursor: pointer;
}
.inbox-rich-editor .ProseMirror ul[data-type="taskList"] li > div { flex: 1 1 auto; min-width: 0; }
.inbox-rich-editor .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div {
  color: var(--text-muted);
  text-decoration: line-through;
}
.inbox-rich-editor .ProseMirror pre {
  margin: 0.3rem 0;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  line-height: 1.45;
  overflow-x: auto;
}
.inbox-rich-editor .ProseMirror pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}
.inbox-rich-editor .ProseMirror hr {
  border: 0;
  border-top: 1px solid var(--border-strong);
  margin: 0.6rem 0;
}
.inbox-rich-editor .ProseMirror hr.ProseMirror-selectednode { border-top-color: #4f46e5; }
/* TipTap placeholder (the old :empty::before can't work on a wrapper). */
.inbox-rich-editor .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  float: left;
  height: 0;
  pointer-events: none;
}
/* Slash-menu rows: label left, channel hint right. */
.message-composer-slash-item .inbox-slash-item-hint {
  margin-left: auto;
  padding-left: 1rem;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.inbox-compose-resizer {
  /* display:flex (NOT the button-default inline-block): the old inline-block
     sat in a phantom ~19px line box that swallowed margin tuning — block-level
     flex makes the geometry deterministic. height 12px = the grab target; the
     visible 3px pill centers inside it. */
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: ns-resize;
  position: relative;
}

.inbox-compose-resizer.top {
  /* 7px + the pill centered in 12px ≈ 11.5px visual air below the sentiment
     row — matching the ~11px above it (compose padding-top), so the row sits
     EQUALLY between the top border and the pill (Figma composer band). */
  margin: 7px 0 0;
}

.inbox-compose-resizer::before {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  border-radius: 999px;
  background: var(--border-strong);
}

.inbox-compose-actions {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
  flex-wrap: wrap;
}
.inbox-compose-actions-right {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.inbox-signature-panel {
  margin-top: 0.45rem;
  padding: 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-input) 40%, transparent);
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.inbox-signature-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.inbox-signature-mode {
  display: grid;
  gap: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.inbox-signature-mode .selectmenu-trigger {
  font-size: 0.8rem;
}

.inbox-signature-toolbar {
  display: flex;
  gap: 0.25rem;
}

.inbox-signature-toolbar button {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
}

.inbox-signature-toolbar button:hover {
  border-color: var(--border-strong);
}

.inbox-signature-toolbar .ui-icon {
  width: 15px;
  height: 15px;
}

.inbox-signature-panel textarea,
.inbox-signature-textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  font-size: 0.82rem;
}

.inbox-signature-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.inbox-signature-fields-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.inbox-signature-chip {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  cursor: pointer;
}

.inbox-signature-chip:hover {
  border-color: var(--accent);
}

.inbox-signature-preview {
  display: grid;
  gap: 0.25rem;
}

.inbox-signature-preview-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.inbox-signature-preview-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.inbox-signature-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

/* Email message rendering — faithful (Gmail-like) HTML in a sandboxed iframe, or a
   whitespace-preserving plain-text fallback for messages stored before HTML capture. */
.inbox-email-frame {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #ffffff;
  display: block;
  overflow: hidden;
}

.inbox-email-plain {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  /* Give a text-only email (no captured body_html) the same card shell as the HTML
     frame so it reads as an email rather than a naked wall of text/links. */
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.inbox-email-plain a {
  color: var(--accent);
  text-decoration: underline;
}

/* Airbnb / OTA bodies that arrive as raw HTML (e.g. "Guest alteration accepted"
   tables). Rendered structurally via StructuredHtmlBody; styled here so they
   inherit the app theme in BOTH light and dark — the sender's inline colours are
   stripped by the sanitizer, so these rules are the whole look. */
.inbox-html-body {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.inbox-html-body table {
  border-collapse: collapse;
  width: 100%;
  max-width: 100%;
  margin: 0.25rem 0;
  font-size: 0.8125rem;
}
.inbox-html-body th,
.inbox-html-body td {
  border: 1px solid var(--border-subtle);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.inbox-html-body th {
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--text-soft);
}
/* Airbnb tags the comparison columns with .text-center — honour it. */
.inbox-html-body .text-center {
  text-align: center;
}
.inbox-html-body small {
  color: var(--text-muted);
}
.inbox-html-body a {
  color: var(--accent);
  text-decoration: underline;
}
.inbox-html-body p {
  margin: 0 0 0.4rem;
}
.inbox-html-body p:last-child {
  margin-bottom: 0;
}

/* UOS internal messages render their saved composer HTML (body_html) so @-mention /
   task-reference chips + inline formatting survive the send (§3). Inherits .inbox-html-body
   for paragraphs / links; this tightens lists, blockquote and inline code so they sit calmly
   inside the internal bubble. Tokens only ⇒ light/dark by construction; chips are styled by
   the shared .mention-chip rules (per-kind colour). */
.inbox-uos-body {
  line-height: 1.5;
}
.inbox-uos-body ul,
.inbox-uos-body ol {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}
.inbox-uos-body li {
  margin: 0.05rem 0;
}
.inbox-uos-body blockquote {
  margin: 0.25rem 0;
  padding-left: 0.6rem;
  border-left: 2px solid var(--border-strong);
  color: var(--text-muted);
}
.inbox-uos-body code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.9em;
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  padding: 1px 4px;
  border-radius: 4px;
}
.inbox-uos-body pre {
  margin: 0.25rem 0;
  padding: 0.5rem 0.6rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow-x: auto;
}
.inbox-uos-body pre code {
  background: none;
  padding: 0;
}
/* Document blocks — a UOS message renders like a ClickUp doc: headings, dividers,
   checklists and blank lines survive the send exactly as composed ("i should be
   able to write a whole formatted article", Hakim 2026-07-02). Mirrors the
   .inbox-rich-editor block styles so composed ≈ saved, tokens only. */
.inbox-uos-body h1,
.inbox-uos-body h2,
.inbox-uos-body h3 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0.5rem 0 0.3rem;
  color: inherit;
}
.inbox-uos-body h1 { font-size: 1.3rem; }
.inbox-uos-body h2 { font-size: 1.1rem; }
.inbox-uos-body h3 { font-size: 0.95rem; }
.inbox-uos-body h1:first-child,
.inbox-uos-body h2:first-child,
.inbox-uos-body h3:first-child { margin-top: 0; }
.inbox-uos-body hr {
  border: none;
  border-top: 1px solid var(--border-strong);
  margin: 0.6rem 0;
}
/* An intentionally blank line (empty <p>) keeps its height instead of collapsing —
   part of "render exactly like how it was written". */
.inbox-uos-body p:empty::before {
  content: "\00a0";
}
.inbox-uos-body ul[data-type="taskList"] {
  list-style: none;
  padding-left: 0.1rem;
}
.inbox-uos-body ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.15rem 0;
}
.inbox-uos-body ul[data-type="taskList"] li > label {
  display: inline-flex;
  align-items: center;
  margin-top: 0.12rem;
}
.inbox-uos-body ul[data-type="taskList"] li > label input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: #4f46e5;
  /* Render-only — the sanitizer disables it; make sure it doesn't LOOK dimmed-broken. */
  opacity: 1;
  pointer-events: none;
}
.inbox-uos-body ul[data-type="taskList"] li > div { flex: 1 1 auto; min-width: 0; }
.inbox-uos-body ul[data-type="taskList"] li[data-checked="true"] > div {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Wide tables scroll horizontally on small screens instead of overflowing pane 3. */
@media (max-width: 768px) {
  .inbox-html-body {
    overflow-x: auto;
  }
}

/* Dropdown variant — replaces the inline chip row to keep the
   composer toolbar compact. Native <select> kept underneath so we
   inherit cross-browser keyboard/touch handling for free. */

/* .brand-monogram-mark removed 2026-07-11 — collapsed rail renders <Wordmark markOnly />. */

.inbox-compose-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: auto;
  flex-wrap: wrap;
  /* Shrink beside the send cluster instead of claiming the whole line — at
     tablet/narrow-pane widths the full-width tools block pushed counter+send
     onto their own row, leaving a dead band above the send button (iPad,
     2026-07-20). Internal wrap still handles genuinely tight fits. */
  flex: 1 1 auto;
  min-width: 0;
}
/* When the tools stack into two+ internal lines, keep send anchored to the
   BOTTOM line (next to the icons), not floating mid-height. */
.inbox-compose-actions { align-items: flex-end; }
.inbox-compose-actions-right { align-self: flex-end; }

/* Channel switcher chip (matches the tool icons in height + chrome,
   fits the platform logo + label + caret without overflow). Custom
   dropdown rather than a native <select> because we need the
   platform logo on each option, and native selects can't render
   that without a third-party library. Sizing rules (`max-width`,
   `min-width: 0`, ellipsis on the label) keep the chip from
   stretching past its column when the label is long like
   "Booking.com Chat". */
.inbox-channel-switcher {
  position: relative;
  display: inline-flex;
}
.inbox-channel-switcher-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px 0 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  border-radius: 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  max-width: 180px;
  min-width: 0;
  transition: background 100ms ease, border-color 100ms ease;
}
.inbox-channel-switcher-trigger:hover {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 40%, var(--border-subtle));
}
.inbox-channel-switcher-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.inbox-channel-switcher-icon .inbox-platform-logo {
  width: 16px;
  height: 16px;
}
.inbox-channel-switcher-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-channel-switcher-caret {
  color: var(--text-muted);
  flex: 0 0 auto;
}
.inbox-channel-switcher-menu {
  /* Position is set inline at open time via JS — body-portaled so it
     escapes the inbox composer's clipping parents. The default
     `position: fixed` style here is a fallback for any consumer that
     forgets to set it explicitly. */
  position: fixed;
  z-index: 200;
  min-width: 200px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.inbox-channel-switcher-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
}
.inbox-channel-switcher-item:hover,
.inbox-channel-switcher-item.is-active {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Send icon button — matches inbox-tool-btn dimensions + chrome but
   uses the accent gradient so it reads as the primary action. */
.inbox-send-btn {
  width: 36px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient, linear-gradient(135deg, #6366f1, #8b5cf6));
  color: #fff;
  cursor: pointer;
  transition: opacity 100ms ease;
}
.inbox-send-btn:hover:not(:disabled) {
  opacity: 0.9;
}
.inbox-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.inbox-tool-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  /* Borderless to match the reference screenshot — the channel
     switcher carries the chrome; tool icons read as lightweight
     glyphs on the composer surface. Hover gives them a subtle
     fill so the click target stays discoverable. */
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.inbox-tool-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.inbox-tool-btn.is-active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}

/* ── Email composer: a real formatting toolbar (email channel only) ──────────
   A slim icon bar pinned to the top of the .is-email editor box so writing an
   email feels like Gmail, not a chat strip. It bleeds to the box edges and is
   sticky so it stays put while a long draft scrolls under it. */
/* Toolbar appears when you're actually writing (focus or a non-empty draft keeps
   the editor tall anyway) — an idle email thread shouldn't spend a row of the
   reading area on B/I/U buttons, same as Gmail's collapsed reply. */
.inbox-rich-editor.is-email:not(:focus-within) .inbox-email-toolbar {
  display: none;
}
.inbox-email-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  /* Bleed to the box edges at the top; a roomier gap BELOW so the first line of the
     email body isn't cramped against the toolbar (Hakim 2026-06-28: wanted a bigger gap
     between the formatting bar and the first line). */
  margin: -0.85rem -0.95rem 1.5rem;
  padding: 0.5rem 0.8rem;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.inbox-email-tool {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.inbox-email-tool:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
}
.inbox-email-tool.is-active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}
.inbox-email-tool-sep {
  width: 1px;
  align-self: stretch;
  margin: 3px 4px;
  background: var(--border-subtle);
}
/* Email reply header — Gmail-style Cc / Bcc / Subject + Reply / Reply-all, shown
   above the message box on email threads (the signature preview sits below it).
   Token-based for light + dark; rows wrap + min-width:0 so it survives narrow panes. */
.inbox-email-head {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.35rem 0.1rem 0.5rem;
  margin-bottom: 0.15rem;
  border-bottom: 1px solid var(--border-subtle);
  min-width: 0;
}
.inbox-email-head-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex-wrap: wrap;
}
/* #5 — Cc/Bcc button cluster inline at the right of the To field */
.inbox-email-head-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex: 0 0 auto;
  margin-left: auto;
}
.inbox-email-head-add {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
}
.inbox-email-head-add:hover {
  color: var(--accent);
  background: var(--bg-input);
}
.inbox-email-head-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.inbox-email-head-label {
  flex: 0 0 auto;
  width: 3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.inbox-email-head-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
  padding: 0.25rem 0.1rem;
}
.inbox-email-head-input:focus {
  outline: none;
  border-bottom-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
}
.inbox-email-head-input::placeholder {
  color: var(--text-muted);
}
/* Recipient typeahead (To / Cc / Bcc) — the wrap replaces the bare <input> as the
   field's flex child and anchors the known-contact suggestions dropdown. Tokenised for
   light + dark parity; min-width:0 keeps it inside narrow panes (<768px). */
.inbox-recip-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-recip-wrap .inbox-email-head-input {
  width: 100%;
}
.inbox-recip-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--text-primary) 12%, transparent);
  max-height: 13rem;
  overflow-y: auto;
}
.inbox-recip-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.inbox-recip-option:hover,
.inbox-recip-option.is-active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
/* Gmail grammar: avatar disc, then a name-over-address column. The avatar is
   the canonical ContactAvatar (photo or animal placeholder) — the class pair
   sizes BOTH its render paths, and the fallback needs explicit box rules or
   the disc collapses to its bare glyph (fb_ui_craft). */
.inbox-recip-avatar,
.inbox-recip-avatar-ph {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}
.inbox-recip-option-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.inbox-recip-option-name {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
}
.inbox-recip-option-email {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.2;
}
/* Workspace members are marked apart from guests/contacts ("User" — the
   product's word for a person with a login; "team" is banned copy). */
.inbox-recip-option-badge {
  flex: none;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
/* Main emoji menu escapes short-screen compose clipping; nested replies portal. */
.inbox-emoji-anchor {
  position: relative;
  display: inline-flex;
}
.inbox-emoji-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(8, 1.75rem);
  gap: 2px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  width: max-content;
  max-width: min(17rem, 92vw);
  max-height: 14rem;
  overflow-y: auto;
}
.inbox-compose:has(.inbox-emoji-pop) { overflow: visible; z-index: 20; }
.inbox-emoji-item {
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 1.05rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 80ms ease;
}
.inbox-emoji-item:hover {
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
}
/* Expand/collapse toggle — the chevron flips when the box is expanded. */
.inbox-compose-expand .ui-icon {
  transition: transform 150ms ease;
}
.inbox-compose-expand.is-expanded .ui-icon {
  transform: rotate(180deg);
}
/* Link-entry popover — a small floating card anchored to the link button. */
.inbox-email-link-pop {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}
.inbox-email-link-input {
  width: 220px;
  max-width: 48vw;
  height: 30px;
  padding: 0 8px;
  font-size: 0.82rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.inbox-email-link-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
}
.inbox-email-link-apply {
  height: 30px;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-contrast, #fff);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.inbox-email-link-apply:hover {
  filter: brightness(1.06);
}

/* ── Email signature footer (Gmail-style) ───────────────────────────────────
   The signature lives BELOW the message box as a non-editable preview and is
   appended on send — never dumped into the editable area as raw text. A switch
   includes/omits it per message. */
.inbox-sig-footer {
  margin: 0.4rem 0 0;
  padding: 0.5rem 0.15rem 0;
  border-top: 1px dashed var(--border-subtle);
}
.inbox-sig-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.inbox-sig-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.inbox-sig-switch-track {
  position: relative;
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 120ms ease;
  flex: 0 0 auto;
}
.inbox-sig-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 120ms ease;
}
.inbox-sig-switch[aria-checked="true"] .inbox-sig-switch-track {
  background: var(--accent);
}
.inbox-sig-switch[aria-checked="true"] .inbox-sig-switch-thumb {
  transform: translateX(13px);
}
.inbox-sig-switch[aria-checked="true"] .inbox-sig-switch-label {
  color: var(--text-primary);
}
.inbox-sig-edit-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}
.inbox-sig-edit-link:hover {
  text-decoration: underline;
}
.inbox-sig-footer.is-off .inbox-sig-footer-bar {
  opacity: 0.7;
}

/* Quick-reply buttons composer (WhatsApp, in-session) — the operator adds up to
   3 tappable labels above the toolbar; guests tap one to reply. */
.inbox-quickreply {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.45rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-elevated));
}
.inbox-quickreply-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.inbox-quickreply-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
}
.inbox-quickreply-hint {
  font-size: 0.66rem;
  color: var(--text-soft);
}
.inbox-quickreply-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.inbox-quickreply-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.inbox-quickreply-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.78rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.inbox-quickreply-input:focus {
  outline: none;
  border-color: var(--accent);
}
.inbox-quickreply-remove {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}
.inbox-quickreply-remove:hover {
  color: var(--state-error);
  background: color-mix(in srgb, var(--state-error) 12%, transparent);
}
.inbox-quickreply-add {
  align-self: flex-start;
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  border-radius: 6px;
  cursor: pointer;
}
.inbox-quickreply-add:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
/* #23 — list-picker composer: the menu-button label sits above the options, and
   each option stacks its title + an optional description. Reuses the quick-reply
   input/remove/add styling above; tokens carry light/dark. */
.inbox-list-button-input {
  font-weight: 600;
}
.inbox-list-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
}
.inbox-list-item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}
.inbox-list-item-desc {
  font-size: 0.72rem;
  color: var(--text-soft);
}

/* ── Voice (item 10) ───────────────────────────────────────────────────── */
/* Header "Call" button — mirrors the tag trigger. */

/* Call bubble — a call as a first-class thread message. */
.inbox-voice-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: 320px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.inbox-voice-card.is-missed {
  border-color: color-mix(in srgb, var(--state-danger, #dc2626) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-danger, #dc2626) 7%, var(--bg-elevated));
}
.inbox-voice-icon {
  display: inline-flex;
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}
.inbox-voice-card.is-missed .inbox-voice-icon {
  color: var(--state-danger, #dc2626);
}
.inbox-voice-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  /* 🔴 flex: 1 IS THE POINT OF THE FULL-WIDTH CALL CARD. Staff feedback #40 widened
     the card to span the conversation (see the .inbox-msg:has(…) block below), but the
     card is a flex ROW of icon + this body, and a flex item defaults to flex-grow: 0.
     So the box got wider and everything inside it stayed at content width, sat over on
     the left with a lake of empty card to its right — the summary, the transcript and
     the recording player all squeezed into a narrow strip. Hakim, 2026-07-27: "whats
     the point in making the call full width on the thread if all of its contents remain
     narrow?" Growing the body is what actually spends the width. Harmless in the two
     places the card is NOT full width (a call shared into another thread, and the phone)
     — there it simply fills the card it is already in. */
  flex: 1 1 auto;
}
.inbox-voice-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.inbox-voice-transcript {
  font-size: 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.inbox-voice-audio {
  width: 240px;
  max-width: 100%;
  height: 34px;
  margin-top: 2px;
}

/* Our own recording player (components/inbox/CallRecordingPlayer.tsx) — replaces
   <audio controls> on a call card. The native iOS control labels a clip whose length it
   cannot determine "Live Broadcast", inside a shadow root we cannot touch, so a finished
   call read as live (TestFlight #46). The <audio> stays for playback and is hidden. */
.call-rec {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Was a hard 240px, chosen when the call card was a 320px chat bubble. On the
     full-width card that left a stub of a scrub bar floating in a wide box — the same
     complaint as the body above, and a longer bar is genuinely better to seek with.
     It now fills whatever card it is in, so it stays compact inside the small card a
     shared call renders as and stretches on a full-width one. min-width: 0 stops the
     time labels forcing an overflow in the narrow case. Only ever rendered inside
     .inbox-voice-body. */
  width: 100%;
  min-width: 0;
  margin-top: 4px;
}
.call-rec-media {
  display: none;
}
.call-rec-btn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  /* 28px on desktop; the phone override below takes it to a real touch target. */
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.call-rec-btn:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.call-rec-btn:focus-visible,
.call-rec-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.call-rec-bar {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  /* The hit area is taller than the visible track — a 4px bar is unhittable with a thumb.
     The track itself is drawn by ::before so the padding stays invisible. */
  height: 20px;
  cursor: pointer;
  touch-action: none;
}
.call-rec-bar::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 25%, transparent);
}
.call-rec-fill {
  position: absolute;
  inset: 8px auto 8px 0;
  border-radius: 999px;
  background: var(--accent);
}
.call-rec-time {
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
/* Phone: a 28px circle is not a touch target. */
.phone-app .call-rec {
  width: 100%;
  gap: 10px;
}
.phone-app .call-rec-btn {
  width: 34px;
  height: 34px;
  position: relative;
}
/* The circle STAYS 34px so the recording card keeps its density, but the hit
   area is the full 44px iOS target. The row's 10px gap absorbs 5px each side,
   so this never overlaps the scrub bar and steals a seek. */
.phone-app .call-rec-btn::after {
  content: "";
  position: absolute;
  inset: -5px;
}
/* The base rule only ever styled :hover — which a touch screen either never
   applies or leaves stuck on after the tap, so playing a recording gave no
   feedback at all. */
.phone-app .call-rec-btn:active {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
}
.phone-app .call-rec-bar {
  height: 30px;
}
.phone-app .call-rec-bar::before,
.phone-app .call-rec-fill {
  inset-block: 13px;
}
.phone-app .call-rec-time {
  font-size: 12px;
}

/* Call Intelligence (V4): the AI summary block + transcript toggle on a call card. */
.inbox-voice-card.has-intel {
  max-width: 380px;
}
/* Staff feedback #40: a call is a TWO-WAY conversation, not a one-sided message —
   its card spans the full conversation width, borrowing the email card's escape
   from the 85% chat-bubble cap (see .inbox-bubble.is-email above). The bubble
   chrome drops away (transparent, no padding) so the card's own frame stands
   alone instead of double-boxing. DIRECT-CHILD selectors do two jobs at once:
   they keep this JSX-free (email precedent), and they exclude a call shared
   INTO another thread — there the card's parent is .shared-msg-body, not the
   bubble, so the share embed stays a compact quote. ⚠️ Do NOT rewrite these
   with :not(:has(...)) alongside :has() ancestors — :has() must not nest
   inside :has(), and the invalid selector silently drops the whole rule
   (first version of this fix shipped dead for exactly that reason). */
.inbox-msg:has(> .inbox-msg-body > .inbox-bubble > .inbox-voice-card) > .inbox-msg-body {
  max-width: 100%;
  width: 100%;
}
.inbox-msg > .inbox-msg-body > .inbox-bubble:has(> .inbox-voice-card) {
  width: 100%;
  max-width: 100%;
}
.inbox-bubble.in:has(> .inbox-voice-card),
.inbox-bubble.out:has(> .inbox-voice-card) {
  background: transparent;
  padding: 0;
}
.inbox-bubble > .inbox-voice-card {
  width: 100%;
  max-width: 100%;
}
.inbox-voice-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border-subtle));
}
.inbox-voice-summary-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.inbox-voice-spark {
  display: inline-flex;
  flex: none;
  color: var(--accent);
}
.inbox-voice-summary-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}
.inbox-voice-sentiment {
  margin-left: auto;
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.inbox-voice-sentiment.is-positive {
  color: var(--state-success, #16a34a);
  background: color-mix(in srgb, var(--state-success, #16a34a) 12%, transparent);
  border-color: color-mix(in srgb, var(--state-success, #16a34a) 30%, transparent);
}
.inbox-voice-sentiment.is-negative {
  color: var(--state-danger, #dc2626);
  background: color-mix(in srgb, var(--state-danger, #dc2626) 12%, transparent);
  border-color: color-mix(in srgb, var(--state-danger, #dc2626) 30%, transparent);
}
.inbox-voice-sentiment.is-neutral {
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  border-color: var(--border-subtle);
}
.inbox-voice-tldr {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.inbox-voice-actions {
  margin: 2px 0 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: disc;
}
.inbox-voice-actions li {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.inbox-voice-feedback {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border-subtle));
}
.inbox-voice-feedback > strong {
  display: block;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-secondary);
}
.inbox-voice-toggle {
  align-self: flex-start;
  margin-top: 2px;
  padding: 0;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.inbox-voice-toggle:hover {
  text-decoration: underline;
}
.inbox-voice-track-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}
.inbox-voice-track {
  display: grid;
  gap: 5px;
}
.inbox-voice-track > span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 650;
}
.inbox-voice-attendance-chapters {
  display: grid;
  gap: 9px;
  margin-top: 4px;
}
.inbox-voice-attendance-chapter {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input, var(--bg-elevated));
}
.inbox-voice-attendance-chapter > span {
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 680;
}
.inbox-voice-attendance-chapter > small {
  color: var(--text-muted);
  font-size: 10px;
}
/* "Call back" action on a missed inbound call / voicemail (rendered only when
   the surface passes onCallBack — the phone conversation today). */
.inbox-voice-callback {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 6px 12px;
  border: 0;
  border-radius: 14px;
  background: #22c55e;
  color: #04250f;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
[data-theme="light"] .inbox-voice-callback {
  background: #16a34a;
  color: #ffffff;
}
.inbox-voice-transcript-full {
  margin-top: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-input, var(--bg-subtle, var(--bg-elevated)));
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow-y: auto;
}
/* Speaker-labelled transcript (voice_data.transcript_turns) — one block per turn, the
   speaker's name as a small bold cap above their words. Tokens only (light/dark parity). */
.inbox-voice-transcript-turns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  white-space: normal;
}
.inbox-voice-turn {
  display: block;
}
.inbox-voice-turn-speaker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 1px;
}
.inbox-voice-turn-text {
  display: block;
  color: var(--text-muted);
}
@media (max-width: 768px) {
  .inbox-voice-card.has-intel {
    max-width: 100%;
  }
}

/* Floating softphone bar — incoming / connecting / in-call. */
.softphone-bar {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Wide enough for the in-call control row (7 × 38px + gaps ≈ 314px) to sit on its own
     wrapped line without spilling off the right edge — the "half the buttons unreachable" fix. */
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.22),
    0 3px 10px rgba(0, 0, 0, 0.12);
  animation: softphone-rise 0.18s ease-out;
}
/* Wave 9 — app-wide floating dock: minimise control + the collapsed pill it folds into. */
.softphone-collapse {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: -2px 4px -2px -2px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.softphone-collapse:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--text-primary);
}
/* Phone round-2: drag handle, EXPAND size, + the unmissable recording pill. */
.softphone-draggable {
  cursor: grab;
  touch-action: none;
}
.softphone-draggable:active {
  cursor: grabbing;
}
.softphone-bar.is-expanded {
  width: 440px;
  gap: 14px;
  padding: 16px 18px;
}
.softphone-rec-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  margin-top: 3px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: color-mix(in srgb, var(--state-danger, #dc2626) 16%, transparent);
  color: var(--state-danger, #dc2626);
}
.softphone-rec-pill.is-paused {
  background: var(--surface-muted);
  color: var(--text-muted);
}
/* A quality problem the SDK is measuring RIGHT NOW. Amber, not red: the call still works, it
   just sounds bad, and a red alarm on a working call trains people to ignore red. */
.softphone-quality-warning {
  align-self: flex-start;
  margin-top: 3px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: color-mix(in srgb, var(--state-warning) 16%, transparent);
  color: var(--state-warning);
}
.softphone-rec-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.softphone-rec-pill.is-on .softphone-rec-pill-dot {
  animation: softphone-rec-pulse 1.3s ease-in-out infinite;
}
@keyframes softphone-rec-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .softphone-rec-pill.is-on .softphone-rec-pill-dot {
    animation: none;
  }
}
.softphone-min {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 12000;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px 7px 13px;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  box-shadow:
    0 18px 44px rgba(0, 0, 0, 0.22),
    0 3px 10px rgba(0, 0, 0, 0.12);
  animation: softphone-rise 0.18s ease-out;
}
.softphone-min-expand {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}
.softphone-min-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.softphone-min-sub {
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.softphone-min-hang {
  flex: none;
}
@keyframes softphone-rise {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .softphone-bar,
  .softphone-min {
    animation: none;
  }
}
.softphone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.softphone-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}
.softphone-dot[data-state="incoming"] {
  background: var(--state-success, #16a34a);
  animation: softphone-pulse 1.1s ease-in-out infinite;
}
.softphone-dot[data-state="connecting"] {
  background: var(--accent);
  animation: softphone-pulse 1.1s ease-in-out infinite;
}
.softphone-dot[data-state="in-call"] {
  background: var(--state-success, #16a34a);
}
@keyframes softphone-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .softphone-dot,
  .voice-presence-dot { animation: none !important; }
}
.softphone-peer {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.softphone-peer-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.softphone-peer-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.softphone-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
}
.softphone-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}
.softphone-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.softphone-btn.is-active {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-input));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
}
.softphone-accept {
  background: var(--state-success, #16a34a);
  border-color: var(--state-success, #16a34a);
  color: #fff;
}
.softphone-accept:hover {
  background: color-mix(in srgb, var(--state-success, #16a34a) 88%, #000);
}
.softphone-decline {
  background: var(--state-danger, #dc2626);
  border-color: var(--state-danger, #dc2626);
  color: #fff;
}
.softphone-decline:hover {
  background: color-mix(in srgb, var(--state-danger, #dc2626) 88%, #000);
}
.softphone-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.softphone-key {
  padding: 8px 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.12s ease;
}
.softphone-key:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-input));
}

/* V6 live-call controls — transfer/warm/add sub-bar, consult row + error toast. */
.softphone-subbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.softphone-transfer-input {
  flex: 1 1 110px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}
.softphone-transfer-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-subtle));
}
.softphone-subbtn {
  flex: none;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}
.softphone-subbtn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.softphone-subbtn:disabled {
  opacity: 0.5;
  cursor: default;
}
.softphone-subbtn-go {
  background: var(--state-success, #16a34a);
  border-color: var(--state-success, #16a34a);
  color: #fff;
}
.softphone-subclose {
  width: 32px;
  padding: 0;
}
.softphone-consult {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.softphone-toast {
  font-size: 12px;
  color: var(--state-danger, #dc2626);
  background: color-mix(in srgb, var(--state-danger, #dc2626) 10%, var(--bg-input));
  border: 1px solid color-mix(in srgb, var(--state-danger, #dc2626) 30%, var(--border-subtle));
  border-radius: 8px;
  padding: 6px 10px;
}
/* V6b — warm-transfer consult row status + the positive "Complete" action + the on-hold dot. */
.softphone-substatus {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.softphone-subok {
  background: var(--state-success, #16a34a);
  border-color: var(--state-success, #16a34a);
  color: #fff;
}
.softphone-subok:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--state-success, #16a34a) 70%, #000);
}
.softphone-dot[data-state="hold"] {
  background: var(--state-warning, #d97706);
}
@media (max-width: 768px) {
  .softphone-bar {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
  }
  .softphone-min {
    right: 12px;
    bottom: 12px;
  }
}

/* V6 — "who's on a call" rail (inbox), call-card transfer line, settings call analytics. */
.voice-presence-rail {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 240px;
}
.voice-presence-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 12px;
}
.voice-presence-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--state-success, #16a34a);
}
.voice-presence-dot[data-status="ringing"] {
  background: var(--accent);
  animation: softphone-pulse 1.1s ease-in-out infinite;
}
.voice-presence-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.voice-presence-peer {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
/* How long the call has been running — half of "I can't see the call" (TestFlight #42).
   Pushed to the right so the name can take whatever width is left. */
.voice-presence-timer {
  margin-left: auto;
  padding-left: 6px;
  flex: none;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
/* A pill whose call has a thread OPENS it. Only this variant gets the affordance — a call
   still ringing has nothing to open yet and stays a plain label, because a button that does
   nothing is the bug (#42). */
button.voice-presence-item {
  font: inherit;
  text-align: left;
  width: 100%;
}
.voice-presence-item.is-openable {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.voice-presence-item.is-openable:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
}
.voice-presence-item.is-openable:active {
  transform: scale(0.98);
}
.voice-presence-item.is-openable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (max-width: 768px) {
  /* Full width and a real height: on the phone this pill is the ONLY way into a live call,
     and a 12px-tall strip is not a tap target. */
  .voice-presence-rail {
    left: 12px;
    right: 12px;
    bottom: var(--ph-tabbar-stack-bottom, 84px);
    max-width: none;
  }
  .voice-presence-item {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
  }
  /* 🔴 The bottom of a phone belongs to the composer and the full call layer owns its
     controls. This fixed colleague-call pill used to cover the message box and End button.
     Match all rendered protected surfaces as a second line of defence because the rail is
     mounted globally by the Softphone provider. */
  body:has(.ph-composer) .voice-presence-rail,
  body:has(.inbox-td-composer.is-phone-thread) .voice-presence-rail,
  body:has(.ph-call-layer) .voice-presence-rail {
    display: none;
  }
}

.inbox-voice-transfer {
  font-size: 12px;
  color: var(--text-muted);
}

/* Call lifecycle (Phone round-2): "Picked up by X", who placed the call, + a live pulse while
   the call is still ringing/connected (mirrors the .is-missed accent treatment, with --accent). */
.inbox-voice-pickup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-soft);
}
.inbox-voice-pickup::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.inbox-voice-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.inbox-voice-private {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}
/* "A call is happening in this thread right now" — sits in the thread header, above the
   conversation. Tokens only, so light and dark both work; the accent tint is mixed rather than
   hardcoded so it follows whatever accent the theme sets. */
.inbox-live-call {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.35;
}
.inbox-live-call svg {
  color: var(--accent);
  flex: none;
}
.inbox-live-call-text {
  min-width: 0;
}
.inbox-live-call-meta {
  color: var(--text-muted);
}
/* Listen in on a live call. The control sits at the end of the banner and wraps underneath on a
   narrow pane rather than squeezing the description of the call itself. */
.inbox-live-call-listeners {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.inbox-live-call-listeners svg {
  color: var(--text-muted);
}
.inbox-live-call-error {
  color: color-mix(in srgb, var(--state-error) 82%, var(--text));
}
.inbox-live-call-listen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 4px 10px;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.inbox-live-call-listen:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.inbox-live-call-listen:disabled {
  opacity: 0.6;
  cursor: default;
}
.inbox-live-call-listen.is-listening {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast, #fff);
}
.inbox-live-call-listen.is-listening svg {
  color: inherit;
}
/* Small screens: the meta wraps under the lead rather than overflowing the header. */
@media (max-width: 620px) {
  .inbox-live-call {
    font-size: 12px;
    padding: 6px 9px;
  }
}

.inbox-voice-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
  animation: inbox-voice-pulse 1.4s ease-in-out infinite;
}
.inbox-voice-card.is-live {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
}
@keyframes inbox-voice-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}
/* Pending AI pass on an answered call — the window between hangup and the voice-intelligence
   cron landing its summary. Same pulse as the live dot, muted (it's housekeeping, not a call). */
/* The call-quality note. Amber for "some issues", red for "poor" — a call that was genuinely
   unusable should look different from one that merely wobbled. */
.inbox-voice-quality {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--state-warning);
}
.inbox-voice-quality[data-verdict="poor"] {
  color: var(--state-danger);
}
.inbox-voice-quality-detail {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-muted);
}
.inbox-voice-transcribing {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}
.inbox-voice-transcribing-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: inbox-voice-pulse 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .inbox-voice-live-dot,
  .inbox-voice-transcribing-dot {
    animation: none;
  }
}

.vp-analytics {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.vp-analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.vp-range {
  display: inline-flex;
  gap: 4px;
}
.vp-range-btn {
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}
.vp-range-btn.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-input));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  color: var(--accent);
}
.vp-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
}
.vp-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
}
.vp-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.vp-stat-label {
  font-size: 11px;
  color: var(--text-muted);
}

.uos-health {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}
.uos-health-toolbar,
.uos-health-section-head,
.uos-health-call-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.uos-health-refresh,
.uos-health-open-thread {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  text-decoration: none;
  padding: 6px 9px;
  cursor: pointer;
}
.uos-health-refresh:disabled {
  cursor: default;
  opacity: 0.6;
}
.uos-health-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.uos-health-metrics > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 2px 8px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
  min-width: 0;
}
.uos-health-metrics svg {
  grid-row: 1 / span 2;
  color: var(--accent);
}
.uos-health-metrics strong {
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.uos-health-metrics span {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
}
.uos-health-metrics .is-warning svg,
.uos-health-metrics .is-warning strong,
.uos-health-section-head > span.is-warning,
.uos-health-devices em.is-warning {
  color: var(--warning);
}
.uos-health-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border-subtle));
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--warning) 7%, var(--bg-input));
  color: var(--text-secondary);
  font-size: 12px;
}
.uos-health-notice svg {
  flex: 0 0 auto;
  color: var(--warning);
}
.uos-health-section {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}
.uos-health-section-head {
  align-items: flex-end;
}
.uos-health-section-head h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
}
.uos-health-section-head p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}
.uos-health-section-head > span {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 650;
}
.uos-health-devices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 7px;
}
.uos-health-devices > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-input);
}
.uos-health-devices > div > svg {
  flex: 0 0 auto;
  color: var(--text-muted);
}
.uos-health-devices > div > span {
  display: grid;
  min-width: 0;
  flex: 1;
}
.uos-health-devices strong,
.uos-health-devices small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-health-devices strong {
  color: var(--text-primary);
  font-size: 12px;
}
.uos-health-devices small {
  color: var(--text-muted);
  font-size: 10px;
}
.uos-health-devices em {
  color: var(--text-secondary);
  font-size: 10px;
  font-style: normal;
  font-weight: 650;
}
.uos-health-devices em.is-ready {
  color: var(--success);
}
.uos-health-calls {
  display: grid;
  gap: 6px;
}
.uos-health-calls details {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
  overflow: hidden;
}
.uos-health-calls summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(130px, auto) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.uos-health-calls summary::-webkit-details-marker {
  display: none;
}
.uos-health-calls details[open] summary > svg {
  transform: rotate(90deg);
}
.uos-health-outcome {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--text-muted);
}
.uos-health-outcome.is-live,
.uos-health-outcome.is-connected {
  background: var(--success);
}
.uos-health-outcome.is-answered-no-audio,
.uos-health-outcome.is-failed {
  background: var(--danger);
}
.uos-health-outcome.is-not-answered {
  background: var(--warning);
}
.uos-health-call-copy,
.uos-health-call-result {
  display: grid;
  min-width: 0;
}
.uos-health-call-copy strong,
.uos-health-call-result strong {
  color: var(--text-primary);
  font-size: 12px;
}
.uos-health-call-copy small,
.uos-health-call-result small {
  color: var(--text-muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-health-call-result {
  text-align: right;
}
.uos-health-call-detail {
  align-items: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding: 10px 12px 12px;
}
.uos-health-timeline {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.uos-health-timeline > p,
.uos-health-empty,
.uos-health-loading {
  margin: 0;
  font-size: 12px;
}
.uos-health-timeline > div {
  display: grid;
  grid-template-columns: auto 96px minmax(110px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 3px 8px;
  min-width: 0;
}
.uos-health-timeline > div > span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}
.uos-health-timeline time,
.uos-health-timeline small {
  color: var(--text-muted);
  font-size: 10px;
}
.uos-health-timeline strong {
  color: var(--text-primary);
  font-size: 11px;
}
.uos-health-timeline code {
  grid-column: 2 / -1;
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font: 10px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (max-width: 700px) {
  .uos-health-section-head,
  .uos-health-call-detail {
    align-items: stretch;
    flex-direction: column;
  }
  .uos-health-calls summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .uos-health-call-result {
    grid-column: 2;
    text-align: left;
  }
  .uos-health-timeline > div {
    grid-template-columns: auto 1fr;
  }
  .uos-health-timeline > div > strong,
  .uos-health-timeline > div > small,
  .uos-health-timeline code {
    grid-column: 2;
  }
}

.inbox-platform-logo {
  width: 16px;
  height: 16px;
}

.inbox-char-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.inbox-note-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.inbox-detail-title {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.inbox-detail h2 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.inbox-detail h3 {
  font-size: 0.88rem;
  margin: 1rem 0 0.4rem;
}

.inbox-detail-notes {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.76rem;
  padding: 0.42rem 0.46rem;
}

.inbox-chip {
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.78rem;
  background: var(--bg-deep);
  color: var(--text-primary);
  cursor: pointer;
}

.team-page {
  display: grid;
  gap: 0.5rem;
  min-height: 0;
}

.team-header {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: 0.6rem 0.7rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.team-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.team-header p {
  margin: 0;
  font-size: 0.82rem;
}

.team-count {
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-soft);
  background: var(--bg-input);
}

.team-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  padding: 0.6rem 0.7rem;
  display: grid;
  gap: 0.5rem;
}

.team-card h2 {
  margin: 0;
  font-size: 0.9rem;
}

.team-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.55rem;
}

.team-form-grid label {
  display: grid;
  gap: 0.2rem;
  font-size: 0.74rem;
  color: var(--text-soft);
}

.team-mention-toggle {
  grid-column: 1 / -1;
  display: inline-flex !important;
  align-items: center;
  gap: 0.42rem;
}

.team-actions {
  display: flex;
  justify-content: flex-end;
}

.team-list {
  display: grid;
  gap: 0.38rem;
}

.team-row {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--table-surface);
  padding: 0.45rem 0.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 0.45rem;
  align-items: center;
}

.team-row-main p {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.team-row-main small {
  color: var(--text-muted);
}

.team-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-soft);
}

.team-row .selectmenu-trigger {
  min-width: 92px;
}

.team-row-toggle span {
  white-space: nowrap;
}

.reservation-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  height: 100%;
  min-height: 0;
}

.reservation-table-pane {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.5rem;
  min-width: 0;
}

.reservation-table-head,
.reservation-table-body {
  margin-bottom: 0;
}

.reservation-controls {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
}

.reservation-controls .field input,
.reservation-controls .field .selectmenu-trigger,
.reservation-controls .btn {
  min-height: 34px;
  height: 34px;
  margin: 0;
}

.reservation-controls .field span {
  display: none;
}

.reservation-controls .field {
  margin: 0;
}

.reservation-actions-right {
  display: inline-flex;
  gap: 0.4rem;
  justify-self: end;
  align-items: center;
  position: relative;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.reservation-toolbar-dropdown {
  position: relative;
  display: inline-block;
  align-self: center;
}

.reservation-toolbar-dropdown .btn.is-active {
  background: color-mix(in srgb, #5b6cff 24%, var(--table-surface, transparent));
  border-color: color-mix(in srgb, #5b6cff 45%, var(--border-subtle));
  color: var(--text-primary);
}

.reservation-view {
  min-width: 230px;
}

.reservation-view .selectmenu-trigger {
  line-height: 1;
  font-size: 0.8rem;
  padding: 0.3rem 0.55rem;
}

.reservation-popover {
  margin-top: 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.55rem;
  background: var(--table-surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 0.45rem;
}

.reservation-quick-submenu-wrap {
  position: relative;
}

.reservation-quick-submenu {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  width: 100px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.35rem;
  background: var(--table-surface);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 0.3rem;
  z-index: 60;
}

.reservation-popover .field {
  margin-bottom: 0;
}

.reservation-column-list {
  display: grid;
  gap: 0.2rem;
  max-height: 220px;
  overflow: auto;
}

.reservation-column-list label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.reservation-table-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.reservation-table-wrap {
  min-height: 0;
  overflow: auto;
}

.reservation-table-wrap table {
  table-layout: fixed;
  width: max-content;
  max-width: none;
  min-width: 100%;
}

.reservation-table-wrap th {
  position: relative;
  white-space: nowrap;
}

.reservation-table-wrap td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reservation-table-wrap th:hover .reservation-col-resizer::before,
.reservation-table-wrap th:focus-within .reservation-col-resizer::before {
  background: color-mix(in srgb, var(--text-soft) 45%, transparent);
}

.reservation-sort-btn {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.75rem;
  display: inline-flex;
  gap: 0.22rem;
  align-items: center;
  padding: 0.02rem 0;
  max-width: calc(100% - 26px);
}

.reservation-sort-btn.active {
  color: var(--text-primary);
}

.reservation-sort-btn span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.reservation-col-resizer {
  position: absolute;
  top: 0;
  right: -1px;
  height: 100%;
  width: 12px;
  cursor: col-resize;
  background: transparent;
  z-index: 3;
}

.reservation-col-resizer::before {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  right: 5px;
  width: 2px;
  background: transparent;
  border-radius: 1px;
  transition: background 0.15s ease, width 0.15s ease;
}

.reservation-col-resizer:hover::before {
  background: #5b6cff;
  width: 3px;
}

.reservation-col-resizer:active::before {
  background: #5b6cff;
  width: 3px;
}

.reservation-col-dragger {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--text-muted);
  cursor: grab;
  user-select: none;
  padding: 4px 2px;
  border-radius: 4px;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
  z-index: 2;
}

.reservation-col-dragger:hover {
  opacity: 1;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-soft) 10%, transparent);
}

.reservation-col-dragger:active {
  cursor: grabbing;
  opacity: 1;
}

.reservation-table-wrap th {
  padding-left: 26px;
  padding-right: 18px;
}

.reservation-table-wrap th.is-drop-target::after {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 2px;
  background: #5b6cff;
  border-radius: 1px;
  pointer-events: none;
}

.reservation-table-wrap tbody tr.is-active {
  background: color-mix(in srgb, var(--accent) 14%, var(--table-row));
}

.reservation-table-wrap tbody tr { cursor: pointer; }
.reservation-table-wrap tbody tr:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

.reservation-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 9999;
  padding: 1rem;
  animation: sp-quick-fade 0.18s ease-out;
}

.reservation-modal {
  width: min(640px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  animation: sp-quick-slide 0.22s ease-out;
}

/* Guest documents: one reviewed reservation-money flow on desktop and phone. */
.guest-documents-modal {
  width: min(940px, calc(100vw - 2rem));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.guest-documents-modal .filter-modal-head {
  align-items: flex-start;
}
.guest-documents-modal .filter-modal-head h2,
.guest-documents-modal .filter-modal-head p {
  margin: 0;
}
.guest-documents-modal .filter-modal-head p {
  margin-top: .3rem;
  font-size: .78rem;
}
.guest-documents-modal-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 1rem;
}
.guest-invoice-review-list {
  display: grid;
  gap: 1rem;
}
.guest-invoice-review {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface-raised));
}
.guest-invoice-review > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.guest-invoice-review > header span,
.guest-invoice-review > header small {
  display: block;
  color: var(--text-muted);
  font-size: .72rem;
}
.guest-invoice-review > header h3 {
  margin: .2rem 0;
}
.guest-invoice-review > header > strong {
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}
.guest-invoice-review-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.guest-invoice-review-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  font-size: .78rem;
}
.guest-invoice-review-table th,
.guest-invoice-review-table td {
  padding: .65rem .5rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.guest-invoice-review-table th:first-child,
.guest-invoice-review-table td:first-child {
  text-align: left;
}
.guest-invoice-review-table th {
  color: var(--text-muted);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.guest-invoice-review-table tfoot td {
  border-bottom: 0;
  font-weight: 750;
}
.guest-invoice-main-actions {
  padding-top: .1rem;
}
.guest-invoice-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.guest-documents-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
}
.guest-documents-summary > div {
  padding: .8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-raised) 84%, transparent);
}
.guest-documents-summary span,
.guest-documents-summary strong {
  display: block;
}
.guest-documents-summary span {
  color: var(--text-muted);
  font-size: .72rem;
}
.guest-documents-summary strong {
  margin-top: .22rem;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.guest-documents-warning,
.guest-documents-success {
  margin: 0;
  padding: .72rem .8rem;
  border-radius: var(--radius-sm);
  font-size: .78rem;
  line-height: 1.45;
}
.guest-documents-warning {
  color: var(--warning-text, #8a5600);
  border: 1px solid color-mix(in srgb, var(--warning, #f59e0b) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--warning, #f59e0b) 9%, transparent);
}
.guest-documents-success {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--success-text, #2f8f58);
  border: 1px solid color-mix(in srgb, var(--success, #22c55e) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--success, #22c55e) 9%, transparent);
}
.guest-documents-section {
  display: grid;
  gap: .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}
.guest-invoice-primary {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-raised));
}
.guest-invoice-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}
.guest-invoice-create-grid > article {
  display: grid;
  gap: .8rem;
  padding: .9rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.guest-invoice-create-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.guest-invoice-create-head span,
.guest-invoice-create-head strong {
  display: block;
}
.guest-invoice-create-head span {
  margin-bottom: .18rem;
  color: var(--text-muted);
  font-size: .7rem;
}
.guest-invoice-create-head > strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.guest-invoice-line-preview {
  display: grid;
  gap: .35rem;
}
.guest-invoice-line-preview > div {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: .76rem;
}
.guest-invoice-line-preview > div.is-tax {
  color: var(--text-muted);
  border-bottom: 0;
}
.guest-documents-history {
  display: grid;
  gap: .7rem;
}
.guest-documents-history summary {
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 650;
  cursor: pointer;
}
.guest-documents-history[open] summary {
  margin-bottom: .7rem;
}
.guest-documents-section-head h3,
.guest-documents-section-head p,
.guest-documents-issue-grid h4,
.guest-documents-issue-grid p,
.guest-documents-email-review h3,
.guest-documents-email-review p {
  margin: 0;
}
.guest-documents-section-head p,
.guest-documents-issue-grid p {
  margin-top: .22rem;
  font-size: .76rem;
  line-height: 1.45;
}
.guest-documents-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.guest-documents-issue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.guest-documents-issue-grid article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .6rem;
  padding: .8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-raised) 78%, transparent);
}
.guest-documents-issue-grid article .btn {
  width: 100%;
  justify-content: flex-start;
  white-space: normal;
  text-align: left;
}
.guest-documents-issue-grid small {
  color: var(--text-muted);
  line-height: 1.45;
}
.guest-documents-issued-list {
  display: grid;
  gap: .5rem;
}
.guest-documents-issued-list article {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.guest-documents-issued-list small {
  display: block;
  margin-top: .2rem;
  color: var(--text-muted);
}
.guest-documents-void {
  flex: 1 0 100%;
  display: grid;
  gap: .6rem;
  padding-top: .7rem;
  border-top: 1px solid var(--border-subtle);
}
.guest-documents-void .field,
.guest-documents-void p {
  margin: 0;
}
.guest-documents-void textarea {
  width: 100%;
  resize: vertical;
}
.guest-documents-email-review {
  display: grid;
  gap: 1rem;
}
.guest-documents-email-review > .btn {
  justify-self: start;
}
.guest-documents-final-preview {
  display: grid;
  gap: .45rem;
}
.guest-documents-final-preview > span {
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.guest-documents-final-preview small {
  color: var(--text-muted);
}
.guest-documents-email-review details pre {
  max-height: 18rem;
  overflow: auto;
  padding: .75rem;
  white-space: pre-wrap;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
}
@media (max-width: 680px) {
  .guest-documents-modal {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .reservation-modal-backdrop:has(.guest-documents-modal) {
    padding: 0;
  }
  .guest-documents-summary,
  .guest-documents-issue-grid,
  .guest-invoice-create-grid {
    grid-template-columns: 1fr;
  }
  .guest-documents-issued-list article {
    align-items: flex-start;
    flex-direction: column;
  }
  .guest-documents-issued-list .guest-documents-actions,
  .guest-documents-issued-list .btn {
    width: 100%;
  }
  .guest-invoice-review {
    padding: .8rem;
  }
  .guest-invoice-review > header {
    display: grid;
  }
  .guest-invoice-main-actions,
  .guest-invoice-main-actions .btn,
  .guest-invoice-link-actions,
  .guest-invoice-link-actions .btn {
    width: 100%;
  }
}

/* Guest invoice setup: the action comes first; optional email wording stays secondary. */
.guest-invoice-settings-page {
  display: grid;
  gap: 1rem;
}
.guest-invoice-settings-hero .prc-card-head {
  align-items: center;
}
.guest-invoice-path {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  margin-top: 1rem;
}
.guest-invoice-path > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: .65rem;
  padding: .8rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-raised) 82%, transparent);
}
.guest-invoice-path > div > span {
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  color: var(--accent-contrast, white);
  background: var(--accent);
  font-size: .78rem;
  font-weight: 800;
}
.guest-invoice-path strong,
.guest-invoice-path small {
  display: block;
}
.guest-invoice-path strong {
  font-size: .8rem;
}
.guest-invoice-path small {
  margin-top: .22rem;
  color: var(--text-muted);
  font-size: .72rem;
  line-height: 1.4;
}
.guest-invoice-business-form {
  max-width: 780px;
}
.guest-invoice-rate-input {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.guest-invoice-email-settings .prc-card-head {
  align-items: center;
}
.guest-invoice-email-settings .prc-h1 > span {
  font-size: .72rem;
  font-weight: 600;
}
.guest-invoice-email-editor {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}
@media (max-width: 760px) {
  .guest-invoice-path {
    grid-template-columns: 1fr;
  }
  .guest-invoice-settings-hero .prc-card-head,
  .guest-invoice-email-settings .prc-card-head {
    align-items: stretch;
  }
  .guest-invoice-settings-hero .btn,
  .guest-invoice-email-settings .btn {
    width: 100%;
    justify-content: center;
  }
}

/* New-thread modal (inbox pane-2 "+" → New thread; NewThreadModal.tsx). Inherits
   the reservation-modal shell; these tune it for a compact single-column form. */
.nc-modal {
  width: min(460px, calc(100vw - 2rem));
}
.nc-body {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}
.nc-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}
.nc-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.nc-optional {
  font-weight: 500;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.nc-thread-rule {
  margin: 0;
  padding: 0.62rem 0.72rem;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border-subtle));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.45;
}
.nc-thread-rule.is-contact {
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
}
.nc-error {
  margin: 0.1rem 0 0;
}

/* Contact-first New thread. Login and Staff are badges on the same Contact row,
   never separate pickers. Desktop and phone render this exact component. */
.ntm-modal {
  width: min(560px, calc(100vw - 2rem));
  max-height: min(760px, calc(100vh - 2rem));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.ntm-head {
  align-items: flex-start;
}
.ntm-head > div {
  min-width: 0;
}
.ntm-head p {
  margin: 0.22rem 0 0;
  max-width: 430px;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}
.ntm-body {
  overflow: auto;
  gap: 1rem;
}
.ntm-selected {
  display: grid;
  gap: 0.38rem;
}
.ntm-selected-list {
  display: grid;
  gap: 0.35rem;
}
.ntm-search {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.72rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--table-surface);
  color: var(--text-muted);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.ntm-search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.ntm-search svg {
  flex: 0 0 auto;
}
.ntm-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.86rem;
}
.ntm-search input::placeholder {
  color: var(--text-muted);
}
.ntm-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.2rem;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 650;
}
.ntm-results-head small {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 500;
}
.ntm-results {
  min-height: 116px;
  max-height: 292px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--table-surface) 88%, transparent);
}
.ntm-contact-row {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.42rem 0.52rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
}
button.ntm-contact-row {
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    transform 0.12s ease;
}
button.ntm-contact-row:hover {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
button.ntm-contact-row:active {
  transform: scale(0.995);
}
.ntm-contact-row.is-selected {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.ntm-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
}
.ntm-contact-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 0.14rem;
}
.ntm-contact-topline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-wrap: wrap;
}
.ntm-contact-topline strong {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 650;
}
.ntm-contact-copy > small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ntm-contact-status {
  text-transform: capitalize;
}
.ntm-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.24rem;
}
.ntm-badge {
  padding: 0.12rem 0.38rem;
  border: 1px solid color-mix(in srgb, var(--ntm-badge) 34%, var(--border-subtle));
  border-radius: 999px;
  background: color-mix(in srgb, var(--ntm-badge) 12%, transparent);
  color: color-mix(in srgb, var(--ntm-badge) 72%, var(--text-primary));
  font-size: 0.61rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.ntm-add,
.ntm-remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
}
.ntm-remove {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.ntm-remove:hover {
  background: color-mix(in srgb, var(--text-soft) 10%, transparent);
  color: var(--text-primary);
}
.ntm-empty {
  min-height: 106px;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}
.ntm-empty.is-error {
  color: var(--state-error);
}
.ntm-foot {
  align-items: center;
}
.ntm-foot > p {
  min-width: 0;
  max-width: 290px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .ntm-modal {
    width: calc(100vw - 1rem);
    max-height: calc(100dvh - 1rem);
  }
  .ntm-results {
    max-height: 34dvh;
  }
  .ntm-foot {
    align-items: stretch;
    flex-direction: column;
  }
  .ntm-foot > p {
    max-width: none;
  }
  .ntm-foot .filter-modal-foot-right {
    width: 100%;
  }
  .ntm-foot .filter-modal-foot-right .btn {
    flex: 1 1 0;
  }
}

/* Number-entry keypad (DialPad.tsx). A build-a-number pad, distinct from the
   in-call DTMF pad in .softphone-keypad. */
.dialpad {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dialpad-display {
  width: 100%;
  height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-align: center;
}
.dialpad-display:focus {
  outline: none;
  border-color: var(--accent);
}
.dialpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.dialpad-key {
  padding: 0.6rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s ease;
}
.dialpad-key:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-input));
}
.dialpad-key:active {
  transform: translateY(1px);
}
.dialpad-key-back {
  color: var(--text-muted);
  font-weight: 500;
}

/* Compose action sits with the filter/select buttons — match their 30px box so
   the toolbar row stays even; btn-primary makes it the obvious "start" CTA. */
.workspace-list-new-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
}

.reservation-modal-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem 0.8rem;
}

.reservation-modal-columns label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.reservation-modal-actions {
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
}

/* ---- Quick filter menu (matches reference screenshot) ---- */
.quick-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: min(360px, 92vw);
  padding: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 240;
  overflow: visible;
}

.quick-filter-menu .workspace-filter-submenu {
  position: absolute;
  left: calc(100% + 0.28rem);
  right: auto;
  top: 0;
  min-width: 220px;
  max-width: 320px;
  margin: 0;
  padding: 0.42rem 0.45rem;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 80%, #1e3a5f);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  z-index: 260;
  display: grid;
  gap: 0.2rem;
}

.quick-filter-item {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.42rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-soft);
  line-height: 1.3;
  position: relative;
  transition: background 0.1s, color 0.1s;
}

.quick-filter-item:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.quick-filter-item.is-active {
  background: color-mix(in srgb, var(--ring) 16%, transparent);
  color: var(--text-primary);
  font-weight: 600;
}

.quick-filter-section-title {
  margin: 0.25rem 0.25rem 0.1rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.quick-filter-empty {
  padding: 0.2rem 0.55rem 0.35rem;
  font-size: 0.72rem;
  color: var(--text-soft);
}

.quick-filter-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.15rem;
}

.quick-filter-remove {
  all: unset;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 0.45rem;
  height: 30px;
  border-radius: 8px;
}

.quick-filter-remove:hover {
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 14%, transparent);
}

.quick-filter-add {
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.2rem;
  padding-top: 0.5rem;
}

.quick-filter-item.has-sub {
  padding-right: 0.5rem;
}

.quick-filter-caret {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.quick-filter-submenu {
  position: absolute;
  top: -4px;
  left: calc(100% + 6px);
  min-width: 140px;
  padding: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 90;
}

.quick-filter-subitem {
  all: unset;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.quick-filter-subitem:hover,
.quick-filter-subitem.is-active {
  background: color-mix(in srgb, #5b6cff 14%, transparent);
}

.quick-filter-divider {
  margin-top: 0.25rem;
  padding: 0.4rem 0.7rem 0.2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.quick-filter-saved-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
}

.quick-filter-saved {
  flex: 1;
}

.quick-filter-saved-delete {
  all: unset;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-radius: 6px;
}

.quick-filter-saved-delete:hover {
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 12%, transparent);
}

.quick-filter-badge {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-soft) 12%, transparent);
  padding: 2px 6px;
  border-radius: 999px;
}

/* ---- Filter modal (matches reference screenshot) ---- */
.filter-modal {
  width: min(780px, calc(100vw - 2rem));
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 3rem);
}

.filter-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.filter-modal-close {
  all: unset;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  padding: 2px 10px;
  border-radius: 6px;
}

.filter-modal-close:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-soft) 10%, transparent);
}

.filter-modal-body {
  padding: 1rem 1.1rem 1.25rem;
  overflow: auto;
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.filter-modal-subtitle {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.filter-modal-empty {
  padding: 0.5rem 0 0.25rem;
}

.filter-modal-rows {
  display: grid;
  gap: 0.55rem;
}

.filter-modal-join {
  display: flex;
  align-items: center;
  margin: 0.15rem 0 0;
  padding-left: 0.15rem;
}

.filter-modal-join-select {
  min-width: 4.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.filter-modal-row {
  display: grid;
  grid-template-columns: 160px 140px minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.filter-value-slot {
  min-width: 0;
}

.filter-value-slot .filter-input,
.filter-value-slot .filter-select {
  width: 100%;
}

.filter-select,
.filter-input {
  height: 38px;
  min-height: 38px;
  padding: 0 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--table-surface);
  color: var(--text-primary);
  font-size: 0.85rem;
  box-sizing: border-box;
  width: 100%;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: color-mix(in srgb, #5b6cff 55%, var(--border-subtle));
  box-shadow: 0 0 0 2px color-mix(in srgb, #5b6cff 18%, transparent);
}

.filter-row-trash {
  all: unset;
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0 0.5rem;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--table-surface);
}

.filter-row-trash:hover {
  color: #ef4444;
  border-color: color-mix(in srgb, #ef4444 40%, var(--border-subtle));
}

.filter-add-link {
  all: unset;
  cursor: pointer;
  font-size: 0.85rem;
  color: #e26d6d;
  font-weight: 500;
  padding: 0.2rem 0;
  width: max-content;
}

.filter-add-link:hover {
  text-decoration: underline;
}

.filter-save-quick {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: center;
}

.filter-save-quick-row {
  margin-top: 0.2rem;
}

.filter-save-quick-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 0.35rem;
}

.filter-save-quick-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.filter-save-quick-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.35;
}

.filter-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.filter-modal-foot-left,
.filter-modal-foot-right {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
}

.filter-apply-btn {
  background: #e26d6d;
  border-color: #e26d6d;
  color: #ffffff;
}

.filter-apply-btn:hover {
  background: #d35a5a;
  border-color: #d35a5a;
}

.btn.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-soft);
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn.btn-ghost:hover,
.btn.btn-ghost.is-active {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-soft) 10%, transparent);
}

/* ---- Manage views list ---- */
.manage-views-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.manage-views-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--table-surface);
}

.manage-views-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.manage-views-meta {
  font-size: 0.73rem;
  margin-top: 2px;
}

.manage-views-delete {
  color: #ef4444;
  border-color: color-mix(in srgb, #ef4444 30%, var(--border-subtle));
}

.manage-views-delete:hover {
  background: color-mix(in srgb, #ef4444 14%, transparent);
}

.properties-channel-picker {
  min-width: 260px;
}

.properties-channel-option {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 0.55rem;
}

.properties-channel-option-icon {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
}

.properties-channel-option-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.properties-channel-option-icon .workspace-platform-logo {
  width: 16px;
  height: 16px;
}

.properties-channel-option-copy {
  display: grid;
  gap: 0.1rem;
  text-align: left;
}

.properties-channel-option-copy strong {
  font-size: 0.76rem;
}

.properties-channel-option-copy small {
  font-size: 0.68rem;
  line-height: 1.2;
}

.properties-channels-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.properties-channel-picker-empty {
  margin: 0;
  padding: 0.35rem 0.45rem;
  font-size: 0.74rem;
}

.properties-channel-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.properties-channel-row-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

.properties-channel-chip {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--table-surface) 88%, var(--bg-elevated)),
    var(--table-surface)
  );
  color: var(--text-primary);
  font-size: 0.78rem;
  padding: 0.7rem 0.75rem;
  display: grid;
  gap: 0.6rem;
}

.properties-channel-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.properties-channel-chip.is-live {
  border-color: color-mix(in srgb, var(--state-success) 60%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--state-success) 30%, transparent);
}

.properties-channel-chip.is-deploying,
.properties-channel-chip.is-queued {
  border-color: color-mix(in srgb, var(--state-warning) 58%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--state-warning) 24%, transparent);
}

.properties-channel-chip.is-error {
  border-color: color-mix(in srgb, var(--state-error) 58%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--state-error) 24%, transparent);
}

.properties-channel-chip-main {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 0.65rem;
}

.properties-channel-chip-logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.properties-channel-chip-logo .workspace-platform-logo {
  width: 20px;
  height: 20px;
}

.properties-channel-chip-copy {
  display: grid;
  gap: 0.1rem;
}

.properties-channel-chip-copy strong {
  font-size: 0.9rem;
}

.properties-channel-chip-copy small {
  font-size: 0.74rem;
}

.properties-channel-chip-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: flex-end;
}

.properties-channel-chip-btn {
  font-size: 0.75rem;
  min-height: 32px;
  border-radius: 10px;
}

.properties-channels-empty {
  margin: 0.35rem 0 0;
}

.properties-child-settings-wrap {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.55rem;
}

.properties-child-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.properties-child-card {
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--table-surface) 88%, var(--bg-elevated)),
    var(--table-surface)
  );
  padding: 0.72rem 0.78rem;
  display: grid;
  gap: 0.62rem;
}

.properties-channel-chip-deploy-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, #fbbf24 80%, var(--text-soft));
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 12%, var(--table-surface));
  border: 1px solid color-mix(in srgb, #f59e0b 32%, var(--border-subtle));
  white-space: nowrap;
}

.properties-channel-chip-deploy-hint svg {
  color: inherit;
}

/* ── Copy-from-another-listing feature ─────────────────────────────────── */

.properties-section-h3-with-action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.properties-copy-from-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.18rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--border-strong) 65%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: border-color 0.14s, color 0.14s, background 0.14s, transform 0.14s;
}

.properties-copy-from-trigger:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--ring) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--ring) 8%, var(--bg-input));
  transform: translateY(-0.5px);
}

.properties-copy-from-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.properties-copy-from-trigger svg {
  color: inherit;
}

/* Modal */
.properties-copy-from-backdrop {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.properties-copy-from-card {
  width: min(880px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem !important;
  overflow: hidden;
}

.properties-copy-from-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.properties-copy-from-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
}

.properties-copy-from-hint {
  margin: 0;
  font-size: 0.78rem;
}

.properties-copy-from-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 0.85rem;
  min-height: 0;
  flex: 1;
}

.properties-copy-from-list-pane {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.properties-copy-from-search { margin: 0; }

.properties-copy-from-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  overflow: auto;
  padding: 0.1rem;
}

.properties-copy-from-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.42rem 0.55rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.properties-copy-from-row:hover {
  background: color-mix(in srgb, var(--border-subtle) 22%, transparent);
}

.properties-copy-from-row.is-selected {
  background: color-mix(in srgb, var(--brand-primary) 10%, var(--table-surface));
  border-color: color-mix(in srgb, var(--brand-primary) 38%, var(--border-subtle));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 24%, transparent);
}

.properties-copy-from-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.properties-copy-from-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.properties-copy-from-thumb-fallback {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

.properties-copy-from-thumb-lg {
  width: 64px;
  height: 64px;
  border-radius: 10px;
}

.properties-copy-from-thumb-lg .properties-copy-from-thumb-fallback {
  font-size: 0.95rem;
}

.properties-copy-from-row-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.properties-copy-from-row-copy strong {
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.properties-copy-from-row-copy small {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.properties-copy-from-row-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
}

.properties-copy-from-preview-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: color-mix(in srgb, var(--table-surface) 95%, var(--bg-elevated));
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.85rem;
  overflow: auto;
}

.properties-copy-from-preview-empty,
.properties-copy-from-preview-loading,
.properties-copy-from-preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.55rem;
  height: 100%;
  min-height: 14rem;
  color: var(--text-soft);
}

.properties-copy-from-preview-empty-icon {
  color: var(--text-muted);
}

.properties-copy-from-preview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.properties-copy-from-preview-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.properties-copy-from-preview-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--text-primary);
  margin-bottom: 0.1rem;
}

.properties-copy-from-preview-summary {
  border-top: 1px dashed color-mix(in srgb, var(--border-subtle) 70%, transparent);
  padding-top: 0.65rem;
}

.properties-copy-from-preview-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 0.45rem;
}

.properties-copy-from-preview-summary ul {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.properties-copy-from-preview-foot {
  font-size: 0.72rem;
  margin: 0;
}

.properties-copy-from-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .properties-copy-from-body {
    grid-template-columns: 1fr;
  }
  .properties-copy-from-preview-pane {
    min-height: 12rem;
  }}

.properties-photo-skel {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  pointer-events: none;
}

.properties-child-card-skel {
  pointer-events: none;
}

.properties-child-card-skel-head {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
}

.properties-child-card-skel-text {
  display: inline-flex;
  flex-direction: column;
  gap: 0.25rem;
}

.properties-child-card.is-placeholder {
  min-height: 92px;
  place-items: center;
}

.properties-child-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.78rem;
  margin: -0.72rem -0.78rem 0;
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 14px 14px 0 0;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.properties-child-card.is-collapsed .properties-child-card-head {
  border-radius: 14px;
  margin-bottom: -0.72rem;
}

.properties-child-card-head:hover {
  background: color-mix(in srgb, var(--border-subtle) 22%, transparent);
}

.properties-child-card-head:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 60%, transparent);
  outline-offset: -2px;
}

.properties-child-card-head-main {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.properties-child-card-head-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.properties-child-card-head-copy strong {
  font-size: 0.86rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.properties-child-card-head-copy small {
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.properties-child-card-head-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.properties-child-card-state-pill {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
  background: var(--table-surface);
}

.properties-child-card-state-pill.is-listed {
  color: color-mix(in srgb, var(--state-success) 80%, var(--text-primary));
  background: color-mix(in srgb, var(--state-success) 14%, var(--table-surface));
  border-color: color-mix(in srgb, var(--state-success) 38%, var(--border-subtle));
}

.properties-child-card-sync-summary {
  font-size: 0.7rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .properties-child-card-sync-summary {
    display: none;
  }}

.properties-child-card-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--text-soft);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.properties-child-card.is-collapsed .properties-child-card-chevron {
  transform: rotate(-90deg);
}

.properties-child-card-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.properties-child-card-logo .workspace-platform-logo {
  width: 16px;
  height: 16px;
}

.properties-child-grid {
  align-items: end;
}

.properties-thinking {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.properties-loading-shell {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 150px;
  background:
    radial-gradient(130% 95% at 8% 0%, color-mix(in srgb, var(--brand-primary) 16%, transparent) 0%, transparent 62%),
    radial-gradient(120% 90% at 96% 100%, color-mix(in srgb, var(--brand-primary) 10%, transparent) 0%, transparent 66%),
    linear-gradient(170deg, color-mix(in srgb, var(--bg-elevated) 92%, black 8%) 0%, color-mix(in srgb, var(--bg-elevated) 98%, black 2%) 100%);
  border-color: color-mix(in srgb, var(--brand-primary) 14%, var(--border-subtle));
  box-shadow:
    0 16px 34px color-mix(in srgb, black 28%, transparent),
    inset 0 0 0 1px color-mix(in srgb, var(--brand-primary) 10%, transparent);
}

.properties-loading-fullpane {
  position: relative;
  min-height: min(58vh, 640px);
  display: grid;
  place-items: center;
  border: none !important;
  border-radius: 0;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg-elevated) 97%, var(--brand-primary) 3%);
}

.properties-loading-fullpane::before {
  content: none;
}

.properties-loading-fullpane-center {
  position: relative;
  z-index: 2;
  width: min(90%, 620px);
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  text-align: center;
}

.properties-loading-fullpane-title {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.015em;
}

.properties-loading-fullpane-subtitle {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(0.78rem, 1.25vw, 0.92rem);
  color: color-mix(in srgb, var(--text-soft) 92%, white 8%);
}

.properties-loading-fullpane-orb {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  position: relative;
}

.properties-loading-fullpane-orb {
  display: none;
}

.properties-loading-fullpane-orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from 130deg,
    color-mix(in srgb, var(--brand-primary) 86%, white 14%),
    color-mix(in srgb, var(--brand-primary) 32%, transparent),
    color-mix(in srgb, var(--brand-primary) 78%, white 22%)
  );
  animation: properties-loader-spin 1.05s linear infinite;
}

.properties-loading-fullpane-orb::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--bg-elevated) 84%, black 16%);
}

.properties-loading-fullpane-orb span {
  position: relative;
  z-index: 1;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 90%, white 10%);
  box-shadow: 0 0 10px color-mix(in srgb, var(--brand-primary) 58%, transparent);
  animation: properties-loader-breath 1.3s ease-in-out infinite;
}

.properties-loading-fullpane-orb span:nth-child(1) {
  --x: -8px;
  --y: 0;
  animation-delay: 0s;
}

.properties-loading-fullpane-orb span:nth-child(2) {
  --x: 0;
  --y: -8px;
  animation-delay: 0.18s;
}

.properties-loading-fullpane-orb span:nth-child(3) {
  --x: 8px;
  --y: 0;
  animation-delay: 0.36s;
}

.properties-loading-fullpane-bars {
  margin-top: 0.25rem;
  width: min(100%, 520px);
  display: grid;
  gap: 0.46rem;
}

.properties-loading-fullpane-bars i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    92deg,
    color-mix(in srgb, var(--table-surface) 94%, transparent) 0%,
    color-mix(in srgb, var(--brand-primary) 34%, var(--bg-elevated)) 50%,
    color-mix(in srgb, var(--table-surface) 94%, transparent) 100%
  );
  background-size: 240% 100%;
  animation: properties-loader-shimmer 1.2s linear infinite;
}

.properties-loading-fullpane-bars i:nth-child(1) {
  width: 100%;
}

.properties-loading-fullpane-bars i:nth-child(2) {
  width: 72%;
  justify-self: center;
  animation-delay: 0.14s;
}

.properties-loading-fullpane-bars i:nth-child(3) {
  width: 86%;
  justify-self: center;
  animation-delay: 0.26s;
}

.properties-loading-shell-fullpane {
  min-height: min(78vh, 920px);
  border-radius: 18px;
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: clamp(1.25rem, 2.4vw, 2.25rem);
}

.properties-loading-card-compact.properties-loading-shell {
  min-height: 90px;
  padding: 0.78rem 0.92rem;
}

.properties-loading-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.82rem;
}

.properties-loading-copy {
  min-width: 0;
}

.properties-loading-title {
  margin: 0;
  color: color-mix(in srgb, var(--text) 88%, white 12%);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.properties-loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--text-muted) 42%, transparent);
  border-top-color: color-mix(in srgb, var(--brand-primary) 72%, white 28%);
  border-right-color: var(--brand-primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary) 14%, transparent) inset;
  flex: 0 0 auto;
  animation: properties-loader-spin 0.9s linear infinite;
}

.properties-loading-spinner-lg {
  width: 26px;
  height: 26px;
}

.properties-loading-title-gradient {
  display: inline-block;
  position: relative;
  background-image: linear-gradient(
    92deg,
    color-mix(in srgb, var(--text-soft) 80%, white 20%) 0%,
    color-mix(in srgb, white 98%, var(--brand-primary) 2%) 45%,
    color-mix(in srgb, var(--brand-primary) 66%, white 34%) 50%,
    color-mix(in srgb, white 98%, var(--brand-primary) 2%) 55%,
    color-mix(in srgb, var(--text-soft) 80%, white 20%) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 14px color-mix(in srgb, var(--brand-primary) 16%, transparent),
    0 0 1px color-mix(in srgb, white 28%, transparent);
}

.properties-loading-title-gradient::after {
  content: none;
}

.properties-loading-title-sweep {
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: -55%;
  width: 42%;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, white 88%, var(--brand-primary) 12%) 50%,
    transparent 100%
  );
  opacity: 0.9;
  filter: blur(0.4px);
}

.properties-loading-shell-fullpane .properties-loading-title {
  font-size: clamp(1.05rem, 2.1vw, 1.36rem);
  letter-spacing: 0.015em;
}

.properties-loading-shell-fullpane .properties-loading-subtitle {
  font-size: clamp(0.76rem, 1.25vw, 0.92rem);
  max-width: 44ch;
}

.properties-loading-shell-fullpane .properties-loading-orb {
  width: 36px;
  height: 36px;
}

.properties-loading-shell-fullpane .properties-loading-orb::after {
  inset: 4px;
}

.properties-loading-shell-fullpane .properties-loading-bars {
  gap: 0.46rem;
  margin-top: 1rem;
}

.properties-loading-shell-fullpane .properties-loading-bars i {
  height: 9px;
}

.properties-loading-title-shimmer {
  position: relative;
  overflow: hidden;
  width: min(100%, 300px);
  height: 3px;
  border-radius: 999px;
  margin: 0.12rem auto 0;
  background: linear-gradient(
    92deg,
    color-mix(in srgb, var(--table-surface) 88%, transparent) 0%,
    color-mix(in srgb, white 78%, var(--brand-primary) 22%) 48%,
    color-mix(in srgb, var(--table-surface) 88%, transparent) 100%
  );
  background-size: 230% 100%;
  animation: properties-loader-shimmer 1.25s linear infinite;
  opacity: 0.95;
}

.properties-loading-fullpane .properties-loading-title-shimmer {
  width: min(84%, 420px);
  height: 4px;
}

.properties-loading-title-shimmer-glint {
  position: absolute;
  inset: 0 auto 0 0;
  width: 34%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, white 96%, var(--brand-primary) 4%) 50%,
    transparent 100%
  );
  opacity: 0.95;
  pointer-events: none;
}

.properties-loading-subtitle {
  margin: 0.24rem 0 0;
  color: color-mix(in srgb, var(--text-soft) 92%, white 8%);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.properties-loading-orb {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.properties-loading-orb {
  display: none;
}

.properties-loading-orb::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from 130deg,
    color-mix(in srgb, var(--brand-primary) 82%, white 18%),
    color-mix(in srgb, var(--brand-primary) 42%, transparent),
    color-mix(in srgb, var(--brand-primary) 74%, white 26%)
  );
  animation: properties-loader-spin 1.35s linear infinite;
}

.properties-loading-orb::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: color-mix(in srgb, var(--bg-elevated) 88%, black 12%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-primary) 20%, transparent);
}

.properties-loading-orb span {
  position: relative;
  z-index: 1;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 88%, white 12%);
  opacity: 0.88;
  box-shadow: 0 0 10px color-mix(in srgb, var(--brand-primary) 56%, transparent);
  animation: properties-loader-breath 1.8s ease-in-out infinite;
}

.properties-loading-orb span:nth-child(1) {
  --x: -6px;
  --y: 0px;
  animation-delay: 0s;
}

.properties-loading-orb span:nth-child(2) {
  --x: 0px;
  --y: -6px;
  animation-delay: 0.22s;
}

.properties-loading-orb span:nth-child(3) {
  --x: 6px;
  --y: 0px;
  animation-delay: 0.44s;
}

.properties-loading-bars {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 0.32rem;
  margin-top: 0.78rem;
}

.properties-loading-bars i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background:
    linear-gradient(
      92deg,
      color-mix(in srgb, var(--table-surface) 94%, transparent) 0%,
      color-mix(in srgb, var(--bg-elevated) 82%, var(--brand-primary) 18%) 52%,
      color-mix(in srgb, var(--table-surface) 94%, transparent) 100%
    );
  background-size: 220% 100%;
  animation: properties-loader-shimmer 1.6s ease-in-out infinite;
}

.properties-loading-bars i:nth-child(1) {
  width: 82%;
}

.properties-loading-bars i:nth-child(2) {
  width: 56%;
  animation-delay: 0.16s;
}

.properties-loading-bars i:nth-child(3) {
  width: 70%;
  animation-delay: 0.28s;
}

.properties-loading-border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--brand-primary) 18%, var(--border-subtle));
  mask: linear-gradient(135deg, black 22%, transparent 68%);
  opacity: 0.6;
}

.properties-loading-sheen {
  position: absolute;
  inset: -40% -55%;
  background: linear-gradient(
    112deg,
    transparent 26%,
    color-mix(in srgb, white 8%, transparent) 44%,
    color-mix(in srgb, var(--brand-primary) 20%, transparent) 50%,
    color-mix(in srgb, white 8%, transparent) 56%,
    transparent 74%
  );
  transform: translate3d(-36%, 0, 0);
  animation: properties-loader-sheen 2.8s ease-in-out infinite;
  opacity: 0.72;
  pointer-events: none;
}

.properties-loading-noise {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 22% 18%, color-mix(in srgb, white 20%, transparent) 0.6px, transparent 0.7px),
    radial-gradient(circle at 74% 34%, color-mix(in srgb, white 16%, transparent) 0.5px, transparent 0.7px),
    radial-gradient(circle at 40% 78%, color-mix(in srgb, white 12%, transparent) 0.45px, transparent 0.7px);
}

.properties-loading-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.properties-loading-particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 64%, white 36%);
  opacity: 0.45;
  filter: blur(0.25px);
  animation: properties-loader-float 3.6s ease-in-out infinite;
}

.properties-loading-particles span:nth-child(1) {
  top: 18%;
  left: 18%;
  animation-delay: 0s;
}

.properties-loading-particles span:nth-child(2) {
  top: 26%;
  right: 16%;
  animation-delay: 0.5s;
}

.properties-loading-particles span:nth-child(3) {
  bottom: 24%;
  left: 34%;
  animation-delay: 1.05s;
}

.properties-loading-particles span:nth-child(4) {
  bottom: 20%;
  right: 28%;
  animation-delay: 1.45s;
}

.properties-loading-fullpane-meta {
  position: absolute;
  inset: auto clamp(1rem, 2.2vw, 1.65rem) clamp(1rem, 1.8vw, 1.3rem);
  z-index: 3;
  display: grid;
  gap: 0.42rem;
  pointer-events: none;
}

.properties-loading-fullpane-meta span {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    92deg,
    color-mix(in srgb, var(--table-surface) 90%, transparent),
    color-mix(in srgb, var(--brand-primary) 16%, var(--bg-elevated)),
    color-mix(in srgb, var(--table-surface) 90%, transparent)
  );
  background-size: 220% 100%;
  animation: properties-loader-shimmer 1.9s ease-in-out infinite;
  opacity: 0.72;
}

.properties-loading-fullpane-meta span:nth-child(1) {
  width: min(36vw, 340px);
}

.properties-loading-fullpane-meta span:nth-child(2) {
  width: min(24vw, 220px);
  animation-delay: 0.2s;
}

.properties-loading-fullpane-meta span:nth-child(3) {
  width: min(32vw, 280px);
  animation-delay: 0.38s;
}

.properties-loading-fullpane-meta span:nth-child(4) {
  width: min(18vw, 170px);
  animation-delay: 0.52s;
}

.properties-loading-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(145% 110% at 50% 50%, transparent 58%, color-mix(in srgb, black 16%, transparent) 100%);
}

.properties-loading-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(0deg, color-mix(in srgb, black 6%, transparent), transparent 62%);
}

.properties-editor.is-field-loading .properties-editor-scroll {
  opacity: 1;
}

/* Briefly fades + nudges the editor when the user switches between listings.
   Reset+re-applied via JS to retrigger the animation each switch. */
.properties-editor-scroll.is-listing-just-switched {
  animation: properties-editor-switch 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes properties-editor-switch {
  from { opacity: 0.35; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .properties-editor-scroll.is-listing-just-switched { animation: none; }}

.properties-editor.is-field-loading .properties-input-text,
.properties-editor.is-field-loading textarea.properties-input-text,
.properties-editor.is-field-loading select.properties-input-text,
.properties-editor.is-field-loading .properties-pms-pill-toggle {
  color: transparent !important;
  caret-color: transparent;
  border-color: color-mix(in srgb, var(--border-subtle) 76%, transparent);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--table-surface) 92%, transparent) 25%,
    color-mix(in srgb, var(--bg-elevated) 62%, transparent) 50%,
    color-mix(in srgb, var(--table-surface) 92%, transparent) 75%
  );
  background-size: 240% 100%;
  animation: properties-field-skeleton 1.35s ease-in-out infinite;
}

.properties-editor.is-field-loading .properties-input-text::placeholder {
  color: transparent;
}

.properties-editor.is-field-loading .properties-suggestion-btn,
.properties-editor.is-field-loading .btn {
  pointer-events: none;
}

.properties-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.properties-thinking-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-primary) 72%, var(--text-soft));
  animation: properties-thinking-pulse 1.1s infinite ease-in-out;
}

.properties-thinking-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.properties-thinking-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@media (max-width: 900px) {
  .properties-channel-row {
    grid-template-columns: 1fr;
  }

  .properties-channel-chip-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }}

@keyframes properties-thinking-pulse {
  0%,
  80%,
  100% {
    transform: scale(0.72);
    opacity: 0.35;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes properties-loader-breath {
  0%,
  100% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(0.74);
    opacity: 0.55;
  }
  50% {
    transform: translate(var(--x, 0), var(--y, 0)) scale(1);
    opacity: 1;
  }
}

@keyframes properties-loader-shimmer {
  0% {
    background-position: 120% 50%;
  }
  100% {
    background-position: -70% 50%;
  }
}

@keyframes properties-loader-sheen {
  0% {
    transform: translate3d(-36%, 0, 0);
  }
  50% {
    transform: translate3d(12%, 0, 0);
  }
  100% {
    transform: translate3d(52%, 0, 0);
  }
}

@keyframes properties-loader-float {
  0%,
  100% {
    transform: translateY(0) scale(0.72);
    opacity: 0.35;
  }
  50% {
    transform: translateY(-5px) scale(1);
    opacity: 0.7;
  }
}

@keyframes properties-loader-text-shimmer {
  0% {
    background-position: 130% 50%;
  }
  100% {
    background-position: -40% 50%;
  }
}

@keyframes properties-loader-title-glint {
  0% {
    transform: translateX(-130%);
  }
  100% {
    transform: translateX(130%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .properties-thinking-dots i {
    animation: none !important;
  }}

@keyframes properties-field-skeleton {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.properties-photo-url-readonly {
  min-height: 32px;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--table-surface);
  color: var(--text-soft);
  font-size: 0.74rem;
  line-height: 1.3;
  word-break: break-all;
}

.properties-photos-note {
  margin: 0.4rem 0 0;
  font-size: 0.73rem;
}

.channels-page-card,
.fees-page-card {
  display: grid;
  gap: 0.7rem;
}

.channels-page-head,
.fees-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.channels-page-head h2,
.fees-page-head h2 {
  margin: 0;
}

.channels-page-count {
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  color: var(--text-soft);
  background: var(--table-surface);
}

.channels-page-list {
  display: grid;
  gap: 0.5rem;
}

.channels-page-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.58rem 0.7rem;
  background: var(--table-surface);
}

.channels-page-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.channels-page-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.channels-page-icon .ui-icon {
  width: 14px;
  height: 14px;
}

.channels-page-icon .workspace-platform-logo {
  width: 16px;
  height: 16px;
}

.channels-page-name {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
}

.channels-page-sub {
  margin: 0.08rem 0 0;
  font-size: 0.74rem;
}

.channels-page-toggle {
  min-width: 72px;
}

.fees-page-table {
  display: grid;
  gap: 0.45rem;
}

.fees-page-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 220px auto;
  gap: 0.5rem;
  align-items: center;
}

.fees-page-id {
  font-size: 0.74rem;
  color: var(--text-soft);
}

.fees-page-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border-subtle);
}

.properties-middle-tabs {
  /* Sleeker chrome — flat background, subtle border, no gradient or
     drop shadow. Same minimalist treatment as the Pricing tab's
     `.segmented-control` track, so the two read as siblings rather
     than competing tab patterns. */
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.22rem;
  border-radius: 10px;
  margin: 0 0 0.65rem;
  width: 100%;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
}

.properties-middle-tabs-buttons {
  /* All visible slots share width equally (`flex:1` per child below).
     When labels would clip, the measurement logic in
     PropertiesTabChrome.tsx collapses the last visible tab into the
     overflow dropdown — see the useLayoutEffect there. */
  display: flex;
  align-items: stretch;
  gap: 0.2rem;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
}

/* Overflow ("More") button + popover — the LAST visible slot in the
   tab bar when not every tab fits at equal width. It claims the same
   flex:1 share as a tab so the bar stays evenly spaced instead of
   wedging the menu trigger off to one side. */
.properties-tab-overflow {
  position: relative;
  display: flex;
  /* Equal slot — same flex behaviour as a regular tab so the bar
     reads as uniformly-divided regardless of how many tabs are
     visible. */
  flex: 1 1 0;
  min-width: 0;
}
.properties-middle-tab.properties-tab-overflow-btn {
  /* The button is a grid, not a flex row. Browser annotations, progress
     affordances and other absolutely-positioned children can therefore never
     push the visible label away from the optical centre. */
  display: grid;
  place-items: center;
  width: 100%;
}
.properties-tab-overflow-trigger-content {
  display: inline-grid;
  grid-template-columns: auto 14px;
  align-items: center;
  justify-content: center;
  column-gap: 0.375rem;
  line-height: 1.25;
}
.properties-tab-overflow-label {
  display: block;
  line-height: 1.25;
}
.properties-middle-tab.properties-tab-overflow-btn .properties-tab-overflow-trigger-content svg {
  display: block;
  width: 14px;
  height: 14px;
  margin: 0;
  opacity: 0.7;
  transform: translateY(0.5px);
}
.properties-tab-overflow-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 200px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: var(--shadow-soft, 0 12px 30px rgba(0, 0, 0, 0.32));
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.properties-tab-overflow-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 40px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.properties-tab-overflow-item:hover:not([aria-disabled="true"]),
.properties-tab-overflow-item:focus-visible {
  background: color-mix(in srgb, var(--border-subtle) 70%, transparent);
  outline: none;
}
.properties-tab-overflow-item.is-active {
  background: color-mix(in srgb, var(--border-strong) 22%, transparent);
  color: var(--text-main);
}
.properties-tab-overflow-item[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
}
.properties-middle-tabs-thumb {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-surface-2, #f1f1f4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.properties-middle-tabs-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.properties-middle-tab {
  /* Equal-width slot — `flex:1 1 0` makes each tab share the bar
     evenly regardless of label length. `min-width:0` is critical so
     long labels can shrink + ellipsis instead of forcing siblings
     out. */
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 0.005em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 7px;
  padding: 0.4rem 0.5rem;
  font-size: 14px;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.12s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}
.properties-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: color-mix(in srgb, currentColor 70%, transparent);
  flex: 0 0 auto;
}
.properties-middle-tab.is-active .properties-tab-icon,
.properties-middle-tab.is-pending .properties-tab-icon {
  color: currentColor;
}
.properties-tab-label {
  /* The truncation detector in PropertiesTabChrome reads scrollWidth vs
     clientWidth on this element to decide when to collapse a tab into
     the More dropdown. Don't add max-width here — the parent slot
     constrains the width; the ellipsis on overflow is what tells the
     measurement effect "this clipped, drop me into the menu". */
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.properties-tab-overflow-item-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.properties-middle-tab:hover:not(:disabled):not(.is-active) {
  /* Subtle hover — neutral surface tint rather than an accent wash, so
     hover doesn't preview an "active" look that competes with the
     real active tab. */
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-primary) 5%, transparent);
}
.properties-middle-tab:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.properties-middle-tab:active:not(:disabled) {
  transform: translateY(0.5px);
}
.properties-middle-tab:disabled,
.properties-middle-tab[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
}

.properties-middle-tab.is-active {
  /* Minimalist active state — solid raised surface with a subtle
     shadow, matching the segmented-control pattern elsewhere on the
     page. No accent border / gradient / inset highlight; the
     elevation alone is the active signal. Shadow uses a text-primary
     color-mix so it reads in both light and dark mode (a hardcoded
     rgba(0,0,0,...) is too heavy in light, near-invisible in dark). */
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: transparent;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text-primary) 12%, transparent);
  font-weight: 700;
}

/* The freshly-clicked-but-not-yet-active tab. Mirrors the active treatment
   so the click registers visually instantly, plus a progress fill drawn
   INSIDE the tab (via ::after, width driven by --tab-progress) so the
   loading signal lives where the host clicked rather than on a tiny
   chrome strip they'd never look at. */
.properties-middle-tab {
  position: relative;
  overflow: hidden;
}
.properties-middle-tab.is-pending {
  /* Same flat raised treatment as `.is-active` so the click registers
     immediately — the progress sliver at the bottom of the tab does
     the "loading" signalling, the surface just confirms the target. */
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: transparent;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text-primary) 8%, transparent);
}
/* Real DOM progress bar element on the pending tab (see
   PropertiesTabChrome → `.properties-tab-progress-bar`). Lives at the
   bottom edge with a 3px height and a glow so it's hard to miss even on
   fast swaps. CSS-variable / ::after pseudo-element variants existed
   before and were either invisible or got eaten by browser quirks. */
.properties-tab-progress-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--ring));
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 0 999px 999px 0;
  pointer-events: none;
  /* Milestone widths: click → 12%, painted → 34%, new tab committed →
     78%, idle → 100%. The transition smooths between them so even fast
     swaps animate visibly rather than jumping to 100% in one frame. */
  transition: width 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}

/* Shared progress-fill primitive (see components/perf/ProgressFill.tsx).
   Default look — 2px sliver bound to the bottom of a position:relative
   parent, width driven by inline style. Theme can override via the
   className prop. */
.perf-progress-fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--ring));
  border-radius: 0 999px 999px 0;
  pointer-events: none;
  transition: width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.properties-reservations-shell {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.properties-collapsed-context {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
}

.workspace-list-pane-slim .properties-collapsed-context {
  display: flex;
}

.properties-collapsed-context-media {
  width: 46px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-muted);
  flex-shrink: 0;
}

.properties-collapsed-context-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.properties-collapsed-context-copy {
  display: grid;
  gap: 0.06rem;
}

.properties-collapsed-context-copy strong {
  font-size: 0.78rem;
}

/* Owner mode reuses the same collapsed-context card, swapping the listing
   thumbnail for a centred initial. Same box, tokens only → L/D parity. */
.properties-collapsed-context-media--owner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.properties-collapsed-context-initial {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text-primary);
}

.properties-reservations-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}

.properties-reservations-toolbar-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.properties-toolbar-display {
  display: inline-flex;
  margin-left: auto;
}

.properties-reservations-groupby,
.properties-reservations-sort {
  min-width: 0;
}

.properties-reservations-search {
  min-width: 0;
  flex: 1 1 auto;
}

.properties-reservations-search input {
  width: 100%;
}

.properties-inline-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.properties-inline-label {
  color: var(--text-soft);
  font-size: 0.72rem;
  white-space: nowrap;
}

.properties-reservations-toolbar input,
.properties-reservations-toolbar .selectmenu-trigger {
  height: 32px;
  font-size: 0.78rem;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: 6px;
}

.properties-reservations-toolbar .btn.icon-only,
.properties-reservations-toolbar .btn {
  height: 32px;
  min-height: 32px;
  font-size: 0.78rem;
}

.properties-reservations-search input {
  background: var(--bg-input);
  border-color: var(--border-subtle);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.properties-reservations-search input:focus-within,
.properties-reservations-search input:focus {
  border-color: color-mix(in srgb, var(--ring) 55%, var(--border-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 14%, transparent);
}

/* Period chip group — sits inline in the top toolbar row */
.properties-reservations-period-group {
  display: inline-flex;
  align-items: stretch;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.properties-reservations-period-group:focus-within {
  border-color: color-mix(in srgb, var(--ring) 55%, var(--border-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 14%, transparent);
}

.properties-reservations-period-select,
.properties-reservations-period-value {
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
  font-size: 0.78rem !important;
  padding: 0 0.5rem !important;
  color: var(--text-primary) !important;
  border-radius: 0 !important;
  outline: none;
}

.properties-reservations-period-select {
  font-weight: 600;
  border-right: 1px solid var(--border-subtle) !important;
  padding-right: 1.5rem !important;
}
/* The 1.5rem reserved room for the native caret. A SelectMenu trigger draws its own
   chevron inline, so the reserve is just a gap now. */
.selectmenu-trigger.properties-reservations-period-select {
  padding-right: 0.5rem !important;
}

/* Compact "all time" state — make the picker look more like a pill. The group
   carries `is-all` from React; it used to be sniffed with :has(option:checked),
   which stopped working when the picker became a styled menu with no options in
   the DOM. */
.properties-reservations-period-group.is-all .properties-reservations-period-select {
  border-right: 0 !important;
}

.properties-reservations-period-value {
  border-right: 1px solid var(--border-subtle) !important;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}

/* The last value chip in the group loses its divider. This used to be
   `:last-of-type`, which worked while every value was an <input> or <select> and
   the clear control was the only <button>. The trailing-window picker is a
   SelectMenu trigger — also a <button> — so type-based matching now picks the
   wrong element; match by position instead. */
.properties-reservations-period-value:has(+ .properties-reservations-period-clear),
.properties-reservations-period-value:last-child {
  border-right: 0 !important;
}
/* A trigger in this group is a <button>: give back the normal weight a <select>
   had for free (the -select chip keeps its deliberate 600). */
.properties-reservations-period-value.selectmenu-trigger {
  font-weight: 400;
}

.properties-reservations-period-clear {
  height: 100%;
  width: 28px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border-radius: 0;
}

.properties-reservations-period-clear:hover {
  color: var(--text-primary);
  background: var(--surface-muted);
}

.properties-reservations-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Group wrapper is a layout-only container — the global .card class is
   styling it as if it were a card, but the rows inside are the actual
   visual unit, so we null all of .card's chrome here. */
.properties-reservations-list .properties-reservation-group,
.properties-reservations-list .card.properties-reservation-group {
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Group head still gets a subtle separator when there's more than one group */
.properties-reservation-group:not(:first-child) {
  margin-top: 0.4rem !important;
}

.properties-reservation-group-head {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0 0.25rem 0.4rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  cursor: pointer;
}

.properties-reservation-group-head:hover strong {
  color: var(--text-primary);
}

.properties-reservation-group-head > span:first-child {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.properties-reservation-group-head strong {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.005em;
  transition: color 0.12s;
}

.properties-reservation-group-head small {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-muted);
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.properties-reservation-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.properties-reservation-sublist {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.properties-reservation-row {
  position: relative;
}

.properties-reservation-row.has-open-tag-picker {
  z-index: 60;
}

/* Show right-column actions when row is selected, on hover, or when picker is open */
.properties-reservation-row:hover .properties-reservation-actions,
.properties-reservation-row:focus-within .properties-reservation-actions,
.properties-reservation-row.is-selected .properties-reservation-actions,
.properties-reservation-row.has-open-tag-picker .properties-reservation-actions {
  opacity: 1;
}

.properties-reservation-row-head {
  width: 100%;
  position: relative;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem 0.7rem 1rem;
  display: flex;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  overflow: visible;
}

.properties-reservation-row-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  border-radius: inherit;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.properties-reservation-row-open:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.properties-reservation-row-head > .properties-reservation-quick-main,
.properties-reservation-row-head > .properties-reservation-pill-row {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.properties-reservation-row-head .workspace-list-tags,
.properties-reservation-row-head .properties-reservation-actions {
  pointer-events: auto;
}

.properties-reservation-row-head:hover {
  border-color: color-mix(in srgb, var(--ring) 28%, var(--border-strong));
  background: color-mix(in srgb, var(--ring) 3%, var(--bg-elevated));
}

.properties-reservation-row-head.is-selected {
  border-color: color-mix(in srgb, var(--ring) 50%, var(--border-strong));
  background: color-mix(in srgb, var(--ring) 7%, var(--bg-elevated));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ring) 25%, transparent);
}

/* 3px accent rail flush with the left edge — clean selected indicator */
.properties-reservation-row-head.is-selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--ring);
}

/* Unread state — pill border still subtle, plus a small dot left of avatar */
.properties-reservation-row-head.is-unread::after {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 1.35rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 25%, transparent);
}

.properties-reservation-row-head p {
  margin: 0;
  font-weight: 600;
}

.properties-reservation-row-head small {
  color: var(--text-soft);
}

.properties-reservation-pill-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  margin-left: auto;
  gap: 0.5rem;
  flex-shrink: 0;
  min-height: 100%;
}

.properties-reservation-quick-main {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}

.properties-reservation-quick-copy {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
  flex: 1;
}

.properties-reservation-name-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}

.properties-reservation-name-row p {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1.25;
}

.properties-reservation-meta-line {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
  line-height: 1.4;
}

.properties-reservation-meta-line svg {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  vertical-align: -1px;
}

.properties-reservation-meta-sep {
  color: var(--border-strong);
  user-select: none;
  font-weight: 700;
}

.properties-reservation-thread-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.4;
  max-width: 100%;
}

.properties-reservation-thread-preview svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  opacity: 0.6;
}

.properties-reservation-thread-preview span {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  min-width: 0;
}

/* Status pill — bigger, bolder, distinct colours per status */
.workspace-status-pill--inline {
  font-size: 0.66rem;
  padding: 0.12rem 0.55rem;
  letter-spacing: 0.04em;
  font-weight: 700;
  text-transform: capitalize;
  border-radius: 999px;
  line-height: 1.4;
}
.workspace-status-pill--inline.status-accepted {
  background: color-mix(in srgb, var(--state-success) 16%, transparent);
  color: var(--state-success);
}
.workspace-status-pill--inline.status-cancelled {
  background: color-mix(in srgb, var(--state-error) 16%, transparent);
  color: var(--state-error);
}
.workspace-status-pill--inline.status-pending {
  background: color-mix(in srgb, var(--state-warning) 18%, transparent);
  color: var(--state-warning);
}

/* Tags row sits below meta as its own line, larger touch targets */
.properties-reservation-quick-copy .workspace-list-tags {
  overflow: visible;
  max-width: none;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.1rem;
}

.properties-reservation-quick-copy .workspace-list-tag {
  font-size: 0.66rem;
  padding: 0.1rem 0.5rem;
  line-height: 1.35;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.properties-reservation-quick-copy .workspace-list-tag .workspace-tag-remove {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: currentColor;
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

.properties-reservation-quick-copy .workspace-list-tag .workspace-tag-remove:hover {
  opacity: 1;
  background: color-mix(in srgb, currentColor 18%, transparent);
}

.properties-tag-icon-btn {
  border: 1px dashed var(--border-subtle) !important;
  background: transparent !important;
  padding: 0.05rem 0.4rem !important;
  width: auto !important;
  height: 18px !important;
  font-size: 0.65rem;
  color: var(--text-muted);
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center;
  gap: 0.2rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}

.properties-tag-icon-btn:hover {
  border-color: color-mix(in srgb, var(--ring) 50%, var(--border-strong)) !important;
  color: var(--text-primary);
}

.properties-tag-icon-btn svg {
  width: 11px;
  height: 11px;
}

/* Avatar — slimmer 40px stack */
.properties-reservation-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.properties-reservation-avatar-wrap .workspace-list-avatar-fallback {
  width: 100%;
  height: 100%;
  font-size: 0.78rem;
}

.properties-reservation-avatar-wrap .workspace-list-avatar-platform {
  width: 18px;
  height: 18px;
  left: auto;
  right: -3px;
  bottom: -3px;
  border: 1.5px solid var(--bg-elevated);
  border-radius: 50%;
  background: var(--bg-elevated);
}

.properties-reservation-avatar-wrap .workspace-platform-logo-mini {
  width: 13px;
  height: 13px;
}

/* Action icons — hover-revealed by default, compact, subtle */
.properties-reservation-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  opacity: 0;
  transition: opacity 0.12s;
}

.properties-reservation-actions .workspace-inline-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: all 0.12s;
}

.properties-reservation-actions .workspace-inline-icon svg {
  width: 13px;
  height: 13px;
}

.properties-reservation-actions .workspace-inline-icon:hover {
  background: var(--surface-muted);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.properties-reservation-actions .workspace-inline-icon.active {
  color: var(--ring);
  background: color-mix(in srgb, var(--ring) 14%, transparent);
}

/* Age pill in the right column — smaller, muted */
.workspace-age-pill-bottom {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: transparent;
  padding: 0;
  font-variant-numeric: tabular-nums;
}

.properties-tag-picker {
  position: absolute;
  z-index: 90;
  top: calc(100% + 4px);
  left: 0;
  margin-top: 0;
  min-width: 240px;
  width: 240px;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  isolation: isolate;
}

.properties-reservation-row.has-open-tag-picker .properties-tag-picker {
  z-index: 120;
}

.properties-tag-picker .filter-input {
  height: 30px;
  min-height: 30px;
  font-size: 0.78rem;
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 0 0.5rem;
}

.properties-tag-picker .filter-input:focus {
  border-color: color-mix(in srgb, var(--ring) 55%, var(--border-strong));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ring) 14%, transparent);
  outline: none;
}

.properties-tag-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  max-height: 160px;
  overflow: auto;
}

.properties-tag-picker-caption {
  padding: 0 0.3rem;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
}

.properties-tag-picker-list .quick-filter-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  padding: 0.32rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.3;
  cursor: pointer;
  transition: background 0.1s;
}

.properties-tag-picker-list .quick-filter-item:not(:disabled):hover,
.properties-tag-picker-list .quick-filter-item:not(:disabled):focus-visible {
  background: var(--surface-muted);
}

.properties-tag-picker-list .quick-filter-item.is-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--text-muted);
  cursor: default;
}

.properties-tag-picker-list .quick-filter-item.is-applied small {
  color: var(--state-success);
  font-size: 0.62rem;
  font-weight: 750;
}

.properties-tag-icon-btn.is-labelled {
  width: auto;
  min-width: 0;
  gap: 0.35rem;
  padding: 0 0.55rem;
}

.properties-tag-icon-btn.is-labelled span {
  font-size: 0.72rem;
  font-weight: 700;
}

.properties-tag-picker-empty {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  padding: 0.5rem 0.5rem 0;
  text-align: center;
}

.properties-tag-picker-create {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 0.4rem;
  align-items: center;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border-subtle);
}

.properties-tag-picker-create input[type="color"] {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.properties-tag-picker-create .btn {
  height: 28px;
  min-height: 28px;
  padding: 0 0.7rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Anchor for grounded tag pickers (TagAddPopover): the shared
   .properties-tag-picker popover is position:absolute and needs a positioned
   inline-flex parent to hang the trigger + popover off. */
.tag-add-wrap {
  position: relative;
  display: inline-flex;
}

/* Detail headers place the add button against the right edge, so open the
   shared picker inward instead of letting it overflow off-screen. */
.property-details-tags-head .tag-add-wrap .properties-tag-picker {
  left: auto;
  right: 0;
}

.workspace-list-meta-row--tail {
  justify-content: flex-end;
}

.workspace-list-card--property .workspace-list-meta-row--tail {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.3rem;
}

.workspace-list-card--property .workspace-list-meta-row--final {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.32rem;
  justify-content: flex-start;
  flex-wrap: nowrap;
  padding-right: 88px;
  /* Intentionally NOT `position: relative`. The hover-icon tray
     (`.workspace-list-property-actions`) is `position: absolute` and
     needs to anchor to the card itself (the body is now also
     `position: static` for property cards so the absolute Active pill
     and action tray both reliably hit the card's top-right and
     bottom-right corners). */
  position: static;
}

.workspace-list-card--property .workspace-list-meta-row--final .workspace-list-context {
  min-width: 0;
  max-width: 100%;
}

.workspace-list-card--property .workspace-list-meta-row--tags {
  display: block;
  width: 100%;
  padding-right: 8px;
  margin-top: 0.06rem;
}

.workspace-list-card--property .workspace-list-meta-row--tags .workspace-list-tags {
  max-width: 100%;
  overflow: visible;
  flex-wrap: wrap;
}

.properties-reservation-pill-row .workspace-age-pill-bottom {
  position: static;
  opacity: 1;
  font-weight: 600;
}

/* .properties-reservation-actions kept — used by the row's action icon group.
   The detail-card / dl / financial-table styles previously here drove the
   click-for-details panel inside each reservation card; that panel was
   removed in favour of the right-pane reservation view, so the styles
   went with it. */
.properties-reservation-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

/* Tag remove (×) — used inline within tag chips */
.workspace-tag-remove {
  margin-left: 0.25rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0 0.2rem;
  border-radius: 999px;
  min-width: 14px;
  min-height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.workspace-tag-remove:hover {
  background: rgba(255, 255, 255, 0.08);
}

.properties-res-inbox {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

/* Reservation pane header — replaces the old name+subtitle stack
   with a Google-style avatar, the guest name, and quick action
   icons (star, mark unread) so the operator can act without
   scrolling. Tabs sit on the right with the quick actions. */
.properties-res-inbox-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}
.properties-res-inbox-identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}
.properties-res-inbox-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  object-fit: cover;
  user-select: none;
}
.properties-res-inbox-avatar-fallback {
  /* Background/colour set inline from a hashed-name hue so each guest
     gets a stable identity-marker colour. */
  text-transform: uppercase;
}
.properties-res-inbox-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.properties-res-inbox-quickactions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.properties-res-inbox-iconbtn {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease, transform 0.06s ease;
}
.properties-res-inbox-iconbtn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.properties-res-inbox-iconbtn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ring) 16%, var(--bg-elevated));
  color: var(--text-primary);
  border-color: var(--border-strong, var(--border-subtle));
}
.properties-res-inbox-iconbtn:active:not(:disabled) {
  transform: translateY(1px);
}
.properties-res-inbox-iconbtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.properties-res-inbox-iconbtn.is-active {
  color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  border-color: color-mix(in srgb, #f59e0b 50%, transparent);
}

/* Inbox/Details tabs in the reservation pane header — same chrome
   as the task drawer's tab strip so the two object types feel
   consistent. */
.properties-res-inbox-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--border-subtle) 60%, transparent);
}
.properties-res-inbox-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
}
.properties-res-inbox-tab.is-active {
  background: var(--bg-elevated);
  color: var(--text-main, var(--text-primary));
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* Details card — read-only summary of the reservation. Mirrors the
   task drawer's Details pane layout (label / value rows). */
.properties-res-details {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.7rem 0.85rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.properties-res-details-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  font-size: 0.82rem;
}
.properties-res-details-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
}
.properties-res-details-head strong {
  font-size: 1rem;
  font-weight: 700;
}
.properties-res-details-pill {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ring) 14%, transparent);
  color: var(--text-muted);
}
.properties-res-details-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.42rem 0.65rem;
  margin: 0;
  font-size: 0.84rem;
}
.properties-res-details-grid dt {
  color: var(--text-muted);
  font-size: 0.74rem;
}
.properties-res-details-grid dd {
  margin: 0;
  color: var(--text-primary);
}
.properties-res-details-note {
  font-size: 0.72rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-subtle);
  margin-top: 0.4rem;
}

/* Task-like sections on the Details tab (Notes, Linked tasks). Each
   section has a title row with an optional right-side action ("+
   Create task", "Saved" indicator, etc.) and a body. Visual
   language matches the rest of the Details pane. */
.properties-res-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--border-subtle);
}
.properties-res-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.properties-res-section-head h4 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.properties-res-section-meta {
  font-size: 0.75rem;
}
.properties-res-section-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary, #4f8df7);
  text-decoration: none;
}
.properties-res-section-link:hover {
  text-decoration: underline;
}
.properties-res-section-empty {
  font-size: 0.78rem;
  margin: 0;
}
.properties-res-notes {
  width: 100%;
  background: color-mix(in srgb, var(--ring) 4%, var(--surface-1));
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 60px;
}
.properties-res-notes:focus {
  outline: 2px solid color-mix(in srgb, var(--accent-primary, #4f8df7) 50%, transparent);
  outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent-primary, #4f8df7) 60%, var(--border-subtle));
}
.properties-res-linked-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.properties-res-linked-tasks li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 6px 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--ring) 6%, var(--surface-1));
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.82rem;
}
.properties-res-linked-tasks li > a:hover {
  background: color-mix(in srgb, var(--ring) 14%, transparent);
  border-color: color-mix(in srgb, var(--ring) 32%, var(--border-subtle));
}
.properties-res-linked-tasks-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.properties-res-linked-tasks-priority {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ring) 12%, transparent);
  color: var(--text-muted);
}
.properties-res-linked-tasks-priority.is-urgent,
.properties-res-linked-tasks-priority.is-high {
  background: color-mix(in srgb, var(--accent-danger, #c0392b) 14%, transparent);
  color: var(--accent-danger, #c0392b);
}
.properties-res-linked-tasks-priority.is-low {
  background: color-mix(in srgb, var(--accent-positive, #1f9d55) 14%, transparent);
  color: var(--accent-positive, #1f9d55);
}

/* ---------- Reservation Details — RICH (task-shaped) ---------- */

.properties-res-details-rich {
  gap: 0.85rem;
}
.properties-res-hero {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.properties-res-hero-id {
  flex: 1;
  min-width: 0;
}
.properties-res-hero-name {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.properties-res-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.properties-res-hero-actions {
  display: inline-flex;
  gap: 0.25rem;
}

/* Stats grid — quick at-a-glance numbers (check-in, nights, guests). */
.properties-res-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.4rem;
}
.properties-res-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.5rem 0.6rem;
  background: color-mix(in srgb, var(--ring) 5%, var(--surface-1));
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.properties-res-stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.properties-res-stat-value {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.properties-res-stat-sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Financial — a clean table (line item | amount), NOT bordered bubbles
   (Hakim 2026-06-13: "should be a table. makes no sense as bubbles"). */
.properties-res-fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.properties-res-fin-table th,
.properties-res-fin-table td {
  padding: 7px 2px;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
}
.properties-res-fin-table tr:last-child th,
.properties-res-fin-table tr:last-child td {
  border-bottom: 0;
}
.properties-res-fin-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-muted);
}
.properties-res-fin-table td {
  text-align: right;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.properties-res-fin-table td.is-good {
  color: var(--accent-positive, #1f9d55);
}
.properties-res-fin-table tr.is-subtle th,
.properties-res-fin-table tr.is-subtle td {
  font-weight: 500;
  color: var(--text-muted);
}

/* Tags inside Details */
.properties-res-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.properties-res-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-primary, #4f8df7) 14%, transparent);
  color: color-mix(in srgb, var(--accent-primary, #4f8df7) 88%, var(--text-primary));
  font-size: 0.74rem;
  font-weight: 600;
}
.properties-res-tag-remove {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}
.properties-res-tag-remove:hover {
  opacity: 1;
}
.properties-res-tag-input {
  flex: 1;
  min-width: 80px;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text-primary);
  font-size: 0.78rem;
  padding: 4px 6px;
}
.properties-res-tag-input::placeholder {
  color: var(--text-muted);
}

.properties-res-contact-link {
  color: var(--accent-primary, #4f8df7);
  text-decoration: none;
}
.properties-res-contact-link:hover {
  text-decoration: underline;
}

/* Internal toggle + send styling */
.properties-res-internal-toggle {
  appearance: none;
  -webkit-appearance: none;
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--bg-elevated) 70%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  margin-right: 6px;
}
.properties-res-internal-toggle:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--border-strong, var(--border-subtle));
}
.properties-res-internal-toggle.is-active {
  background: color-mix(in srgb, #fbbf24 22%, transparent);
  border-color: color-mix(in srgb, #fbbf24 55%, transparent);
  color: #b45309;
}
.properties-res-internal-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.properties-res-send-internal {
  background: linear-gradient(140deg, #f59e0b, #b45309) !important;
  color: #fff !important;
}
.properties-res-internal-banner {
  margin: 0.4rem 0 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #fbbf24 14%, transparent);
  border: 1px solid color-mix(in srgb, #fbbf24 38%, transparent);
  font-size: 0.74rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.properties-res-internal-banner code {
  background: color-mix(in srgb, var(--ring) 14%, transparent);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.72rem;
}

/* Internal message bubble in the conversation stream */
.properties-res-internal-author {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}
.properties-res-internal-author.is-mine {
  text-align: right;
}
.properties-res-message-internal:not(.out) .properties-res-internal-author:not(.is-mine) {
  text-align: left;
}
.properties-res-internal-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #fbbf24 18%, transparent);
  color: #b45309;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.properties-res-bubble-internal {
  background: color-mix(in srgb, #fbbf24 8%, var(--bg-elevated)) !important;
  border: 1px dashed color-mix(in srgb, #fbbf24 50%, var(--border-subtle)) !important;
  color: var(--text-primary);
}

/* Inline create-task modal — full-shape, ClickUp-style. The
   backdrop is solid (was barely-there before) so the dialog reads as
   a proper modal rather than an in-page panel. */
.properties-res-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 1rem 1rem;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.properties-res-modal {
  width: 100%;
  max-width: 460px;
  /* --bg-elevated is a SOLID surface (#17171a dark / #ffffff light).
     The previous token here (--surface-raised) doesn't exist anywhere,
     so the declaration was invalid and the modal rendered transparent
     with the calendar bleeding through. */
  background: var(--bg-elevated, #17171a);
  border: 1px solid var(--border-strong, var(--border-subtle));
  border-radius: 12px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.properties-res-modal-rich {
  max-width: 640px;
  max-height: calc(100vh - 12vh);
}
.properties-res-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.properties-res-modal-head-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.properties-res-modal-head h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.properties-res-modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 4px;
}
.properties-res-modal-close:hover {
  color: var(--text-primary);
}
.properties-res-modal-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: auto;
}
.properties-res-modal-related {
  margin: 0;
  font-size: 0.72rem;
}
.properties-res-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 12px 18px 14px;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--ring) 4%, transparent);
}
.properties-res-modal-foot-actions {
  display: flex;
  gap: 0.4rem;
}
.properties-res-modal-hint {
  font-size: 0.7rem;
}

/* Rich-modal content: title + description + grid of selects + assignees */
.properties-res-modal-title {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--text-primary);
}
.properties-res-modal-title::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}
.properties-res-modal-description {
  width: 100%;
  background: color-mix(in srgb, var(--ring) 4%, var(--surface-1));
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.5;
  resize: vertical;
}
.properties-res-modal-description:focus {
  outline: 2px solid color-mix(in srgb, var(--accent-primary, #4f8df7) 40%, transparent);
  outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent-primary, #4f8df7) 60%, var(--border-subtle));
}
.properties-res-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.7rem;
}
.properties-res-modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border-subtle);
}
.properties-res-modal-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.properties-res-modal-assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.properties-res-modal-assignee {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ring) 6%, var(--surface-1));
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.properties-res-modal-assignee:hover {
  background: color-mix(in srgb, var(--ring) 14%, var(--surface-1));
  border-color: color-mix(in srgb, var(--ring) 30%, var(--border-subtle));
}
.properties-res-modal-assignee.is-active {
  background: color-mix(in srgb, var(--accent-primary, #4f8df7) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary, #4f8df7) 60%, transparent);
  color: var(--text-primary);
}
.properties-res-modal-assignee-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 700;
  background: linear-gradient(140deg, #4f8df7, #6366f1);
  color: #fff;
}
.properties-res-modal-assignee-name {
  white-space: nowrap;
}

.properties-res-actions-title.is-danger {
  color: var(--accent-danger, #c0392b);
}

/* Inline activity events in the conversation timeline. Visually
   distinct from message bubbles — a slim, centred strip so the user
   can quickly differentiate a system event ("Sentiment changed",
   "Hostify action: accepted") from a guest/host message. */
.properties-res-activity-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 4px 12px;
  margin: 6px auto;
  font-size: 0.74rem;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--ring) 5%, transparent);
  border: 1px dashed var(--border-subtle);
  border-radius: 999px;
  width: fit-content;
  max-width: 90%;
}
.properties-res-activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ring) 14%, transparent);
  color: var(--text-primary);
}
.properties-res-activity-row.activity-hostify_action .properties-res-activity-icon {
  background: color-mix(in srgb, var(--accent-primary, #4f8df7) 22%, transparent);
  color: var(--accent-primary, #4f8df7);
}
.properties-res-activity-row.activity-sentiment_change .properties-res-activity-icon {
  background: color-mix(in srgb, var(--accent-warning, #d97706) 22%, transparent);
  color: var(--accent-warning, #d97706);
}
.properties-res-activity-row.activity-star .properties-res-activity-icon,
.properties-res-activity-row.activity-unstar .properties-res-activity-icon {
  background: color-mix(in srgb, var(--accent-warning, #d97706) 22%, transparent);
  color: var(--accent-warning, #d97706);
}
.properties-res-activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
/* Internal message body (body_html injected via dangerouslySetInnerHTML) */
.properties-res-internal-body {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
}
.properties-res-internal-body p { margin: 0; }
.properties-res-internal-body p + p { margin-top: 0.4rem; }
.properties-res-activity-time {
  margin-left: 0.4rem;
  font-size: 0.7rem;
}

.properties-res-details-status {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-positive, #1f9d55) 16%, transparent);
  color: var(--accent-positive, #1f9d55);
  margin-left: auto;
}
.properties-res-details-status.status-pending,
.properties-res-details-status.status-inquiry,
.properties-res-details-status.status-request,
.properties-res-details-status.status-new {
  background: color-mix(in srgb, var(--accent-warning, #d97706) 16%, transparent);
  color: var(--accent-warning, #d97706);
}
.properties-res-details-status.status-cancelled,
.properties-res-details-status.status-canceled,
.properties-res-details-status.status-declined {
  background: color-mix(in srgb, var(--accent-danger, #c0392b) 16%, transparent);
  color: var(--accent-danger, #c0392b);
}

/* Hostify reservation actions panel (Phase B). Lives below the
   details grid in the Details tab. Section titles + button rows +
   collapsible inline forms. Visual style matches the surrounding
   "premium" dark-mode chrome (subtle borders, mixed tints) so the
   panel reads as part of the reservation drawer rather than a
   transplanted form. */
.properties-res-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border-subtle);
}
.properties-res-actions-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0.6rem 0 0.1rem;
}
.properties-res-actions-title:first-child {
  margin-top: 0;
}
.properties-res-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.properties-res-action-btn {
  appearance: none;
  -webkit-appearance: none;
  background: color-mix(in srgb, var(--ring) 6%, var(--surface-1));
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.properties-res-action-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--ring) 14%, transparent);
  border-color: color-mix(in srgb, var(--ring) 32%, var(--border-subtle));
}
.properties-res-action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.properties-res-action-btn.is-good {
  background: color-mix(in srgb, var(--accent-positive, #1f9d55) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent-positive, #1f9d55) 36%, transparent);
  color: var(--accent-positive, #1f9d55);
}
.properties-res-action-btn.is-good:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-positive, #1f9d55) 22%, transparent);
}
.properties-res-action-btn.is-warn {
  background: color-mix(in srgb, var(--accent-danger, #c0392b) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent-danger, #c0392b) 32%, transparent);
  color: var(--accent-danger, #c0392b);
}
.properties-res-action-btn.is-warn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-danger, #c0392b) 20%, transparent);
}
.properties-res-action-btn.is-primary {
  background: color-mix(in srgb, var(--accent-primary, #4f8df7) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent-primary, #4f8df7) 38%, transparent);
  color: var(--accent-primary, #4f8df7);
}
.properties-res-action-btn.is-primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent-primary, #4f8df7) 28%, transparent);
}
.properties-res-action-btn.is-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}
.properties-res-actions-feedback {
  margin: 0.1rem 0 0;
  font-size: 0.74rem;
  font-weight: 500;
}
.properties-res-actions-feedback.is-ok {
  color: var(--accent-positive, #1f9d55);
}
.properties-res-actions-feedback.is-err {
  color: var(--accent-danger, #c0392b);
}
.properties-res-actions-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.7rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ring) 4%, var(--surface-1));
  margin: 0.2rem 0 0.5rem;
}
.properties-res-actions-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}
.properties-res-actions-field.is-inline {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
}
.properties-res-actions-field > span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}
/* The pickers here are SelectMenu triggers, i.e. <button>s — listing the trigger
   next to the inputs gives it the same box. */
.properties-res-actions-field input,
.properties-res-actions-field .selectmenu-trigger,
.properties-res-actions-field textarea {
  background: var(--surface-2, var(--surface-1));
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.82rem;
  font-family: inherit;
}
/* …and only the trigger needs the two things the global button rule takes away
   from it, which a <select> had for free: normal weight and full width. */
.properties-res-actions-field .selectmenu-trigger {
  font-weight: 400;
  width: 100%;
}
.properties-res-actions-field > .staff-event-availability-readonly {
  min-height: 31px;
  display: flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--surface-2, var(--surface-1));
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
}
.properties-res-actions-field textarea {
  resize: vertical;
  min-height: 60px;
}
.properties-res-actions-field input:focus,
.properties-res-actions-field .selectmenu-trigger:focus,
.properties-res-actions-field textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent-primary, #4f8df7) 50%, transparent);
  outline-offset: 1px;
  border-color: color-mix(in srgb, var(--accent-primary, #4f8df7) 60%, var(--border-subtle));
}
.properties-res-actions-field-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.properties-res-actions-form-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.2rem;
}
.properties-res-actions-foot {
  margin: 0.45rem 0 0;
  font-size: 0.7rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-subtle);
}

.properties-res-inbox-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}

.properties-res-inbox-bubbles {
  min-height: 0;
  flex: 1;
  overflow: auto;
  max-height: none;
}

.properties-res-inbox-compose {
  padding: 0.6rem;
  flex-shrink: 0;
}

.properties-res-inbox-compose .inbox-textarea {
  width: 100%;
  box-sizing: border-box;
}

.properties-res-inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-start;
}

.properties-res-compose-tools {
  margin-right: auto;
}

.properties-res-message-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  margin-bottom: 0.25rem;
  color: var(--text-soft);
  /* 0.75rem = the 12px readability floor (was 0.68rem ≈ 10.9px). */
  font-size: 0.75rem;
}

/* The rail's context bar is ~1/4 the width of the inbox's — let the sentiment
   chip and the Insight toggle keep their natural widths and wrap onto a second
   row instead of crushing each other into overlapping text. */
.properties-res-inbox .inbox-context-bar {
  flex-wrap: wrap;
  row-gap: 0.15rem;
}
.properties-res-inbox .inbox-context-bar > * {
  flex-shrink: 0;
  max-width: 100%;
}

.properties-res-message-wrap {
  display: flex;
  flex-direction: column;
}

.properties-res-message-wrap.in .properties-res-message-channel {
  align-self: flex-start;
}

.properties-res-message-wrap.out .properties-res-message-channel {
  align-self: flex-end;
}

.properties-child-note-row {
  margin-top: 0.45rem;
}

.properties-child-note-toggle {
  width: 100%;
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.74rem;
}

.properties-child-note-toggle > :last-child {
  margin-left: auto;
}

.properties-child-note-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-primary) 80%, white);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary) 18%, transparent);
}

.workspace-draft-pill.is-danger {
  border-color: color-mix(in srgb, #ef4444 65%, var(--border-subtle));
  color: #fecaca;
  background: color-mix(in srgb, #ef4444 22%, transparent);
}

.notion-slash-menu {
  min-width: 300px;
  max-height: 220px;
  padding: 0.35rem;
  gap: 0.15rem;
  overflow: auto;
}

.notion-slash-head {
  font-size: 0.63rem;
  color: var(--text-soft);
  padding: 0.1rem 0.35rem 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notion-slash-menu button {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 0.45rem;
  border-radius: 8px;
  padding: 0.35rem 0.42rem;
}

.notion-slash-menu button.is-active {
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-muted));
}

.notion-slash-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
}

.notion-slash-icon svg {
  width: 14px;
  height: 14px;
}

.notion-slash-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}

.notion-slash-copy strong {
  font-size: 0.73rem;
  font-weight: 600;
}

.notion-slash-copy small {
  font-size: 0.67rem;
  color: var(--text-soft);
}

.notion-slash-menu kbd {
  font-size: 0.62rem;
  padding: 0.05rem 0.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-soft);
}

.properties-satisfaction-select {
  min-width: 58px;
  max-width: 72px;
  padding-right: 0.25rem;
  text-align: center;
}

.properties-slash-wrap {
  position: relative;
}

.properties-slash-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  min-width: 140px;
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: grid;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  opacity: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.properties-intel-tab {
  position: relative;
}

.properties-intel-tab-card {
  min-height: calc(100vh - 180px);
  max-height: calc(100vh - 116px);
  overflow: hidden;
}

.properties-intel-surface-lg {
  min-height: 0;
}

.properties-intel-surface-lg .property-intel-editor-surface {
  min-height: calc(100vh - 360px);
  max-height: calc(100vh - 360px);
  height: calc(100vh - 360px);
  overflow: auto;
}

.properties-intel-surface-lg .property-intel-editor .ProseMirror {
  min-height: calc(100vh - 390px);
  max-height: none;
}

.properties-intel-selection-actions {
  position: fixed;
  transform: translate(-50%, -105%);
  display: grid;
  gap: 0.3rem;
  min-width: min(320px, 46vw);
  max-width: min(420px, 56vw);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: color-mix(in srgb, #0b1220 92%, var(--surface-elevated));
  padding: 0.45rem;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.55);
  z-index: 140;
}

.properties-intel-selection-actions textarea {
  min-height: 68px;
  resize: vertical;
}

.properties-intel-selection-actions-row {
  display: inline-flex;
  justify-content: flex-end;
  gap: 0.3rem;
}

.properties-intel-mention-menu {
  position: static;
  width: 100%;
  max-height: 180px;
  overflow: auto;
}

.properties-intel-comments-fab {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  font-size: 0.72rem;
  z-index: 120;
}

.properties-intel-comments-panel {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-44%);
  width: min(320px, 32vw);
  max-height: 58vh;
  overflow: hidden;
  z-index: 120;
}

.properties-intel-comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.properties-intel-comments-list {
  display: grid;
  gap: 0.35rem;
  max-height: calc(58vh - 64px);
  overflow: auto;
}

.properties-intel-comment {
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  color: var(--text-main);
  border-radius: 10px;
  text-align: left;
  padding: 0.4rem;
  display: grid;
  gap: 0.12rem;
}

.properties-intel-comment.is-active {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-muted));
}

.properties-intel-comment p {
  margin: 0;
  font-size: 0.74rem;
}

.properties-intel-comment em {
  color: var(--text-soft);
  font-size: 0.68rem;
}

.properties-intel-comment-mark {
  background: color-mix(in srgb, #f59e0b 38%, transparent);
  border-radius: 4px;
  padding: 0 2px;
}

.properties-intel-thread-panel {
  position: absolute;
  right: 354px;
  top: 50%;
  transform: translateY(-45%);
  width: min(360px, 34vw);
  max-height: 62vh;
  overflow: auto;
  z-index: 120;
}

.properties-intel-thread-replies {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.45rem;
}

.properties-intel-thread-reply {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 0.35rem;
  display: grid;
  gap: 0.1rem;
}

.properties-intel-thread-reply p {
  margin: 0;
  font-size: 0.73rem;
}

.properties-intel-thread-compose {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.35rem;
}

.properties-intel-comment-delete {
  justify-self: flex-end;
}

.properties-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  color: var(--text-main);
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  font-size: 0.72rem;
  cursor: pointer;
}

.properties-toggle-pill .properties-toggle-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-elevated);
}

.properties-toggle-pill.is-on {
  border-color: color-mix(in srgb, #22c55e 65%, var(--border-subtle));
  background: color-mix(in srgb, #22c55e 16%, var(--surface-muted));
}

.properties-toggle-pill.is-on .properties-toggle-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 24%, transparent);
}

.properties-intel-sticky {
  margin-top: 0.45rem;
}

.properties-intel-actions {
  display: grid;
  gap: 0.4rem;
}

.properties-intel-actions-list {
  display: grid;
  gap: 0.4rem;
}

.properties-intel-section-sep {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 0.2rem 0 0.15rem;
}

.properties-intel-actions-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem;
  align-items: center;
}

.properties-intel-action-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.42rem 0.42rem 2rem;
  background: var(--surface-muted);
  display: grid;
  gap: 0.24rem;
  position: relative;
}

.properties-intel-action-card .properties-icon-button {
  position: absolute;
  right: 0.56rem;
  bottom: 0.5rem;
  color: #f87171;
  border-color: color-mix(in srgb, #ef4444 42%, var(--border-subtle));
  background: color-mix(in srgb, #ef4444 12%, var(--bg-elevated));
}

.properties-intel-action-card .properties-icon-button:hover {
  color: #fecaca;
  border-color: #ef4444;
  background: color-mix(in srgb, #ef4444 22%, var(--bg-elevated));
}

.properties-icon-button-danger {
  color: #f87171;
  border-color: color-mix(in srgb, #ef4444 42%, var(--border-subtle));
  background: color-mix(in srgb, #ef4444 12%, var(--bg-elevated));
}

.properties-icon-button-danger:hover {
  color: #fecaca;
  border-color: #ef4444;
  background: color-mix(in srgb, #ef4444 22%, var(--bg-elevated));
}

.properties-intel-action-card .field {
  margin: 0;
}

.properties-intel-action-card .field > span {
  font-size: 0.66rem;
}

.properties-intel-action-card input {
  height: 30px;
  font-size: 0.75rem;
}

.properties-intel-action-card textarea.properties-input-text {
  min-height: 84px;
  height: auto;
  resize: vertical;
  line-height: 1.35;
}

.properties-contact-card {
  gap: 0.38rem;
  padding: 0.5rem 0.56rem 2.35rem;
}

.properties-contact-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
}

.properties-contact-card-head strong {
  font-size: 0.84rem;
  line-height: 1.2;
}

.properties-contact-card .field {
  width: calc(100% - 2.8rem);
  max-width: 260px;
  padding-right: 0;
}

.properties-contact-card .properties-input-select {
  width: 100%;
  min-height: 30px;
  font-size: 0.74rem;
  padding: 0.24rem 0.45rem;
}

.properties-contact-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.properties-contact-card-meta p {
  margin: 0;
  display: grid;
  gap: 0.12rem;
}

.properties-contact-card-meta p span {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.properties-contact-card-meta p strong {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

.properties-access-toggle {
  justify-self: flex-start;
}

.properties-combo-with-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem;
  align-items: center;
}

.properties-intel-file-name {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
}

.properties-slash-menu button {
  border: 0;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  padding: 0.42rem 0.58rem;
  cursor: pointer;
}

.properties-slash-menu button:hover {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.properties-res-send-channel {
  max-width: 100%;
  flex-wrap: wrap;
}

.properties-tiptap-editor .ProseMirror {
  min-height: inherit;
  outline: none;
}

@media (max-width: 1180px) {
  /* The room's pane-4 support rail stacks below the timeline here — let it flow
     (drop the desktop inner-scroll trap) so the thread view + its composer stay
     fully reachable instead of collapsing into a 0-height clipped box. */
  .rc-support {
    overflow: visible;
  }
  .rc-support-scroll {
    overflow-y: visible;
  }

  .properties-reservations-toolbar {
    gap: 0.35rem;
  }

  .properties-reservations-toolbar-top {
    flex-wrap: wrap;
  }

  .properties-res-inbox-toolbar {
    gap: 0.25rem;
  }

  .properties-res-send-channel {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@container workspace-main (max-width: 1180px) {
  .reservation-shell { grid-template-columns: minmax(0, 1fr); height: 100%; }
  .reservation-controls { grid-template-columns: 1fr; }
  .reservation-actions-right { justify-self: stretch; flex-wrap: wrap; }
}

.properties-management-stack {
  display: grid;
  gap: 0.9rem;
}

/* Contact picker rows on the Management tab carry the SHARED ContactAvatar
   (same identity visual as every contact surface) ahead of name + type. */
.properties-contact-picker-row {
  grid-template-columns: auto 1fr auto;
}
.properties-picker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  object-fit: cover;
}

/* A related-contact card row on the Management tab: the SHARED object card
   (same design as the inbox Details pane) plus dates + unlink buttons beside
   it. The row stacks its card line and the (occasional) dates editor. */
.properties-related-contact-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.properties-related-contact-line {
  display: flex;
  align-items: center;
  gap: 6px;
}
.properties-related-contact-row .inbox-crm-property {
  flex: 1;
  min-width: 0;
}
/* Dated links: an ended link stays visible as history, quietly; a not-yet-
   started link reads slightly ahead-of-time. Both themes inherit via opacity. */
.properties-related-contact-row--ended .inbox-crm-property,
.properties-related-contact-row--ended .properties-icon-button:not([aria-pressed="true"]) {
  opacity: 0.55;
}
.properties-related-contact-row--future .inbox-crm-property {
  opacity: 0.78;
}

/* The link-dates step (picker step 2) and the per-row dates editor. Token-only
   so light/dark parity comes free; inputs reuse properties-input-text. */
.properties-link-dates {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.7rem 0.75rem;
}
.properties-link-dates--row {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
}
.properties-link-dates-title {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-primary);
}
.properties-link-dates-fields {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap; /* small screens: the two dates stack instead of clipping */
}
.properties-link-date {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 150px;
  min-width: 0;
}
.properties-link-date > span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.properties-link-dates-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Type-grouped related contacts (Contacts field): a light heading per type over
   its cards. Layout only — the label/count reuse the desc-group typography. */
.properties-related-type-groups {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.properties-related-type-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.8rem 0 0.45rem;
}
.properties-related-type-meaning {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}
.properties-related-type-groups > div:first-child .properties-related-type-head {
  margin-top: 0.2rem;
}

.properties-management-fee-adder {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.properties-management-fee-adder-card {
  width: 100%;
  padding: 0.72rem;
  border-radius: 12px;
}

/* Phone input (react-phone-number-input) — match other text inputs */
.phone-input-control {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  width: 100%;
}
.phone-input-control .PhoneInputCountry {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.phone-input-control .PhoneInputCountrySelect {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 0;
  outline: 0;
  cursor: pointer;
  font: inherit;
}
.phone-input-control .PhoneInputCountrySelect option {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.phone-input-control .PhoneInputCountrySelectArrow {
  color: var(--text-primary);
  opacity: 0.7;
}
.phone-input-control .PhoneInputInput {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font: inherit;
  color: var(--text-primary);
  padding: 0;
}
.phone-input-control .PhoneInputInput::placeholder {
  color: var(--text-muted);
}

/* Registry summary right-pane */
.registry-summary {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0.8rem;
}
.registry-summary-card {
  padding: 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-input) 88%, var(--bg-elevated));
}
.registry-summary-row {
  display: grid;
  /* auto-fit + a real minimum: five-figure sums get a full column instead of
     overflowing into their neighbour; narrow panes stack 2+1. */
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 0.6rem;
}
.registry-summary-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.registry-summary-value {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 0.2rem;
  color: var(--text-primary);
}
.registry-summary-subvalue {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.2rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.registry-summary-foot {
  font-size: 0.78rem;
  line-height: 1.4;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border-subtle);
}
.registry-summary-empty {
  padding: 1rem;
  font-size: 0.85rem;
}

/* Registry quick filters */
.workspace-list-quickfilters--registry {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem 0.6rem;
}
.workspace-quickfilter-chip {
  font-size: 0.72rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--color-border, #e2e2e6);
  background: var(--color-surface-1, #fff);
  cursor: pointer;
  color: var(--color-text-muted, #6b7280);
}
.workspace-quickfilter-chip.is-active {
  background: var(--color-accent, #2563eb);
  color: #fff;
  border-color: var(--color-accent, #2563eb);
}

/* Tighten registry rows to match property card density */
.workspace-list-card--registry {
  padding: 0.55rem 0.7rem;
  margin: 0;
  border-radius: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  align-self: start;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 0;
}

.workspace-list-scroll--registry {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-content: flex-start;
  gap: 0.14rem;
}
.workspace-list-card--registry .workspace-list-title {
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-list-card--registry .workspace-list-subtitle {
  font-size: 0.74rem;
  color: var(--color-text-muted, #6b7280);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-list-card--registry .workspace-list-meta {
  font-size: 0.7rem;
  color: var(--color-text-muted, #9ca3af);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-list-card--registry.is-archived {
  opacity: 0.55;
}

.workspace-list-registry-actions {
  left: auto;
  right: 0.4rem;
  bottom: 0.38rem;
}

/* Accounting shared editor language — ONE segmented control + editor chrome
   for fees, chart of accounts and the settlement waterfall (2026-07-10), so
   the three pages read as one product. */
.acct-pills {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 9px;
  background: var(--bg-input, rgba(17, 24, 39, 0.6));
}
.acct-pill {
  border: 0;
  background: transparent;
  color: var(--text-muted, #9ca3af);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.acct-pill:hover {
  color: var(--text-primary, inherit);
}
.acct-pill.is-active {
  background: var(--accent, #4f46e5);
  color: #fff;
}
.acct-pill:disabled {
  opacity: 0.55;
  cursor: default;
}
[data-theme="light"] .acct-pills {
  background: #f4f4f2;
  border-color: rgba(0, 0, 0, 0.1);
}
.acct-pills-row {
  margin: 0.6rem 0 1rem;
}
.field .acct-pills {
  align-self: flex-start;
  margin-top: 0.15rem;
}
.field-help {
  font-size: 0.78rem;
  margin-top: 0.3rem;
  margin-bottom: 0;
}
.registry-detail-head {
  margin-bottom: 1rem;
}
.registry-editor-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.registry-editor-actions.has-delete {
  justify-content: space-between;
}
.registry-editor-actions-end {
  display: flex;
  gap: 0.5rem;
}
/* Left cluster (Delete + Duplicate) mirrors -end; token-only, so light/dark for free. */
.registry-editor-actions-start {
  display: flex;
  gap: 0.5rem;
}
.acct-modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.acct-modal-copy {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
}
select.properties-input-text {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239ca3af' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2.1rem;
}
[data-theme="light"] select.properties-input-text {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.fee-default-price-input {
  max-width: 220px;
}

/* Settlement waterfall (owner payout ordering) */
.settlement-waterfall-page {
  max-width: none;
  width: 100%;
  min-width: 0;
}
.settlement-waterfall-page .registry-editor-grid {
  max-width: none;
  width: 100%;
}
.settlement-waterfall-page .sw-account-default-panel {
  max-width: none;
  width: 100%;
}
.settlement-waterfall-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) {
  .settlement-waterfall-grid {
    grid-template-columns: 1fr;
  }}
.settlement-waterfall-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
.settlement-waterfall-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.settlement-waterfall-desc {
  margin: 0;
  font-size: 0.82rem;
}
.settlement-waterfall-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.settlement-waterfall-table-wrap {
  margin-top: 0.25rem;
}
.settlement-waterfall-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.settlement-waterfall-table th,
.settlement-waterfall-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  vertical-align: middle;
}
.sw-col-drag {
  width: 2rem;
  color: var(--text-muted, #9ca3af);
  cursor: grab;
}
.settlement-waterfall-table tr.is-dragging {
  opacity: 0.55;
}
.settlement-drag-hint {
  user-select: none;
  letter-spacing: -0.12em;
  /* A drag affordance has to LOOK grabbable — full-stop-sized glyphs read as dirt
     (feedback_icons_too_small). */
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  min-height: 24px;
}
.sw-role {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
}
.sw-role--payout {
  color: #86efac;
}
.sw-role--start {
  color: #93c5fd;
}
.sw-role--deduction {
  color: #fcd34d;
}

/* Waterfall v2 — composable line formula builder + per-line visibility */
.sw-col-line {
  /* The line NAME is the row's identity — it gets the lion's share of the width
     so labels like "Management commission (11%)" never truncate. */
  width: 40%;
  min-width: 300px;
}
.sw-col-line .properties-input-text {
  width: 100%;
}
.sw-role-select {
  min-width: 6.2rem;
}
.sw-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.sw-formula-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  font-size: 0.78rem;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--bg-elevated, #1a1d24) 85%, transparent);
  color: var(--text-main, inherit);
  white-space: nowrap;
}
.sw-formula-sign {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--accent-primary, #4f46e5);
  cursor: pointer;
  min-width: 0.55rem;
  text-align: center;
}
.sw-formula-sign:disabled {
  cursor: default;
}
.sw-formula-period {
  font-size: 0.66rem;
  color: var(--text-muted, #9ca3af);
}
.sw-formula-remove {
  border: none;
  background: none;
  padding: 0 0.1rem;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  min-width: 16px;
  min-height: 16px;
}
.sw-formula-remove:hover {
  color: var(--accent-danger, #ef4444);
}
/* The add-amount picker reads as a quiet chip in the formula row, not a full
   form input repeated on every line. */
.sw-formula-add {
  width: auto;
  max-width: 9.5rem;
  font-size: 0.78rem;
  padding: 0.16rem 1.3rem 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.18));
  background: transparent;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
}
.sw-formula-add:hover,
.sw-formula-add:focus {
  color: var(--text-primary, inherit);
  border-color: var(--accent, #4f46e5);
}
/* Trigger variant of the quiet chip: it's a <button> now (opens the
   searchable panel) rather than a <select>, so no chevron padding. */
.sw-amount-picker-trigger {
  padding: 0.16rem 0.6rem;
}
/* The searchable amount panel — position:fixed so it escapes the editor
   table's overflow container (tooltips-escape-overflow rule); anchored to the
   trigger by WaterfallAmountPicker. Chrome mirrors the properties-combobox
   family; group labels mirror the composer mention menu (sticky, uppercase). */
.sw-amount-picker-panel {
  position: fixed;
  z-index: 130;
  display: flex;
  flex-direction: column;
  max-height: 320px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  border-radius: 10px;
  background: var(--bg-elevated, #171a2c);
  box-shadow: var(--shadow-soft, 0 12px 32px rgba(0, 0, 0, 0.35));
  overflow: hidden;
}
.sw-amount-picker-search {
  margin: 0.5rem 0.5rem 0.35rem;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  border-radius: 8px;
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  color: var(--text-primary, inherit);
}
.sw-amount-picker-search:focus {
  outline: none;
  border-color: var(--accent, #4f46e5);
}
.sw-amount-picker-list {
  list-style: none;
  margin: 0;
  padding: 0 0.35rem 0.35rem;
  overflow-y: auto;
}
.sw-amount-picker-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sw-amount-picker-group-label {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.45rem 0.45rem 0.25rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #9ca3af);
  background: var(--bg-elevated, #171a2c);
}
.sw-amount-picker-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  width: 100%;
  padding: 0.4rem 0.45rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary, inherit);
  text-align: left;
  cursor: pointer;
  font-size: 0.82rem;
}
.sw-amount-picker-option.is-active {
  background: color-mix(in srgb, var(--accent, #4f46e5) 14%, transparent);
}
.sw-amount-picker-option-hint {
  color: var(--text-muted, #9ca3af);
  font-size: 0.72rem;
}
.sw-amount-picker-option-desc {
  color: var(--text-muted, #9ca3af);
  font-size: 0.72rem;
  line-height: 1.3;
}
.sw-amount-picker-empty {
  padding: 0.6rem 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted, #9ca3af);
}
.sw-amount-picker-foot {
  padding: 0.35rem 0.6rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  font-size: 0.7rem;
  color: var(--text-muted, #9ca3af);
}
[data-theme="light"] .sw-amount-picker-panel,
[data-theme="light"] .sw-amount-picker-group-label {
  background: #ffffff;
}
/* Collapsed secondary sections in the validation pane (channel notes, money
   routing, sample sandbox) — quiet disclosure rows so the real-booking trace
   stays the star. */
.sw-validate-details {
  margin: 0.55rem 0 0;
}
.sw-validate-details > summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted, #9ca3af);
  padding: 0.3rem 0.1rem;
  list-style: revert;
}
.sw-validate-details[open] > summary,
.sw-validate-details > summary:hover {
  color: var(--text-primary, inherit);
}
/* Booking / Listing / Owner switch now uses the shared .acct-pills control
   (see "Accounting shared editor language" block). */
.acct-pills.sw-validate-modes-gap {
  margin-bottom: 0.6rem;
}
/* Statement-month picker inside the selected-target chip. */
.sw-validate-month-select {
  flex: 0 0 auto;
  width: auto;
  min-height: 30px;
  padding: 0.24rem 1.9rem 0.24rem 0.5rem;
  font-size: 0.76rem;
}
/* That 1.9rem on the right reserved room for the caret `select.properties-input-text`
   painted as a background image. A SelectMenu trigger draws its own chevron inline,
   and the element-scoped caret rule no longer applies, so the reserve is now just a
   gap — give it back. */
.selectmenu-trigger.sw-validate-month-select {
  padding-right: 0.5rem;
}
/* Per-line "show your working" — one sub-line per formula term. */
.sw-term-breakdown {
  margin-top: 0.2rem;
  display: grid;
  gap: 0.08rem;
}
.sw-term-line {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.68rem;
  line-height: 1.35;
}
.sw-term-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-term-amount {
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Properties -> Financials tab (PropertyFinancialsWaterfall). Reuses the
   settlement-preview-mini / sw-term-* / owner-stmt-payout families; these add
   the period toolbar, the per-month strip, and layout. All theme-tokenised. */
.fin-wf {
  display: grid;
  gap: 0.75rem;
}
/* The results wrapper mirrors .fin-wf's grid so the cards keep their rhythm; while a
   new period/waterfall computes, the stale numbers dim so the switch visibly "took". */
.fin-wf-results {
  display: grid;
  gap: 0.75rem;
}
.fin-wf-results.is-refreshing {
  opacity: 0.55;
  transition: opacity 0.15s ease;
}
.fin-wf-headline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.fin-wf-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}
.fin-wf-sub {
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 0;
  max-width: 46ch;
}
.fin-wf-payout {
  text-align: right;
  align-items: flex-end;
}
.fin-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.85rem;
}
.fin-period-inputs,
.fin-range-inputs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.fin-period-select {
  min-height: 32px;
  width: auto;
  min-width: 130px;
}
.fin-range-arrow {
  font-size: 0.9rem;
}
.fin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.fin-section-h {
  margin: 0;
  font-size: 0.92rem;
}
.fin-section-meta {
  font-size: 0.76rem;
}
.fin-period-note {
  font-size: 0.68rem;
  font-style: italic;
  margin-top: 0.15rem;
}
.settlement-preview-mini tr.fin-row-payout td {
  font-weight: 700;
  border-top: 2px solid var(--border-strong, var(--border-subtle, rgba(255, 255, 255, 0.18)));
}
/* ── Per-booking ledger + mini-waterfall (Financials Slice 2b) ───────────────
   A first-class, scannable table of the bookings behind the statement; each row
   opens an inline mini-fall — the booking's OWN waterfall, in the user's own
   labels. Reuses .fin-track/.fin-fill/.fin-cut/.fin-add and the deck's tokens
   (--bg-input / --border-subtle / --text-muted / --accent) for light+dark. */
.fin-ledger-card {
  margin-top: 0.9rem;
}
.fin-ledger-table {
  width: 100%;
  font-size: 0.8rem;
}
.fin-ledger-caret-h,
.fin-ledger-caret {
  width: 1.7rem;
  text-align: center;
}
.fin-ledger-row {
  cursor: pointer;
  transition: background 0.12s ease;
}
.fin-ledger-row:hover {
  background: var(--bg-input, rgba(255, 255, 255, 0.05));
}
.fin-ledger-row.is-open {
  background: var(--bg-input, rgba(255, 255, 255, 0.08));
}
.fin-ledger-caret-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted, #9aa0aa);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
}
.fin-ledger-caret-btn:hover {
  color: var(--text-primary, #ffffff);
}
.fin-ledger-guest {
  font-weight: 600;
}
.fin-ledger-guest > span,
.fin-ledger-guest > small {
  display: block;
}
.fin-ledger-guest > small {
  margin-top: 0.08rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
}
.fin-ledger-stay {
  white-space: nowrap;
}
.fin-ledger-net {
  font-weight: 600;
}
.fin-ledger-detail-row > td {
  padding: 0 0 0.6rem;
}
.fin-ledger-detail {
  margin-left: 1.7rem;
  padding: 0.75rem 0.9rem 0.85rem;
  border-radius: 10px;
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}
.fin-ledger-facts {
  margin: 0.6rem 0 0;
  font-size: 0.74rem;
  line-height: 1.4;
}
/* Channel + ADR live as columns on desktop; on mobile those columns are hidden
   (so the table fits with no horizontal scroll) and this line carries them
   inside the drawer instead — shown only under the breakpoint, so neither mode
   duplicates the other. */
.fin-ledger-detail-meta {
  display: none;
  margin: 0 0 0.5rem;
  font-size: 0.74rem;
}
.fin-ledger-note {
  margin: 0.8rem 0 0;
  font-size: 0.73rem;
  line-height: 1.45;
}
/* Mini-waterfall inside an expanded ledger row. */
.fin-mini {
  display: grid;
  gap: 0.5rem;
}
.fin-mini-line {
  display: grid;
  gap: 0.28rem;
}
.fin-mini-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.fin-mini-label {
  flex: 1 1 40%;
  font-size: 0.8rem;
}
.fin-mini-strong .fin-mini-label {
  font-weight: 700;
}
.fin-mini-amt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.82rem;
}
.fin-mini-delta {
  font-variant-numeric: tabular-nums;
  color: var(--fin-cut, #f59e0b);
}
.fin-mini-delta.is-credit {
  color: var(--state-success, #16a34a);
}
.fin-mini-pct {
  font-size: 0.72rem;
}
.fin-mini-after {
  min-width: 3.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}
.fin-mini-payout {
  margin-top: 0.1rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
}
/* Manual adjustments (Slice 3) — mini-waterfall rows, the statement's adjustments +
   adjusted-payout lines, the hero hint, and the per-booking editor. Reuse the fall's
   tokens: amber (--fin-cut) lowers the take-home, green (--state-success) raises it,
   indigo (--accent) is the take-home itself. */
.fin-mini-adj {
  padding-left: 0.1rem;
}
.fin-mini-adj:first-of-type {
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.16));
}
.fin-mini-preadj {
  opacity: 0.82;
}
.fin-mini-adjusted .fin-mini-label {
  color: var(--accent, #4f46e5);
}
.fin-line-adj .fin-line-amount {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fin-cut, #f59e0b);
}
.fin-line-adj .fin-line-amount.is-credit {
  color: var(--state-success, #16a34a);
}
.fin-line-adjusted {
  border-top-style: dashed;
}
.fin-wf-payout-adj {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.1rem;
}
/* Slice 2: shortfall notice under the owner-charges table (theme tokens only). */
.fin-wf-shortfall {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.12));
  font-size: 0.8rem;
}
.fin-adj {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  display: grid;
  gap: 0.6rem;
}
.fin-adj-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.fin-adj-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
}
.fin-adj-item-label {
  flex: 1 1 auto;
  display: grid;
  gap: 0.08rem;
}
.fin-adj-item-note {
  font-size: 0.7rem;
  font-weight: 400;
  line-height: 1.35;
}
.fin-adj-item-review {
  color: color-mix(in srgb, var(--state-warning) 84%, var(--text-primary));
}
.fin-adj-item-entered {
  display: grid;
  justify-items: end;
  gap: 0.08rem;
  flex: 0 0 auto;
}
.fin-adj-item-entered > small {
  font-size: 0.65rem;
  line-height: 1;
}
.fin-adj-item-amt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--fin-cut, #f59e0b);
}
.fin-adj-item-amt.is-credit {
  color: var(--state-success, #16a34a);
}
/* Money history (system-authored channel changes) in the ledger drawer — rides
   the fin-adj list styles above; only the head strip and note editor are new.
   Tokens only (no hardcoded colours) so light/dark both hold. */
.fin-money-history-head {
  margin: 0;
  font-size: 0.72rem;
}
.fin-money-note-edit {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.25rem;
}
.fin-money-note-input {
  width: 100%;
  resize: vertical;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  color: var(--text-primary, inherit);
  font: inherit;
  font-size: 0.75rem;
}
.fin-money-note-err {
  color: var(--state-danger, #dc2626);
  font-size: 0.7rem;
}
.fin-adj-del {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  line-height: 1;
  font-size: 0.78rem;
}
.fin-adj-del:hover:not(:disabled) {
  color: var(--state-danger, #dc2626);
  border-color: var(--state-danger, #dc2626);
}
.fin-adj-del:disabled {
  opacity: 0.5;
  cursor: default;
}
.fin-adj-form {
  display: grid;
  gap: 0.5rem;
}
.fin-adj-question {
  display: grid;
  gap: 0.35rem;
}
.fin-adj-question-label,
.fin-adj-field > span {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted, #9ca3af);
}
.fin-adj-types {
  flex-wrap: wrap;
}
.fin-adj-main-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1.2fr) minmax(13rem, 1.4fr) minmax(7rem, 0.6fr);
  align-items: end;
  gap: 0.55rem;
}
.fin-adj-field {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}
/* This rule IS the picker's box, so it follows the control: the picker is a
   SelectMenu trigger now, and font-weight puts back what the global button rule
   takes away. */
.fin-adj-field .selectmenu-trigger {
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  color: var(--text-primary, inherit);
  font-size: 0.8rem;
  font-weight: 400;
}
.fin-adj-direction-field .segmented-control {
  width: 100%;
}
.fin-adj-direction-field .segmented-control-btn {
  flex: 1 1 9rem;
}
.fin-adj-amount-field .properties-currency-input {
  width: 100%;
}
.fin-adj-preview {
  display: grid;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  border-radius: 10px;
  background: var(--surface-2, rgba(255, 255, 255, 0.03));
  font-size: 0.75rem;
}
.fin-adj-impact-list {
  display: grid;
  gap: 0.32rem;
  margin: 0;
}
.fin-adj-impact-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.fin-adj-impact-list dt,
.fin-adj-impact-list dd {
  margin: 0;
}
.fin-adj-impact-list dd {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fin-adj-impact-list .is-payout {
  margin-top: 0.12rem;
  padding-top: 0.42rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  font-size: 0.82rem;
  font-weight: 700;
}
.fin-adj-preview-retry {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.fin-adj-more {
  font-size: 0.75rem;
}
.fin-adj-more > summary {
  width: fit-content;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
}
.fin-adj-more-fields {
  display: grid;
  grid-template-columns: minmax(8rem, 0.55fr) repeat(2, minmax(10rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.fin-adj-more-fields .fin-adj-statement-note {
  grid-column: 1 / -1;
  margin-top: 0;
}
.fin-adj-save-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-block: 0.65rem;
}
.fin-adj-form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.fin-adj-label-input {
  flex: 1 1 8rem;
  min-width: 6rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  color: var(--text-primary, inherit);
  font-size: 0.8rem;
}
.fin-adj-add {
  flex: 0 0 auto;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent, #4f46e5);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}
.fin-adj-add:disabled {
  opacity: 0.55;
  cursor: default;
}
.fin-adj-err {
  margin: 0;
  font-size: 0.74rem;
  color: var(--state-danger, #dc2626);
}
/* Line-targeted adjustments (2026-08-01): the "Applies to" picker, the
   owner-visible statement note, and the recalculation hint. Theme tokens only
   (light + dark parity). */
.fin-adj-target-select {
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  color: var(--text-primary, inherit);
  font-size: 0.8rem;
}
.fin-adj-statement-note {
  margin-top: 0.4rem;
  width: 100%;
}
.fin-adj-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
}
/* Adjustment actions use an explicit two-step inline delete confirmation. */
.fin-adj-action-btn {
  flex: 0 0 auto;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: var(--text-muted, #9ca3af);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1;
}
.fin-adj-action-btn:hover:not(:disabled) {
  color: var(--text-primary, inherit);
  border-color: var(--text-muted, #9ca3af);
}
.fin-adj-action-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.fin-adj-delete-confirm {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: 0.74rem;
  color: var(--text-muted, #9ca3af);
}
.fin-adj-delete-go,
.fin-adj-action-cancel {
  flex: 0 0 auto;
  padding: 0.28rem 0.6rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
}
.fin-adj-delete-go {
  border: 1px solid transparent;
  background: var(--state-danger, #dc2626);
  color: #fff;
}
.fin-adj-action-cancel {
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: var(--text-muted, #9ca3af);
}
.fin-adj-delete-go:disabled,
.fin-adj-action-cancel:disabled {
  opacity: 0.55;
  cursor: default;
}
@media (max-width: 560px) {
  .fin-adj-main-row,
  .fin-adj-more-fields {
    grid-template-columns: 1fr;
  }
  .fin-adj-more-fields .fin-adj-statement-note {
    grid-column: auto;
  }
  .fin-adj-impact-list > div {
    align-items: flex-start;
  }
  .fin-adj-form-row {
    align-items: stretch;
  }
  .fin-adj-label-input {
    flex-basis: 100%;
  }
}
@media (max-width: 560px) {
  .fin-ledger-detail {
    margin-left: 0;
  }
  /* Drop the two lower-priority columns so the table fits the viewport with no
     horizontal scroll (which would push the drawer's amounts off-screen). */
  .fin-ledger-chan,
  .fin-ledger-adr {
    display: none;
  }
  .fin-ledger-detail-meta {
    display: block;
  }
  .fin-ledger-stay {
    white-space: normal;
  }
}
.fin-warnings {
  margin: 0.75rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.25rem;
}
.fin-warnings li {
  font-size: 0.74rem;
  line-height: 1.4;
}
/* Per-month net strip (year / range views). */
.fin-month-strip {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  height: 132px;
  padding: 0.35rem 0.1rem 0;
  overflow-x: auto;
}
.fin-month-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1 1 0;
  min-width: 34px;
  height: 100%;
}
.fin-month-amt {
  font-size: 0.62rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted, #9ca3af);
  height: 0.9rem;
  white-space: nowrap;
}
.fin-month-track {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.fin-month-bar {
  width: 62%;
  min-width: 8px;
  background: var(--accent, #4f46e5);
  border-radius: 4px 4px 0 0;
  transition: height 0.18s ease;
}
.fin-month-bar.is-neg {
  background: var(--state-error, #dc2626);
  opacity: 0.85;
}
.fin-month-label {
  font-size: 0.64rem;
  color: var(--text-muted, #9ca3af);
}
.fin-skeleton {
  height: 1.1rem;
  border-radius: 6px;
  margin: 0.5rem 0;
  background: linear-gradient(90deg, var(--bg-input, rgba(255, 255, 255, 0.05)) 25%, var(--bg-elevated, rgba(255, 255, 255, 0.09)) 37%, var(--bg-input, rgba(255, 255, 255, 0.05)) 63%);
  background-size: 400% 100%;
  animation: fin-shimmer 1.3s ease infinite;
}
.fin-skeleton:nth-child(2) {
  width: 82%;
}
.fin-skeleton:nth-child(3) {
  width: 64%;
}
@keyframes fin-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
.fin-wf-empty {
  text-align: center;
}
.fin-wf-empty-hint {
  font-size: 0.76rem;
  margin-top: 0.3rem;
}

/* ── Financials STATS DECK — headline tiles + channel/distribution panels ──
   Sits above the statement. Hand-rolled CSS bars (no chart lib), theme-tokenised. */
/* ── Financials PERFORMANCE deck (redesigned 2026-07-11) ─────────────────────
   Operating performance above the settlement statement — how the property DID,
   NOT a money restatement. A calm primary row (money in / occupancy / ADR /
   RevPAR), each with an UN-COLOURED prior-period comparator ("was £153"); no
   ▲/▼ chips — a −28% on a 7-booking month is noise. A quiet secondary line, then
   supporting channel + distribution panels below a divider, then a plain "how
   it's worked out" note. Money labels are NEVER invented here (the statement
   below owns the money fall in the user's own waterfall labels); the one money
   figure — "money in" — takes its name from the waterfall's start line.
   NB: .fin-bars / .fin-bar-* / .fin-channel-table below are shared with this
   deck AND the statement — leave them in place. Theme-tokenised (light + dark). */
.fin-perf {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.fin-perf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.fin-perf-vs {
  font-size: 0.78rem;
  font-weight: 600;
}
.fin-perf-primary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.fin-perf-primary.has-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.fin-metric {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  min-width: 0;
}
.fin-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-metric-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.05;
}
/* Stack the sub-label and the prior-period comparator so neither truncates in a
   narrow tile (the primary row can be 4-up in a slim pane). */
.fin-metric-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  font-size: 0.74rem;
}
.fin-metric-sub {
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}
.fin-metric-prior {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fin-perf-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-subtle);
}
.fin-perf-panel {
  min-width: 0;
}
.fin-perf-panel-h {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.55rem;
}
.fin-perf-panel-h2 {
  margin-top: 1rem;
}
.fin-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.fin-bar-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  align-items: center;
  gap: 0.55rem;
}
.fin-bar-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-bar-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 16%, transparent);
  overflow: hidden;
}
.fin-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent, #4f46e5);
  min-width: 2px;
  transition: width 0.18s ease;
}
.fin-bar-fill.is-alt {
  background: color-mix(in srgb, var(--accent) 62%, #22d3ee);
}
.fin-bar-fill.is-alt2 {
  background: color-mix(in srgb, var(--accent) 55%, #a855f7);
}
.fin-bar-value {
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
}
.fin-channel-table {
  width: 100%;
  font-size: 0.76rem;
}
.fin-perf-secondary {
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 0;
}
@container workspace-main (max-width: 720px) {
  .fin-perf-primary,
  .fin-perf-primary.has-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container workspace-main (max-width: 560px) {
  .fin-bar-row {
    grid-template-columns: 72px 1fr auto;
  }
}

/* ── Financials statement — PRESENTATION mode (the money "fall") ──
   Guest paid → each deduction (amount, % of guest total, balance-after) drawn
   with a bar that visibly shrinks → Owner payout + take-home. Indigo = money
   that continues down; amber = what each line took; empty track = already gone.
   All theme-tokenised (light + dark). */
.fin-take-home {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft, var(--text-muted, #9ca3af));
}
.fin-section-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.fin-working-toggle {
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: var(--text-muted, #9ca3af);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.fin-working-toggle:hover {
  color: var(--text-primary, inherit);
}
.fin-working-toggle.is-on {
  background: var(--accent, #4f46e5);
  border-color: var(--accent, #4f46e5);
  color: #fff;
}
/* "Download PDF" — the statement's primary OUTPUT action. Accent-outlined so it reads as the
   deliberate action beside the quieter "Show working" toggle; fills on hover. Theme-tokenised
   (works light + dark, CLAUDE.md §5). */
.fin-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--accent, #4f46e5);
  background: transparent;
  color: var(--accent, #4f46e5);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.fin-download-btn:hover:not(:disabled) {
  background: var(--accent, #4f46e5);
  color: #fff;
}
.fin-download-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fin-download-btn svg {
  flex: none;
}
/* Owner payouts card (the sealed settlement ledger) — rides the fin-* family:
   cards/tables/buttons are the existing idioms; these classes only add layout
   glue. Theme tokens only (§5 light+dark parity). */
.fin-payouts-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.fin-payout-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.fin-payout-issue,
.fin-payout-preview {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.fin-payout-totals {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border, rgba(127, 127, 127, 0.25));
  padding-top: 0.5rem;
}
.fin-payout-net {
  font-size: 1.05rem;
}
.fin-payout-error {
  color: var(--danger, #dc2626);
  font-size: 0.82rem;
  margin: 0;
}
.fin-payout-issued-note {
  color: var(--accent, #4f46e5);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
}
.fin-next-payout-summary {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  border: 1px solid color-mix(in srgb, var(--state-warning) 42%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--state-warning) 7%, var(--surface-1));
}
.fin-next-payout-head,
.fin-next-payout-head > div,
.fin-next-payout-rows,
.fin-next-payout-corrections {
  min-width: 0;
}
.fin-next-payout-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.fin-next-payout-head h5,
.fin-next-payout-head p,
.fin-next-payout-note {
  margin: 0;
}
.fin-next-payout-head h5 {
  font-size: 0.92rem;
}
.fin-next-payout-head p,
.fin-next-payout-head > span,
.fin-next-payout-note {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.fin-next-payout-head > span {
  flex: none;
  font-weight: 650;
}
.fin-next-payout-rows {
  display: grid;
  gap: 0.35rem;
}
.fin-next-payout-rows > div,
.fin-next-payout-correction-headline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.8rem;
}
.fin-next-payout-rows strong,
.fin-next-payout-corrections strong {
  font-variant-numeric: tabular-nums;
}
.fin-next-payout-rows .is-correction {
  color: color-mix(in srgb, var(--state-warning) 82%, var(--text-primary));
}
.fin-next-payout-rows .is-total {
  margin-top: 0.2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.fin-next-payout-corrections {
  list-style: none;
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0.55rem 0 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.fin-next-payout-corrections li {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.8rem;
}
.fin-next-payout-correction-headline {
  gap: 0.75rem;
}
.fin-next-payout-correction-headline > strong,
.fin-next-payout-change-amounts > strong,
.fin-next-payout-change-working > strong {
  white-space: nowrap;
}
.fin-next-payout-correction-detail {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--text-primary);
}
.fin-next-payout-correction-detail > p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}
.fin-next-payout-booking-change {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle);
}
.fin-next-payout-change-label {
  color: color-mix(in srgb, var(--state-warning) 84%, var(--text-primary));
  font-size: 0.7rem;
  font-weight: 700;
}
.fin-next-payout-booking-reason {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}
.fin-next-payout-change-amounts,
.fin-next-payout-change-working {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  padding-top: 0.45rem;
}
.fin-next-payout-change-working {
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.fin-next-payout-change-amounts strong,
.fin-next-payout-change-working strong {
  color: var(--text-primary);
  text-align: right;
}
.fin-next-payout-note {
  line-height: 1.45;
}
.fin-payout-history-head {
  margin-top: 0.25rem;
}

/* ── Properties → All → Financials control centre ──────────────────────────
   The account view reuses every existing fin-* primitive. These selectors are
   layout/status glue only: recipient rows remain separate payout records. */
.all-financials-tab {
  gap: 1.25rem;
  min-width: 0;
}
.all-fin-statements {
  display: grid;
  gap: 0.85rem;
}
.all-fin-statements-card {
  gap: 0.85rem;
}
.all-fin-statements-head {
  align-items: flex-end;
  flex-wrap: wrap;
}
.all-fin-statements-head p,
.all-fin-portfolio-head p {
  margin: 0.2rem 0 0;
}
.all-fin-statement-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.all-fin-statement-controls .charges-field {
  min-width: 150px;
}
.all-fin-statement-controls .all-fin-group-by {
  min-width: 125px;
}
.all-fin-counts {
  margin-top: -0.2rem;
}
.all-fin-run-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.all-fin-run-totals > span {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.2));
  border-radius: 10px;
  background: var(--bg-input, rgba(127, 127, 127, 0.05));
}
.all-fin-run-totals small {
  color: var(--text-muted);
  font-size: 0.68rem;
}
.all-fin-run-totals strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.all-fin-statement-table-wrap {
  max-height: min(54vh, 620px);
  overflow: auto;
  border: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.2));
  border-radius: 10px;
}
.all-fin-statement-table {
  min-width: 1080px;
}
.all-fin-statement-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-elevated, var(--surface-1, #fff));
}
.all-fin-statement-row .fin-ledger-guest {
  min-width: 170px;
}
.all-fin-statement-row .fin-ledger-guest strong,
.all-fin-statement-row .fin-ledger-guest small,
.all-fin-statement-row td > span {
  display: block;
}
.all-fin-statement-row .fin-ledger-guest small,
.all-fin-locked {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 400;
}
.all-fin-locked {
  display: block;
}
.all-fin-section-row th {
  border-top: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.2));
  background: color-mix(in srgb, var(--accent, #4f46e5) 7%, var(--bg-elevated, var(--surface-1, #fff)));
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  padding: 0.55rem 0.75rem;
  text-align: left;
}
.all-fin-properties-cell {
  min-width: 220px;
}
.all-fin-properties-cell > span {
  display: block;
  line-height: 1.25;
}
.all-fin-properties-cell > span + span {
  margin-top: 0.35rem;
}
.all-fin-properties-cell small {
  display: block;
  color: var(--text-muted);
  font-size: 0.66rem;
  margin-top: 0.1rem;
}
.all-fin-payee-select {
  min-width: 180px;
  max-width: 240px;
}
.all-fin-status {
  display: inline-flex;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}
.all-fin-status.is-ready,
.all-fin-status.is-up_to_date {
  background: color-mix(in srgb, #16a34a 13%, transparent);
  color: #16a34a;
}
.all-fin-status.is-needs_recipient,
.all-fin-status.is-blocked,
.all-fin-status.is-company_operated {
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  color: color-mix(in srgb, #f59e0b 82%, var(--text-primary));
}
.all-fin-row-detail {
  display: grid;
  gap: 0.7rem;
  margin-right: 0.7rem;
}
.all-fin-inactive-audit {
  border: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.2));
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
.all-fin-inactive-audit > summary {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 650;
}
.all-fin-inactive-audit > p {
  margin: 0.55rem 0;
  max-width: 760px;
}
.all-fin-inactive-audit > ul {
  display: grid;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.all-fin-inactive-audit li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.all-fin-inactive-audit li strong {
  color: var(--text-primary);
  font-weight: 600;
}
.all-fin-owner-workspace {
  border-top: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.2));
  padding-top: 0.65rem;
}
.all-fin-owner-workspace > summary {
  color: var(--accent, #4f46e5);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
}
.all-fin-owner-workspace > .fin-wf {
  margin-top: 0.75rem;
}
.all-fin-finalise-actions {
  justify-content: space-between;
  align-items: center;
  padding-top: 0.3rem;
}
.all-fin-finalise-actions > span {
  flex: 1 1 360px;
}
.fin-download-btn.is-danger {
  border-color: var(--danger, #dc2626);
  color: var(--danger, #dc2626);
}
.fin-download-btn.is-danger:hover:not(:disabled) {
  background: var(--danger, #dc2626);
  color: #fff;
}
.all-fin-delivery-card {
  display: grid;
  gap: 0.65rem;
}
.all-fin-delivery-card .fin-section-head p {
  margin: 0.2rem 0 0;
}
.all-fin-delivery-shortcut {
  display: grid;
  justify-items: start;
  gap: 0.65rem;
}
.all-fin-delivery-shortcut .shortcut-runner {
  width: 100%;
}
.all-fin-portfolio-head {
  padding-top: 0.25rem;
}
.all-fin-portfolio-head h3 {
  margin: 0;
  font-size: 1rem;
}
@media (max-width: 760px) {
  .all-fin-run-totals {
    grid-template-columns: 1fr;
  }
  .all-fin-statement-controls,
  .all-fin-statement-controls .charges-field,
  .all-fin-statement-controls .fin-download-btn {
    width: 100%;
  }
  .all-fin-statement-controls .fin-period-select {
    width: 100%;
  }
  .all-fin-finalise-actions .fin-download-btn {
    width: 100%;
    justify-content: center;
  }
}
.fin-payout-sealed-note {
  font-size: 0.78rem;
}
/* Bank-transfer reference (JUL26-8KQ4): monospace + slight tracking so the
   code reads unambiguously in both themes (colour inherits from the row). */
.fin-payout-reference {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.fin-payout-section {
  margin-top: 0.35rem;
}
.fin-payout-detail {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
/* Sealed-payout owner link (mint / copy / revoke) inside the expanded payout detail.
   Layout glue only — buttons reuse fin-download-btn; theme-tokenised (§5). */
.fin-payout-share {
  border-top: 1px solid var(--border-soft, var(--border));
  padding-top: 0.55rem;
}
.fin-payout-share-url {
  font-size: 0.78rem;
  color: var(--accent, #4f46e5);
  text-decoration: none;
  overflow-wrap: anywhere;
  max-width: 28rem;
}
.fin-payout-share-url:hover {
  text-decoration: underline;
}
.fin-payout-email-review {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-top: 1px solid var(--border-soft, var(--border));
  padding-top: 0.7rem;
}
.fin-payout-final-email-preview {
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem;
  border: 1px solid var(--border-soft, var(--border));
  border-radius: 10px;
  background: var(--surface-subtle, transparent);
}
.fin-payout-final-email-preview > span {
  color: var(--text-muted);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.fin-payout-final-email-preview iframe {
  width: 100%;
  min-height: 32rem;
  border: 0;
  border-radius: 8px;
  background: #fff;
}
.fin-payout-final-email-preview small {
  color: var(--text-muted);
  line-height: 1.45;
}
.fin-payout-payee {
  display: grid;
  gap: 0.35rem;
  max-width: 32rem;
  padding: 0.75rem;
  border: 1px solid var(--border-soft, var(--border));
  border-radius: 10px;
  background: var(--surface-subtle, transparent);
}
.fin-payout-payee p {
  margin: 0;
}
.fin-payout-confirmation {
  flex: 1 1 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border-soft, var(--border));
  border-radius: 10px;
  background: var(--surface-subtle, transparent);
  color: var(--text-primary, inherit);
  font-size: 0.82rem;
  line-height: 1.45;
  cursor: default;
}
.fin-payout-reopen {
  display: grid;
  gap: 0.5rem;
  border-top: 1px solid var(--border-soft, var(--border));
  padding-top: 0.7rem;
}
.fin-payout-reopen-confirm {
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
  border: 1px solid color-mix(in srgb, var(--danger, #dc2626) 35%, var(--border, transparent));
  border-radius: 10px;
  background: color-mix(in srgb, var(--danger, #dc2626) 5%, var(--surface-subtle, transparent));
  font-size: 0.8rem;
}
.fin-payout-reopen-confirm p,
.fin-payout-reopen-note {
  margin: 0;
}
.fin-payout-email-source {
  min-height: 10rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
}
.fin-payout-email-frame {
  display: block;
  width: 100%;
  min-height: 22rem;
  margin-top: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
/* "Share link" — mint a login-free owner-statement link (Slice 3b). A quieter peer to the
   accent "Download PDF": subtle outline + muted text, accent on hover. Theme-tokenised (§5). */
.fin-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: var(--text-muted, #9ca3af);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.7rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.fin-share-btn:hover:not(:disabled) {
  color: var(--accent, #4f46e5);
  border-color: var(--accent, #4f46e5);
}
.fin-share-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fin-share-btn svg {
  flex: none;
}
/* The revealed link row (mint → copy / revoke). flex-basis 100% wraps it onto its own line
   within .fin-section-tools; the hint + any error wrap below it. */
.fin-share-panel {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.fin-share-url {
  flex: 1 1 220px;
  min-width: 0;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: var(--surface-2, transparent);
  color: var(--text-primary, inherit);
  font: inherit;
  font-size: 0.72rem;
  padding: 0.28rem 0.5rem;
  border-radius: 7px;
}
.fin-share-copy,
.fin-share-revoke {
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.6rem;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.fin-share-copy {
  border-color: var(--accent, #4f46e5);
  color: var(--accent, #4f46e5);
}
.fin-share-copy:hover {
  background: var(--accent, #4f46e5);
  color: #fff;
}
.fin-share-revoke {
  color: var(--text-muted, #9ca3af);
}
.fin-share-revoke:hover {
  color: var(--danger, #dc2626);
  border-color: var(--danger, #dc2626);
}
.fin-share-hint {
  flex: 1 1 100%;
  color: var(--text-muted, #9ca3af);
  font-size: 0.68rem;
  line-height: 1.4;
}
.fin-share-err {
  flex: 1 1 100%;
  color: var(--danger, #dc2626);
  font-size: 0.7rem;
}
/* Printable owner statement (components/properties/OwnerStatementDocument.tsx). The document is
   portaled to <body> and hidden on screen. Only when the User clicks "Download PDF" — which adds
   `fin-printing` to <body> for the duration of the print — does the print stylesheet hide the app
   shell and reveal the paper document. Gating on body.fin-printing keeps printing every OTHER page
   completely unaffected (a global `.app-shell { display:none }` would blank-print the whole app). */
.fin-doc-print-root {
  display: none;
}
@media print {
  body.fin-printing .app-shell {
    display: none !important;
  }
  body.fin-printing .fin-doc-print-root {
    display: block !important;
  }
  body.fin-printing {
    background: #fff !important;
  }
}
/* The whole-portfolio statement paper (OwnerPortfolioStatementDocument) gets its OWN
   class pair: an expanded property mounts its own .fin-doc-print-root portal on the same
   page, so sharing body.fin-printing would print BOTH papers from either Download PDF.
   Each button reveals exactly its own document. */
.fin-portfolio-print-root {
  display: none;
}
@media print {
  body.fin-portfolio-printing .app-shell {
    display: none !important;
  }
  body.fin-portfolio-printing .fin-portfolio-print-root {
    display: block !important;
  }
  body.fin-portfolio-printing {
    background: #fff !important;
  }
}
/* Right-aligned actions cluster on the owner Financials toolbar (Download PDF). */
.fin-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}
.fin-download-err {
  font-size: 0.75rem;
}
/* Handover split: notes flagging that a statement/row covers only an owner's
   own tenure days of the period (theme tokens — light/dark parity for free). */
.fin-tenure-note {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  line-height: 1.35;
}
.fin-tenure-tag {
  font-size: 0.75rem;
  white-space: nowrap;
}
/* The statement renders semantic tables inside the authed shell, where the app's global table
   styles (header bars, row-hover fills, shadows) would tint it. Neutralise them scoped to
   .fin-doc so the document's own inline styles fully control the look; borders stay inline. */
.fin-doc table {
  background: transparent;
  box-shadow: none;
}
.fin-doc thead th,
.fin-doc tbody td,
.fin-doc tfoot td {
  background: transparent;
}
/* Kill any global sticky header — the document is a flat printed page; a sticky thead overlaps
   rows on scroll, and print already repeats <thead> per page on its own. */
.fin-doc thead th {
  position: static;
}
.fin-doc tbody tr:hover td {
  background: transparent;
}
.fin-waterfall-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
}
.fin-waterfall-label {
  font-size: 0.8rem;
}
.fin-waterfall-label strong {
  color: var(--text-primary, inherit);
  font-weight: 700;
}
.fin-waterfall-change {
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: var(--text-primary, inherit);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.fin-waterfall-change:hover {
  border-color: var(--accent, #4f46e5);
  color: var(--accent, #4f46e5);
}
.fin-statement {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.35rem;
}
.fin-line {
  display: grid;
  gap: 0.32rem;
}
.fin-line-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.fin-line-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary, inherit);
}
.fin-line-spacer {
  flex: 1 1 auto;
}
.fin-line-delta {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
  font-size: 0.86rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary, inherit);
}
.fin-line-delta.is-credit {
  color: var(--state-success, #16a34a);
}
.fin-line-pct {
  flex: 0 0 auto;
  min-width: 46px;
  text-align: right;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}
.fin-line-after {
  flex: 0 0 auto;
  min-width: 104px;
  text-align: right;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft, var(--text-muted, #9ca3af));
}
.fin-line-amount {
  flex: 0 0 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fin-amount-start {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary, inherit);
}
.fin-amount-payout {
  min-width: 104px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent, #4f46e5);
}
.fin-payout-pct {
  color: var(--accent, #4f46e5);
  font-weight: 700;
}
.fin-track {
  position: relative;
  display: flex;
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--border-subtle, rgba(255, 255, 255, 0.1));
}
.fin-track-payout {
  height: 10px;
}
.fin-fill {
  height: 100%;
  background: var(--accent, #4f46e5);
  transition: width 0.2s ease;
}
.fin-fill.is-payout {
  border-radius: 6px;
}
.fin-cut {
  height: 100%;
  background: var(--fin-cut, #f59e0b);
  opacity: 0.85;
  transition: width 0.2s ease;
}
.fin-add {
  height: 100%;
  background: var(--state-success, #16a34a);
  opacity: 0.8;
}
.fin-line-start .fin-line-label {
  font-size: 0.92rem;
}
.fin-line-payout {
  margin-top: 0.15rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
}
.fin-line-terms {
  margin-top: 0.1rem;
  padding-left: 0.1rem;
}
[data-theme="light"] .fin-track {
  background: rgba(0, 0, 0, 0.08);
}
@media (max-width: 560px) {
  .fin-line-label {
    font-size: 0.85rem;
  }
  /* Deduction lines become a tidy 2×2 so nothing wraps raggedly:
     row 1 = label | −amount, row 2 = % | balance-after. */
  .fin-line:not(.fin-line-start):not(.fin-line-payout) .fin-line-head {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 0.6rem;
    row-gap: 0.05rem;
    align-items: baseline;
  }
  .fin-line:not(.fin-line-start):not(.fin-line-payout) .fin-line-delta,
  .fin-line:not(.fin-line-start):not(.fin-line-payout) .fin-line-pct,
  .fin-line:not(.fin-line-start):not(.fin-line-payout) .fin-line-after {
    min-width: 0;
  }
  .fin-line:not(.fin-line-start):not(.fin-line-payout) .fin-line-pct {
    text-align: left;
  }
}

.sw-col-visibility {
  min-width: 150px;
  font-size: 0.78rem;
}
.sw-statement-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  cursor: pointer;
}
/* The per-line "Name on statement" input — compact so the Visibility cell stays a
   quiet column; token colors keep light/dark parity for free. */
.sw-statement-name {
  display: block;
  margin-top: 0.3rem;
  width: 100%;
  max-width: 190px;
  font-size: 0.76rem;
  padding: 0.22rem 0.4rem;
}
.sw-visibility-details {
  margin-top: 0.3rem;
}
.sw-visibility-details summary {
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--text-muted, #9ca3af);
  list-style: none;
  text-decoration: underline dotted;
}
.sw-visibility-details[open] summary {
  color: var(--text-main, inherit);
}
.sw-visibility-list {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.4rem 0.1rem 0.1rem;
}
.sw-visibility-option {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.sw-builtin,
.sw-template-id {
  display: block;
  margin-top: 0.15rem;
}
.sw-col-actions {
  text-align: right;
  white-space: nowrap;
}
/* Icon-only remove. `.btn.btn-ghost` (0,2,0) sets its own padding, so this
   selector must match its specificity or the global button padding squeezes the
   glyph to dust (feedback_icons_too_small, 2026-07-02); flex none stops the svg
   shrinking below its 16px basis inside the flex button. */
.btn.sw-remove {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  flex: 0 0 auto;
  color: var(--text-muted, #9ca3af);
}
.btn.sw-remove .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.btn.sw-remove:hover {
  color: var(--state-error, #ef4444);
}
.settlement-waterfall-preview.card {
  padding: 1rem;
}
.settlement-preview-mini {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
}
.settlement-preview-mini th,
.settlement-preview-mini td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
.sw-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.sw-preview-label {
  font-weight: 500;
}
.sw-preview-delta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
}
.sw-preview-delta input {
  max-width: 100px;
  font-size: 0.78rem;
}
.settlement-waterfall-listing-panel .settlement-waterfall-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0 1rem;
}
.settlement-waterfall-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  cursor: pointer;
}
.settlement-waterfall-listing-head h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.settlement-waterfall-toggle-row--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
}
.settlement-waterfall-preview.is-compact {
  padding: 0;
}
.settlement-waterfall-preview.is-compact h4 {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
}
.settlement-waterfall--editor-only {
  margin-top: 0.5rem;
}
.settlement-waterfall-live {
  width: 100%;
  min-width: 0;
}
.sw-routing-rule-row {
  display: grid;
  grid-template-columns: 1.2fr minmax(140px, 1fr) minmax(170px, 1fr) minmax(125px, 0.9fr) minmax(125px, 0.9fr) minmax(190px, auto);
  gap: 0.36rem;
  align-items: start;
}
.sw-routing-rule-card {
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  padding: 0.45rem;
  overflow: hidden;
}
.sw-routing-rule-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}
.sw-routing-rule-summary {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.sw-routing-rule-summary strong {
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-routing-rule-actions {
  display: flex;
  gap: 0.32rem;
}

/* Settlement template — account default (settings row + switch) */
.sw-account-default-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.25rem;
  max-width: 720px;
  margin-top: 1.25rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  background: color-mix(in srgb, var(--bg-elevated, #1a1d24) 92%, transparent);
}
.sw-account-default-text {
  flex: 1;
  min-width: 0;
}
.sw-account-default-title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary, #f9fafb);
}
.sw-account-default-desc {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  max-width: 44rem;
}
.sw-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  margin-top: 0.12rem;
  cursor: pointer;
}
.sw-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.sw-switch:has(input:focus-visible) .sw-switch-track {
  outline: 2px solid var(--color-focus-ring, #60a5fa);
  outline-offset: 3px;
}
.sw-switch-track {
  display: block;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  pointer-events: none;
  background: color-mix(in srgb, var(--text-muted, #9ca3af) 45%, var(--bg-input, #111827));
  transition: background 0.2s ease;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.sw-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.sw-switch input:checked + .sw-switch-track {
  background: linear-gradient(180deg, #34d399, #059669);
}
.sw-switch input:checked + .sw-switch-track::after {
  transform: translateX(20px);
}
/* Attribution card (which month gets a booking's money) — same quiet box as
   the account-default panel, but the controls stack under the text as
   sentence-style rows with inline selects. */
.sw-attribution-panel {
  max-width: 720px;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  background: color-mix(in srgb, var(--bg-elevated, #1a1d24) 92%, transparent);
}
.sw-attribution-rows {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.7rem;
}
.sw-attribution-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-primary, #f9fafb);
}
.sw-attribution-select {
  width: auto;
  min-width: 0;
  font-size: 0.82rem;
  padding: 0.32rem 0.5rem;
}
.sw-attribution-hint {
  flex-basis: 100%;
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  max-width: 44rem;
}
.sw-attribution-example {
  flex-basis: 100%;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  border: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.14));
  color: var(--text-primary, #f9fafb);
  background: color-mix(in srgb, var(--bg-input, #111827) 60%, transparent);
}
.sw-attribution-example-label {
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #9ca3af);
}
[data-theme="light"] .sw-attribution-panel {
  background: #f8fafc;
  border-color: rgba(17, 24, 39, 0.12);
}
[data-theme="light"] .sw-attribution-row {
  color: #111827;
}
[data-theme="light"] .sw-attribution-example {
  color: #111827;
  border-color: rgba(17, 24, 39, 0.18);
  background: #fff;
}

/* "Who can view" audience panel — same quiet box as the account-default panel,
   one row per workspace user with an immediate-save grant switch. */
.sw-audience-panel {
  max-width: 720px;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  background: color-mix(in srgb, var(--bg-elevated, #1a1d24) 92%, transparent);
}
.sw-audience-rows {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.sw-audience-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}
.sw-audience-row:first-child {
  border-top: none;
}
.sw-audience-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sw-audience-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary, #f9fafb);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-audience-sub {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-audience-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.sw-audience-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: var(--text-muted, #9ca3af);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  white-space: nowrap;
}
.sw-audience-loading {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
}
[data-theme="light"] .sw-audience-panel {
  background: #f8fafc;
  border-color: rgba(17, 24, 39, 0.12);
}
[data-theme="light"] .sw-audience-row {
  border-top-color: rgba(17, 24, 39, 0.08);
}
[data-theme="light"] .sw-audience-name {
  color: #111827;
}
[data-theme="light"] .sw-audience-tag {
  color: #4b5563;
  border-color: rgba(17, 24, 39, 0.18);
}

[data-theme="light"] .sw-account-default-panel {
  background: #f8fafc;
  border-color: rgba(17, 24, 39, 0.12);
}
[data-theme="light"] .sw-account-default-title {
  color: #111827;
}
[data-theme="light"] .sw-switch-track {
  background: #d1d5db;
}
[data-theme="light"] .sw-switch input:checked + .sw-switch-track {
  background: linear-gradient(180deg, #4ade80, #16a34a);
}
[data-theme="light"] .sw-role {
  background: #f3f4f6;
}

@media (max-width: 1180px) {
  .settlement-waterfall-page .registry-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sw-routing-rule-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }}
@media (max-width: 860px) {
  .settlement-waterfall-page .card {
    padding: 1rem;
  }
  .sw-account-default-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .sw-switch {
    margin-top: 0;
    align-self: flex-end;
  }
  .sw-routing-rule-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.45rem;
  }
  .sw-routing-rule-head {
    margin-bottom: 0;
  }
  .sw-routing-rule-actions {
    flex-wrap: wrap;
  }
  .settlement-preview-mini {
    font-size: 0.76rem;
  }}

/* ============================================================
   Multi-property calendar (PMS-style)
   ============================================================ */
.properties-editor--calendar {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  padding-bottom: 0;
  overflow: hidden;
}
.properties-editor--calendar .properties-tab-chrome {
  flex: 0 0 auto;
}
.property-calendar-tab {
  --cal-surface: var(--bg-elevated);
  --cal-surface-2: var(--bg-deep);
  --cal-surface-3: var(--bg-base);
  --cal-line: var(--border-subtle);
  --cal-line-strong: var(--border-strong);
  --cal-text: var(--text-primary);
  --cal-text-soft: var(--text-soft);
  --cal-muted: var(--text-muted);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  container-type: inline-size;
  container-name: property-calendar;
}
/* Calendar accent tokens are hoisted to :root so other parts of the
   properties shell (the list pane, the group accent line, etc.) can
   reference them without being inside `.property-calendar-tab`. They
   stay neutral on purpose — the brand gradient lives on the primary
   CTA buttons and the logo only. */
/* Same rule as the main palette above: a dark-marked element inside a light
   page must be able to reach the dark values, so both selectors carry them. */
:root,
[data-theme="dark"] {
  --cal-accent: #94a3b8;
  --cal-accent-soft: rgba(148, 163, 184, 0.18);
  --cal-accent-active: #cbd5e1;
}
[data-theme="light"] {
  --cal-accent: #475569;
  --cal-accent-soft: rgba(71, 85, 105, 0.12);
  --cal-accent-active: #334155;
}
/* One canvas toolbar. It participates in the flex layout (rather than floating
   over the last rows), and `order: -1` places it above the calendar even though
   drafts/popovers are rendered earlier in the component tree. */
.property-calendar-toolbar {
  position: relative;
  order: -1;
  flex: 0 0 auto;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.36rem 0.6rem;
  background: var(--cal-surface);
  border-bottom: 1px solid var(--cal-line);
}
.property-calendar-toolbar-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.18rem;
  border-radius: 999px;
  border: 1px solid var(--cal-line);
  background: color-mix(in srgb, var(--cal-surface) 92%, transparent);
}
.property-calendar-toolbar-tools {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
  margin-left: auto;
}

.property-calendar-toolbar--rebuilt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "nav tools"
    "filters filters";
  align-items: center;
  gap: 0.55rem;
  padding: 0.46rem 0.62rem;
  overflow: visible;
}
.property-calendar-toolbar--rebuilt .property-calendar-toolbar-nav {
  grid-area: nav;
  min-width: 0;
  justify-self: start;
}
.property-calendar-toolbar--rebuilt .property-calendar-toolbar-tools {
  grid-area: tools;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 0.4rem;
  margin-left: 0;
  overflow: visible;
}
.property-calendar-toolbar--rebuilt .property-calendar-create-actions {
  flex: 0 0 auto;
  margin-left: 0;
}
.property-calendar-filters-scroll {
  grid-area: filters;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--cal-line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}
.property-calendar-filter-bar,
.property-calendar-task-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  flex: 0 0 auto;
  min-width: max-content;
}
.property-calendar-task-filter-bar {
  padding-left: 0.04rem;
}
@container property-calendar (max-width: 1180px) {
  .property-calendar-toolbar--rebuilt {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "resource tools"
      "nav nav"
      "filters filters";
  }
  .property-calendar-toolbar--rebuilt .property-calendar-toolbar-nav {
    max-width: 100%;
    overflow-x: auto;
  }
  .property-calendar-toolbar--rebuilt .property-calendar-toolbar-tools {
    justify-content: flex-end;
  }
}
.property-calendar-filter-label {
  flex: 0 0 auto;
  color: var(--cal-muted);
  font-size: 0.62rem;
  font-weight: 780;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}
.property-calendar-filter-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 24px;
  margin: 0 0.18rem;
  background: var(--cal-line-strong);
}
.property-calendar-filter-chip,
.property-calendar-task-filter-chip,
.property-calendar-task-filter-back {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 31px;
  padding: 0 0.68rem;
  border: 1px solid var(--cal-line-strong);
  border-radius: 999px;
  color: var(--cal-text-soft);
  background: color-mix(in srgb, var(--cal-surface) 90%, var(--cal-text) 3%);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}
.property-calendar-filter-chip:hover,
.property-calendar-task-filter-chip:hover,
.property-calendar-task-filter-back:hover {
  color: var(--cal-text);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--cal-line));
  background: color-mix(in srgb, var(--accent) 9%, var(--cal-surface));
}
.property-calendar-filter-chip.is-active,
.property-calendar-task-filter-chip.is-active {
  color: var(--cal-text);
  border-color: color-mix(in srgb, var(--accent) 44%, var(--cal-line-strong));
  background: color-mix(in srgb, var(--accent) 10%, var(--cal-surface));
  box-shadow: none;
}
.property-calendar-filter-chip small,
.property-calendar-task-filter-chip small {
  min-width: 17px;
  padding: 2px 5px;
  border-radius: 999px;
  color: inherit;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 0.61rem;
  font-weight: 800;
  text-align: center;
}
.property-calendar-filter-chip.is-active small,
.property-calendar-task-filter-chip.is-active small {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.property-calendar-task-filter-back {
  color: var(--cal-text);
  border-style: dashed;
  background: transparent;
}
@container property-calendar (max-width: 880px) {
  .property-calendar-jump-group {
    display: none;
  }
}
.property-calendar-create-actions {
  order: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.property-calendar-toolbar-zoom {
  order: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 0.45rem;
  border: 1px solid var(--cal-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-surface) 92%, #000 8%);
}
.property-calendar-zoom-title {
  color: var(--cal-text);
  font-size: 0.68rem;
  font-weight: 750;
}
.property-calendar-toolbar-zoom .property-calendar-zoom-slider {
  width: 76px;
}
.property-calendar-filter {
  order: 3;
}
.property-calendar-toolbar-tools > .property-calendar-pill-btn {
  order: 5;
}
.property-calendar-overflow {
  order: 6;
}
.property-calendar-view-switch {
  order: 0;
}
/* The two arrow buttons that shift the calendar by ±2 weeks now read
   as actual buttons — a subtle filled circle with a clear border so
   they're visible against the glass bar instead of looking like
   floating icons. */
.property-calendar-icon-btn {
  /* Sized to match the toolbar pill buttons (Filter / Multi /
     Compact) so the entire toolbar reads as one set of controls.
     Square 26px circle keeps the arrow glyph centred without
     stretching the button. */
  width: 26px;
  height: 26px;
  /* The global button reset applies ~9×11px padding; on a 26px circle
     that leaves a 1.6px content box and the arrow svg (a flex item)
     gets crushed to a sliver. Zero it so the glyph gets the full circle. */
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--cal-line);
  background: color-mix(in srgb, var(--cal-surface) 92%, #000 8%);
  color: var(--cal-text);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.property-calendar-icon-btn:hover {
  background: color-mix(in srgb, var(--cal-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--cal-accent) 40%, transparent);
}
.property-calendar-icon-btn svg {
  display: block;
  /* The chevron path only spans ~6×12 of the 24-unit viewBox, so a
     16px render left a ~4px-wide arrow — illegibly small. 22px puts
     the visible glyph at ~6×11px inside the 26px button. */
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.property-calendar-icon-btn:active {
  transform: translateY(0.5px);
}
/* `Today` matches the icon-button pill style — same neutral fill and
   border so the whole nav cluster reads as one set of controls. The
   uppercase label + slightly stronger font-weight keep it legible as
   an action without resorting to a coloured background. */
.property-calendar-today-btn {
  /* Mirror the pill-btn padding so Today / Filter / Multi / Compact
     all line up at the same height across the bar. */
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--cal-line);
  background: color-mix(in srgb, var(--cal-surface) 92%, #000 8%);
  color: var(--cal-text);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
.property-calendar-today-btn:hover {
  background: color-mix(in srgb, var(--cal-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--cal-accent) 40%, transparent);
}
.property-calendar-today-btn:active {
  transform: translateY(0.5px);
}
.property-calendar-selected-day-control {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  height: 26px;
  padding: 0 0.55rem;
  border: 1px solid color-mix(in srgb, var(--cal-accent) 56%, var(--cal-line));
  border-radius: 999px;
  color: var(--cal-text);
  background: color-mix(in srgb, var(--cal-accent) 16%, var(--cal-surface));
  font: inherit;
  font-size: 0.68rem;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}
.property-calendar-selected-day-control:hover {
  border-color: color-mix(in srgb, var(--cal-accent) 82%, #fff 18%);
  background: color-mix(in srgb, var(--cal-accent) 24%, var(--cal-surface));
}
.property-calendar-selected-day-control.is-price-action {
  height: 30px;
  padding-inline: 0.72rem;
  border-color: var(--cal-accent);
  color: #fff;
  background: var(--cal-accent);
  font-size: 0.72rem;
}
.property-calendar-selected-day-control.is-price-action:hover {
  border-color: color-mix(in srgb, var(--cal-accent) 78%, #fff 22%);
  background: color-mix(in srgb, var(--cal-accent) 84%, #fff 16%);
}
.property-calendar-selected-day-control:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--cal-accent) 72%, transparent);
  outline-offset: 1px;
}
.property-calendar-window-loading {
  color: var(--cal-muted);
  font-size: 0.66rem;
  font-weight: 650;
  white-space: nowrap;
}
/* Month / year jump dropdowns. Sit inside the toolbar nav next to the
   Today button. Each native <select> is dressed as a small pill so it
   matches the rest of the toolbar — chevron rendered via background
   SVG, focus ring uses the workspace accent. */
.property-calendar-jump-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
/* The month / year jumps stopped being native <select>s on 2026-07-27 — Hakim:
   "no shitty systems menus" — and became the shared ChoiceMenu. The CHROME is
   unchanged on purpose: "consistent" here means it still looks like a calendar
   toolbar pill, not like a task-window field that wandered in. So the pill
   metrics below now dress the picker's trigger instead of a <select>, and the
   dropdown itself is the app's own popover rather than the operating system's.
   Same vertical metrics as .property-calendar-pill-btn so Today / month / year
   line up with the layer, zoom and create controls. */
.property-calendar-jump-group .task-modal-picker {
  display: inline-flex;
}
.property-calendar-jump-group .task-modal-chip-trigger {
  height: 26px;
  padding: 0 1.55rem 0 0.65rem;
  min-width: 4.4rem;
  box-sizing: border-box;
  border-radius: 999px;
  border: 1px solid var(--cal-line);
  background-color: color-mix(in srgb, var(--cal-surface) 92%, #000 8%);
  color: var(--cal-text);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' fill='none' stroke='%23888' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 10px 10px;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.property-calendar-jump-group
  .task-modal-picker:last-child
  .task-modal-chip-trigger {
  min-width: 4.8rem;
}
.property-calendar-jump-group .task-modal-chip-trigger:hover {
  background-color: color-mix(in srgb, var(--cal-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--cal-accent) 40%, transparent);
}
.property-calendar-jump-group .task-modal-chip-trigger:focus-visible {
  outline: 2px solid color-mix(in srgb, #3b82f6 65%, transparent);
  outline-offset: 1px;
}

/* Hide any pill-button that's been marked as overflowed so the JS
   responsive logic can collapse it into the "More" menu without
   ripping the element out of the tree. We keep the popover wrapper
   visible (e.g. .property-calendar-filter) so its open state stays
   anchored even when the trigger is hidden. */
.property-calendar-pill-btn[data-overflowed="true"] {
  display: none !important;
}
.property-calendar-filter[data-overflowed="true"] > .property-calendar-pill-btn {
  display: none !important;
}
/* Overflow trigger + menu — appears at narrow widths to gather any
   collapsed actions and opens below the top toolbar. */
.property-calendar-overflow {
  position: relative;
  display: inline-flex;
}
.property-calendar-overflow-menu {
  position: absolute;
  top: calc(100% + 6px);
  bottom: auto;
  right: 0;
  z-index: 30;
  min-width: 220px;
  padding: 4px;
  background: var(--bg-elevated, var(--cal-surface));
  border: 1px solid var(--cal-line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft, 0 12px 30px rgba(0, 0, 0, 0.32));
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.property-calendar-toolbar-options {
  position: relative;
  order: 0;
}
.property-calendar-toolbar-options > summary {
  list-style: none;
}
.property-calendar-toolbar-options > summary::-webkit-details-marker {
  display: none;
}
.property-calendar-toolbar-options > .property-calendar-pill-btn[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--cal-accent) 60%, transparent);
  background: color-mix(in srgb, var(--cal-accent) 18%, var(--cal-surface));
}
.property-calendar-toolbar-options .property-calendar-overflow-menu {
  min-width: 270px;
  gap: 4px;
  padding: 6px;
}
.property-calendar-toolbar-options .property-calendar-staff-row-toggle,
.property-calendar-toolbar-options .property-calendar-selected-day-control {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  border-radius: 8px;
}
.property-calendar-toolbar-options .property-calendar-staff-row-toggle small {
  margin-left: auto;
}
.property-calendar-toolbar-options .property-calendar-toolbar-zoom {
  order: 0;
  width: 100%;
  height: 34px;
  box-sizing: border-box;
  justify-content: space-between;
  border-radius: 8px;
}
.property-calendar-toolbar-options .property-calendar-zoom-slider {
  flex: 1 1 auto;
  width: auto;
  min-width: 72px;
}
.property-calendar-overflow-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: var(--cal-text, var(--text-primary));
  font: inherit;
  font-size: 0.78rem;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.property-calendar-overflow-item:hover,
.property-calendar-overflow-item:focus-visible {
  background: color-mix(in srgb, var(--cal-line) 70%, transparent);
  outline: none;
}
.property-calendar-overflow-item > svg {
  flex: 0 0 auto;
  opacity: 0.85;
}
.property-calendar-overflow-meta {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.7;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-line) 70%, transparent);
}

/* One labelled Add control replaces the three identical plus glyphs that the
   old narrow layout exposed. The menu names both the object and the outcome;
   an armed draft turns the same control into an explicit Cancel action. */
.property-calendar-create-actions {
  order: 1;
  position: relative;
}
.property-calendar-create-menu {
  position: fixed;
  z-index: 1200;
  display: grid;
  min-width: 270px;
  gap: 2px;
  padding: 5px;
  border: 1px solid var(--cal-line, var(--border-subtle));
  border-radius: 12px;
  color: var(--cal-text, var(--text-primary));
  background: var(--cal-surface, var(--bg-elevated));
  box-shadow: var(--shadow-soft, 0 14px 34px rgba(0, 0, 0, 0.32));
}
.property-calendar-create-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  color: var(--cal-text, var(--text-primary));
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.property-calendar-create-item:hover,
.property-calendar-create-item:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--cal-line, var(--border-subtle)) 70%, transparent);
}
.property-calendar-create-item > svg {
  color: var(--cal-accent-active, var(--accent));
}
.property-calendar-create-item > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.property-calendar-create-item strong {
  font-size: 0.78rem;
  font-weight: 720;
}
.property-calendar-create-item small {
  color: var(--cal-muted, var(--text-muted));
  font-size: 0.66rem;
}

.property-calendar-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--cal-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-surface-2) 72%, transparent);
}
.property-calendar-view-switch > button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  color: var(--cal-muted);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 680;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
}
.property-calendar-view-switch > button:hover {
  color: var(--cal-text);
  background: color-mix(in srgb, var(--cal-text) 7%, transparent);
}
.property-calendar-view-switch > button.is-active {
  color: var(--cal-text);
  background: var(--cal-surface);
  box-shadow: 0 0 0 1px var(--cal-line-strong);
}

@media (max-width: 520px) {
  .property-calendar-create-menu {
    min-width: min(270px, calc(100vw - 24px));
  }
}

.property-calendar-toolbar[data-tight="true"]
  .property-calendar-create-actions {
  position: static;
}
.property-calendar-toolbar[data-tight="true"]
  .property-calendar-create-menu {
  min-width: 0;
}

.property-calendar-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--cal-line);
  background: color-mix(in srgb, var(--cal-surface) 92%, #000 8%);
  color: var(--cal-text);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.property-calendar-pill-btn:hover {
  background: color-mix(in srgb, var(--cal-accent) 14%, transparent);
}
.property-calendar-pill-btn.is-active {
  border-color: color-mix(in srgb, var(--cal-accent) 60%, transparent);
  background: color-mix(in srgb, var(--cal-accent) 26%, transparent);
}
.property-calendar-status {
  margin: 0;
  font-size: 0.78rem;
}

/* Streams calendar lens — undated tasks have no x-axis position, so they get
   an honest, always-labelled lane above the date grid instead of disappearing.
   The buttons reuse the canonical task-chip classes; this scoped override only
   changes their positioning from absolute grid bars to compact flow items. */
.property-calendar-undated {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 42px;
  padding: 0.38rem 0.62rem;
  border-bottom: 1px solid var(--cal-line);
  background: color-mix(in srgb, var(--cal-surface-2) 76%, transparent);
  overflow: hidden;
}

.property-calendar-undated-head {
  flex: 0 0 auto;
  display: grid;
  gap: 0.02rem;
  min-width: 62px;
}

.property-calendar-undated-head strong {
  color: var(--cal-text);
  font-size: 0.72rem;
}

.property-calendar-undated-head span,
.property-calendar-undated-empty {
  color: var(--cal-muted);
  font-size: 0.66rem;
}

.property-calendar-undated-list {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.property-calendar-undated-task-chip.property-calendar-task-chip {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  max-width: 260px;
  min-height: 28px;
  padding-block: 0.28rem;
}

.property-calendar-undated-empty {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-calendar-task-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border-soft, rgba(255, 255, 255, 0.08));
  background: color-mix(in srgb, var(--surface-elev-1, #1a1a22) 80%, transparent);
  border-radius: 12px;
  flex-wrap: wrap;
}

.property-calendar-task-strip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted, rgba(255, 255, 255, 0.7));
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.property-calendar-task-strip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
}

.property-calendar-task-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

/* (legacy .property-calendar-task-chip rules removed — see the
   canonical definition lower in this file under "FULL-HEIGHT TASK
   CHIP". Keeping a single source prevents the cascade fights that
   left the chip without pointer-events.) */

.property-calendar-task-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.property-calendar-task-chip-due {
  font-size: 0.66rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.55));
  margin-left: 2px;
}

.property-calendar-task-strip-more {
  font-size: 0.72rem;
  color: var(--text-muted, rgba(255, 255, 255, 0.7));
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.property-calendar-task-strip-more:hover {
  background: color-mix(in srgb, var(--surface-elev-2, #232331) 60%, white 6%);
}

.property-calendar-grid-shell {
  --status-confirmed: #2563eb;
  --status-confirmed-soft: color-mix(in srgb, #2563eb 30%, transparent);
  --status-pending: #d97706;
  --status-pending-soft: color-mix(in srgb, #d97706 28%, transparent);
  --status-cancelled: #6b7280;
  --status-cancelled-soft: color-mix(in srgb, #6b7280 28%, transparent);
  --status-blocked: #475569;
  --status-blocked-soft: color-mix(in srgb, #475569 35%, transparent);
  --status-neutral: #14b8a6;
  --status-neutral-soft: color-mix(in srgb, #14b8a6 28%, transparent);
  --weekend-bg: color-mix(in srgb, var(--cal-surface) 95%, var(--cal-text) 4.5%);
  --today-line: #f59e0b;
  --col-highlight-x: -9999px;
  /* No outer border or radius — the toolbar at the foot supplies the only
     framing. Lets the calendar bleed edge-to-edge of the pane. */
  background: transparent;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  position: relative;
}
.property-calendar-grid-scroll {
  overflow: auto;
  overflow-anchor: none;
  flex: 1 1 auto;
  min-height: 0;
  scroll-behavior: auto;
  overscroll-behavior: contain;
  /* Pure GPU-accelerated scrolling — keeps the column highlight + chips snappy
     during fast horizontal panning. */
  contain: paint;
  will-change: scroll-position;
  /* Hide the native scrollbars in the calendar middle pane. The grid is
     navigated via the bottom-bar Today/jump buttons + horizontal wheel +
     drag, so the scrollbar adds visual noise without functional benefit. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.property-calendar-grid-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.property-calendar-grid-shell.is-initial-loading
  .property-calendar-grid-content {
  visibility: hidden;
}
.property-calendar-loading-surface {
  position: absolute;
  inset: 0;
  z-index: 45;
  pointer-events: auto;
  background:
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--cal-surface-2) 76%, var(--cal-surface)) 0 68px,
      transparent 68px
    ),
    repeating-linear-gradient(
      to right,
      transparent 0 calc(var(--day-width, 64px) - 1px),
      color-mix(in srgb, var(--cal-line-strong) 52%, transparent)
        calc(var(--day-width, 64px) - 1px) var(--day-width, 64px)
    ),
    repeating-linear-gradient(
      to bottom,
      transparent 0 49px,
      color-mix(in srgb, var(--cal-line-strong) 44%, transparent) 49px 50px
    ),
    var(--cal-surface-3);
}
.property-calendar-loading-surface::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 16px;
  width: min(240px, 28%);
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-text) 12%, transparent);
  box-shadow:
    0 26px 0 color-mix(in srgb, var(--cal-text) 8%, transparent),
    0 80px 0 color-mix(in srgb, var(--cal-text) 7%, transparent),
    0 130px 0 color-mix(in srgb, var(--cal-text) 7%, transparent),
    0 180px 0 color-mix(in srgb, var(--cal-text) 7%, transparent);
}
.property-calendar-grid-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: max-content;
}
.property-calendar-rows {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Match the gap between listing cards in the left pane so each row lines up
     with its card during the first paint. Once measurements arrive,
     `.has-synced-layout` replaces both values with the exact card offsets. */
  gap: var(--row-gap, 4px);
  padding-top: var(--row-gap, 4px);
}
.property-calendar-rows.has-synced-layout {
  /* Measured card offsets now carry every ordinary gap and group-header band.
     Adding flex gap or top padding here would count that space twice. */
  gap: 0;
  padding-top: 0;
}
.property-calendar-filter-empty {
  position: sticky;
  left: 0;
  display: grid;
  align-content: center;
  gap: 0.28rem;
  width: min(520px, calc(100vw - 360px));
  min-width: 280px;
  min-height: 112px;
  padding: 1.25rem 1.5rem;
  color: var(--cal-text-soft);
}
.property-calendar-filter-empty strong {
  color: var(--cal-text);
  font-size: 0.82rem;
}
.property-calendar-filter-empty span {
  color: var(--cal-muted);
  font-size: 0.72rem;
}
.property-calendar-group-band {
  /* The band is part of the shared vertical resource axis. It must leave the
     viewport with its matching list-pane group instead of covering whichever
     property row happens to scroll underneath it. */
  position: relative;
  flex: 0 0 auto;
  min-height: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  /* The band spans the whole horizontal calendar. Giving it overflow creates
     a second scroll container and traps the sticky label off-screen. */
  overflow: visible;
  border-top: 1px solid var(--cal-line-strong);
  border-bottom: 1px solid var(--cal-line-strong);
  background: color-mix(in srgb, var(--cal-surface-2) 91%, var(--cal-accent) 9%);
}
.property-calendar-group-band span {
  position: sticky;
  left: 0.7rem;
  display: inline-flex;
  align-items: center;
  max-width: min(320px, 38vw);
  padding: 0.18rem 0.55rem;
  overflow: hidden;
  color: var(--cal-text);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 1;
}

/* Agenda is the calendar's complete date-focused operating surface. It reads
   the same stays, blocks, Tasks and events as the grid, but replaces spatial
   decoding with a calm labelled list. */
.property-calendar-agenda {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  color: var(--cal-text);
  background: var(--cal-surface-3);
}
.property-calendar-agenda-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 13px;
  min-height: 78px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--cal-line);
  background: var(--cal-surface);
}
.property-calendar-agenda-head-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--cal-line);
  border-radius: 12px;
  color: var(--cal-accent-active);
  background: color-mix(in srgb, var(--cal-accent) 7%, var(--cal-surface));
}
.property-calendar-agenda-head-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.property-calendar-agenda-eyebrow {
  color: var(--cal-accent-active);
  font-size: 0.65rem;
  font-weight: 780;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}
.property-calendar-agenda-head-copy strong {
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-agenda-head-copy small {
  overflow: hidden;
  color: var(--cal-muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-agenda-scroll {
  display: grid;
  flex: 1 1 0;
  /* Keep each category at its full content height. This remains the Agenda's
     only vertical scroller; shrinking an implicit row clips its card instead. */
  grid-auto-rows: max-content;
  align-content: start;
  gap: 18px;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}
.property-calendar-agenda-group {
  width: min(100%, 1120px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--cal-line);
  border-radius: 14px;
  background: var(--cal-surface);
}
.property-calendar-agenda-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 43px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--cal-line);
  background: color-mix(in srgb, var(--cal-surface-2) 64%, transparent);
}
.property-calendar-agenda-group > header strong {
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.property-calendar-agenda-group > header span {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid var(--cal-line);
  border-radius: 999px;
  color: var(--cal-muted);
  font-size: 0.61rem;
  font-weight: 720;
  background: var(--cal-surface);
}
.property-calendar-agenda-row {
  --agenda-item-color: var(--cal-accent);
  display: grid;
  grid-template-columns: 76px 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--cal-line);
  color: var(--cal-text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.property-calendar-agenda-row.is-task {
  grid-template-columns: 76px 40px minmax(240px, 1fr) minmax(150px, 270px) 20px;
  min-height: 84px;
}
.property-calendar-agenda-row:last-child {
  border-bottom: 0;
}
.property-calendar-agenda-row:hover,
.property-calendar-agenda-row:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--cal-text) 4%, transparent);
}
.property-calendar-agenda-row:focus-visible {
  box-shadow: inset 3px 0 0 var(--cal-accent);
}
.property-calendar-agenda-time {
  color: var(--cal-muted);
  font-size: 0.72rem;
  font-weight: 720;
  font-feature-settings: "tnum";
  white-space: nowrap;
}
.property-calendar-agenda-glyph {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--cal-line);
  border-radius: 11px;
  color: var(--cal-muted);
  background: color-mix(in srgb, var(--cal-text) 4%, var(--cal-surface));
}
.property-calendar-agenda-glyph.is-task {
  color: var(--agenda-item-color);
  background: color-mix(in srgb, var(--agenda-item-color) 8%, var(--cal-surface));
}
.property-calendar-agenda-glyph.is-event {
  color: var(--cal-accent-active);
}
.property-calendar-agenda-glyph.is-block {
  border-style: dashed;
}
.property-calendar-agenda-platform,
.property-calendar-agenda-platform.platform-logo-image,
.property-calendar-agenda-platform .platform-logo-image {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50%;
  object-fit: contain;
}
.property-calendar-agenda-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.property-calendar-agenda-copy strong,
.property-calendar-agenda-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-agenda-copy strong {
  font-size: 0.86rem;
  font-weight: 720;
}
.property-calendar-agenda-row.is-task .property-calendar-agenda-copy strong {
  font-size: 0.94rem;
  font-weight: 750;
}
.property-calendar-agenda-copy small {
  color: var(--cal-muted);
  font-size: 0.7rem;
}
.property-calendar-agenda-task-signals {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}
.property-calendar-agenda-task-signals > span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--cal-line);
  border-radius: 999px;
  color: var(--cal-muted);
  background: color-mix(in srgb, var(--cal-text) 3%, transparent);
  font-size: 0.61rem;
  font-weight: 700;
  white-space: nowrap;
}
.property-calendar-agenda-task-signals > span.is-flip {
  border-color: color-mix(in srgb, var(--state-warning) 42%, transparent);
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 10%, transparent);
}
.property-calendar-agenda-owner {
  display: grid;
  min-width: 0;
  justify-items: end;
  gap: 5px;
}
.property-calendar-agenda-owner > small {
  max-width: 100%;
  overflow: hidden;
  color: var(--cal-muted);
  font-size: 0.65rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-agenda-owner.is-unassigned > small {
  color: var(--state-danger);
  font-weight: 760;
}
.property-calendar-agenda-chevron {
  color: var(--cal-muted);
  opacity: 0.55;
}
.property-calendar-agenda-empty {
  display: grid;
  min-height: 250px;
  place-content: center;
  justify-items: center;
  gap: 6px;
  color: var(--cal-muted);
  text-align: center;
}
.property-calendar-agenda-empty strong {
  color: var(--cal-text);
  font-size: 0.82rem;
}
.property-calendar-agenda-empty span {
  font-size: 0.69rem;
}
.property-calendar-agenda-note {
  flex: 0 0 auto;
  margin: 0;
  padding: 7px 14px;
  border-top: 1px solid var(--cal-line);
  color: var(--cal-muted);
  font-size: 0.62rem;
  line-height: 1.4;
  text-align: center;
  background: var(--cal-surface);
}
@container property-calendar (max-width: 760px) {
  .property-calendar-agenda-scroll {
    gap: 9px;
    padding: 9px;
  }
  .property-calendar-agenda-row {
    grid-template-columns: 60px 36px minmax(0, 1fr);
    min-height: 64px;
    padding-inline: 9px;
  }
  .property-calendar-agenda-row.is-task {
    grid-template-columns: 60px 36px minmax(0, 1fr);
    min-height: 96px;
  }
  .property-calendar-agenda-glyph {
    width: 29px;
    height: 29px;
  }
  .property-calendar-agenda-chevron {
    display: none;
  }
  .property-calendar-agenda-owner {
    grid-column: 3;
    justify-items: start;
  }
}

/* Legacy Task-list classes remain below for old cached bundles only. New
   navigation cannot enter that partial mode; Agenda above supersedes it. */
.property-calendar-task-list {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  color: var(--cal-text);
  background: var(--cal-surface-3);
}
.property-calendar-task-list-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--cal-line);
  background: var(--cal-surface);
}
.property-calendar-task-list-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--cal-accent-active);
  background: var(--cal-accent-soft);
}
.property-calendar-task-list-head > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.property-calendar-task-list-head strong {
  font-size: 0.86rem;
  font-weight: 750;
}
.property-calendar-task-list-head small {
  color: var(--cal-muted);
  font-size: 0.68rem;
}
.property-calendar-task-list-scroll {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}
.property-calendar-task-day {
  overflow: hidden;
  border: 1px solid var(--cal-line);
  border-radius: 13px;
  background: var(--cal-surface);
}
.property-calendar-task-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 43px;
  padding: 7px 11px;
  border-bottom: 1px solid var(--cal-line);
  background: color-mix(in srgb, var(--cal-surface-2) 68%, transparent);
}
.property-calendar-task-day-head > span:first-child {
  display: grid;
  gap: 1px;
}
.property-calendar-task-day-head strong {
  font-size: 0.76rem;
  font-weight: 750;
}
.property-calendar-task-day-head small {
  color: var(--cal-muted);
  font-size: 0.64rem;
}
.property-calendar-task-day-count {
  display: grid;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  place-items: center;
  border: 1px solid var(--cal-line);
  border-radius: 999px;
  color: var(--cal-text);
  font-size: 0.66rem;
  font-weight: 750;
  background: var(--cal-surface);
}
.property-calendar-task-day-items {
  display: grid;
}
.property-calendar-task-list-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid var(--cal-line);
  color: var(--cal-text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}
.property-calendar-task-list-row:last-child {
  border-bottom: 0;
}
.property-calendar-task-list-row:hover,
.property-calendar-task-list-row:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--cal-accent) 8%, transparent);
}
.property-calendar-task-list-row-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: var(--cal-accent-active);
  background: var(--cal-accent-soft);
}
.property-calendar-task-list-row-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.property-calendar-task-list-row-copy strong,
.property-calendar-task-list-row-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-task-list-row-copy strong {
  font-size: 0.75rem;
  font-weight: 680;
}
.property-calendar-task-list-row-copy small {
  color: var(--cal-muted);
  font-size: 0.64rem;
}
.property-calendar-task-list-priority {
  padding: 3px 7px;
  border: 1px solid var(--cal-line);
  border-radius: 999px;
  color: var(--cal-muted);
  font-size: 0.58rem;
  font-weight: 750;
  text-transform: capitalize;
  background: var(--cal-surface-2);
}
.property-calendar-task-list-priority.is-urgent,
.property-calendar-task-list-priority.is-high {
  border-color: color-mix(in srgb, var(--state-warning) 46%, var(--cal-line));
  color: var(--state-warning);
}
.property-calendar-task-list-priority.is-done {
  color: var(--state-success);
}
.property-calendar-task-list-empty {
  display: grid;
  min-height: 220px;
  place-content: center;
  justify-items: center;
  gap: 5px;
  color: var(--cal-muted);
  text-align: center;
}
.property-calendar-task-list-empty strong {
  color: var(--cal-text);
  font-size: 0.8rem;
}
.property-calendar-task-list-empty span {
  font-size: 0.68rem;
}
@media (max-width: 620px) {
  .property-calendar-task-list-scroll {
    padding: 8px;
  }
  .property-calendar-task-list-row {
    grid-template-columns: 30px minmax(0, 1fr);
  }
  .property-calendar-task-list-priority {
    display: none;
  }
}
/* Retired single-day timeline selectors. Kept temporarily so a cached client
   crossing deployments does not flash unstyled chrome; no current component
   or navigation path renders them. Agenda owns date-focused work. */
.property-day-timeline {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 0;
}
.property-day-timeline-title {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem 0.55rem;
}
.property-day-timeline-title strong {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--cal-text);
}
.property-day-timeline-title span {
  font-size: 0.72rem;
  color: var(--cal-muted);
}
.property-day-timeline-scroll {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.property-day-timeline-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.property-day-timeline-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: max-content;
}
.property-day-timeline-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: var(--day-h, 40px);
  background: var(--cal-surface);
  box-shadow: 0 1px 0 0 color-mix(in srgb, var(--cal-line-strong) 80%, transparent);
}
.property-day-timeline-hour {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding-left: 0.4rem;
  border-right: 1px solid color-mix(in srgb, var(--cal-line) 45%, transparent);
  font-size: 0.62rem;
  color: var(--cal-muted);
  letter-spacing: 0.02em;
}
.property-day-timeline-hour-notch {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 4px;
  background: color-mix(in srgb, var(--cal-muted) 42%, transparent);
  pointer-events: none;
}
.property-day-timeline-hour-notch.is-quarter { left: 25%; }
.property-day-timeline-hour-notch.is-half {
  left: 50%;
  height: 7px;
}
.property-day-timeline-hour-notch.is-three-quarter { left: 75%; }
.property-day-timeline-rows {
  display: flex;
  flex-direction: column;
  /* The day timeline owns a sticky property column, so it only shares the
     resource order and card heights — not the multi-calendar axis. */
  gap: var(--row-gap, 4px);
  padding-top: var(--row-gap, 4px);
}
.property-day-timeline-row {
  position: relative;
  flex: 0 0 auto;
}
.property-day-timeline-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px solid color-mix(in srgb, var(--cal-line) 28%, transparent);
  pointer-events: none;
}
.property-day-timeline-cell.is-event-target {
  z-index: 1;
  padding: 0;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--cal-line) 28%, transparent);
  background:
    linear-gradient(
      90deg,
      transparent 0 24%,
      color-mix(in srgb, var(--cal-line) 14%, transparent) 25%,
      transparent 26% 49%,
      color-mix(in srgb, var(--cal-line) 22%, transparent) 50%,
      transparent 51% 74%,
      color-mix(in srgb, var(--cal-line) 14%, transparent) 75%,
      transparent 76% 100%
    );
  pointer-events: auto;
  cursor: crosshair;
}
.property-day-timeline-cell.is-event-target:hover,
.property-day-timeline-cell.is-event-target:focus-visible {
  outline: 0;
  background: color-mix(in srgb, var(--accent, #6366f1) 13%, transparent);
}
/* Same liquid-glass language as the grid chips so the two rungs of the ladder
   read as the same calendar, not two different screens. */
/* Lane-packed bars in the day view's stay band (2026-07-26): `top` and `height`
   come from the lane, so the vertical centring below has to be switched off.
   The base height's `calc(100% - 12px)` is also wrong once the band grows to
   hold several lanes — a laned bar is exactly one lane tall. */
.property-day-timeline-bar.is-laned {
  transform: none;
}
.property-day-timeline-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: min(36px, calc(100% - 12px));
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.55rem;
  border: 1px solid color-mix(in srgb, var(--cal-line-strong) 40%, transparent);
  border-left: 3px solid color-mix(in srgb, var(--cal-accent) 70%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--cal-accent) 12%, transparent);
  color: var(--cal-text);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}
.property-day-timeline-bar.is-block {
  border-left-color: color-mix(in srgb, #f87171 70%, transparent);
  background: repeating-linear-gradient(
    45deg,
    color-mix(in srgb, #f87171 10%, transparent) 0 6px,
    transparent 6px 12px
  );
  cursor: default;
  font-weight: 500;
}
.property-day-timeline-bar-logo {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
}
.property-day-timeline-bar-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-day-timeline-prop {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 100%;
  width: 168px;
  padding: 0 0.6rem;
  background: var(--cal-surface);
  border-right: 1px solid color-mix(in srgb, var(--cal-line) 60%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cal-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-day-timeline-hour.is-spacer {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--cal-surface);
  border-right: 1px solid color-mix(in srgb, var(--cal-line) 60%, transparent);
}
.property-day-timeline-empty {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  color: color-mix(in srgb, var(--cal-muted) 75%, transparent);
  pointer-events: none;
}
/* ── The day's work ────────────────────────────────────────────────────────
   Tasks in the hour view (2026-07-26). Two bands per row: stays keep the one
   they always had, tasks get a new one beneath, because a changeover clean
   deliberately OVERLAPS the checkout it follows and sharing a band would draw
   one on top of the other. Historical compatibility styles only. */
.property-day-timeline-stays {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.property-day-timeline-tasks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
.property-day-timeline-events {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
}
.property-day-timeline-event {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.45rem;
  border: 1px solid color-mix(in srgb, #8b7cf6 48%, transparent);
  border-left: 3px solid #8b7cf6;
  border-radius: 7px;
  background:
    linear-gradient(
      110deg,
      color-mix(in srgb, #8b7cf6 22%, var(--cal-surface)),
      color-mix(in srgb, #5b8def 12%, var(--cal-surface))
    );
  color: var(--cal-text);
  font-size: 0.67rem;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 7%, transparent);
}
.property-day-timeline-event:hover,
.property-day-timeline-event:focus-visible {
  outline: 0;
  border-color: color-mix(in srgb, #a99cff 78%, transparent);
  background:
    linear-gradient(
      110deg,
      color-mix(in srgb, #8b7cf6 31%, var(--cal-surface)),
      color-mix(in srgb, #5b8def 19%, var(--cal-surface))
    );
}
.property-day-timeline-event.is-clip-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left-style: dashed;
}
.property-day-timeline-event.is-clip-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right-style: dashed;
}
.property-day-timeline-event-kind,
.property-day-timeline-event-time {
  flex: 0 0 auto;
  color: color-mix(in srgb, #b9afff 82%, var(--cal-text));
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}
.property-day-timeline-event-time {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  text-transform: none;
}
.property-day-timeline-task {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0 0.4rem;
  border: 1px solid color-mix(in srgb, var(--task-tint, #94a3b8) 45%, transparent);
  border-left: 3px solid var(--task-tint, #94a3b8);
  border-radius: 6px;
  background: color-mix(in srgb, var(--task-tint, #94a3b8) 14%, var(--cal-surface));
  color: var(--cal-text);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
}
.property-day-timeline-task:hover,
.property-day-timeline-task:focus-visible {
  background: color-mix(in srgb, var(--task-tint, #94a3b8) 26%, var(--cal-surface));
}
/* A deadline is a moment, not a window — the flat left edge and the dotted
   right say "due by here", rather than implying the job fills 45 minutes. */
.property-day-timeline-task.is-point {
  border-right-style: dotted;
}
/* A job that began yesterday or runs into tomorrow loses the rounded edge on
   the clipped side, so the bar reads as continuing rather than starting at
   midnight. Same language as the grid's clipped chips. */
.property-day-timeline-task.is-clip-left {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left-style: dashed;
}
.property-day-timeline-task.is-clip-right {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right-style: dashed;
}
.property-day-timeline-task-when {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: color-mix(in srgb, var(--task-tint, #94a3b8) 80%, var(--cal-text));
}
/* The row for work with no property attached. Same idea as the grid's
   unassigned strip, which is where the user first meets the concept. */
.property-day-timeline-row.is-unassigned .property-day-timeline-prop {
  color: var(--cal-muted);
  font-style: italic;
}

/* ── No set time ───────────────────────────────────────────────────────────
   Half the workspace's dated jobs carry the import's date-only default, and
   the busiest single day holds 38 of them. They sit OUTSIDE the hour canvas:
   nothing here occupies an hour, so nothing here should scroll sideways away
   from the reader. It scrolls internally instead of growing without limit. */
.property-day-timeline-allday {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0.75rem 0.35rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--cal-line) 55%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--cal-muted) 6%, transparent);
}
.property-day-timeline-allday-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.15rem;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cal-muted);
}
.property-day-timeline-allday-label strong {
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-muted) 20%, transparent);
  color: var(--cal-text);
  font-size: 0.64rem;
  letter-spacing: 0;
}
.property-day-timeline-allday-chips {
  /* `flex: 1 1 0` + `min-width: 0` on purpose: without them the container
     sizes to its widest chip and every chip lands on its own line, which is
     what shipped to the browser on the first pass. */
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  /* Three rows deep, then scroll. A day with 38 untimed jobs must not push
     the hour canvas off the screen. */
  max-height: 84px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.property-day-timeline-allday-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 260px;
  padding: 0.1rem 0.4rem;
  border: 1px solid color-mix(in srgb, var(--task-tint, #94a3b8) 45%, transparent);
  border-left: 3px solid var(--task-tint, #94a3b8);
  border-radius: 6px;
  background: color-mix(in srgb, var(--task-tint, #94a3b8) 12%, var(--cal-surface));
  color: var(--cal-text);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}
.property-day-timeline-allday-chip:hover,
.property-day-timeline-allday-chip:focus-visible {
  background: color-mix(in srgb, var(--task-tint, #94a3b8) 24%, var(--cal-surface));
}
.property-day-timeline-allday-prop {
  flex: 0 0 auto;
  font-weight: 500;
  font-size: 0.64rem;
  color: var(--cal-muted);
}
/* A job running from before today until after it DID have times chosen — they
   are just not today's. Dashed on both sides, the same language the hour bars
   use for a clipped edge, plus a caption so it needs no tooltip to explain. */
.property-day-timeline-allday-chip.is-running {
  border-style: dashed;
  border-left-style: dashed;
}
.property-day-timeline-allday.is-events {
  border-color: color-mix(in srgb, #8b7cf6 34%, var(--cal-line));
  background: color-mix(in srgb, #8b7cf6 7%, transparent);
}
.property-day-timeline-allday-chip.is-event {
  --task-tint: #8b7cf6;
}
.property-day-timeline-allday-run {
  flex: 0 0 auto;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--task-tint, #94a3b8) 80%, var(--cal-text));
}

/* The honesty caption. Not a tooltip — it must be readable without hovering,
   because every time on this retired screen was a standard window, not a
   guest's real arrival. */
.property-day-timeline-note {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.75rem 0;
  font-size: 0.64rem;
  line-height: 1.35;
  color: color-mix(in srgb, var(--cal-muted) 85%, transparent);
}

/* Compact density adds the tiny occupancy bar; it does not hide the labels
   needed to understand the calendar or imply a different view. */
.property-calendar-day-head-weekday {
  opacity: var(--calendar-secondary-detail, 1);
}
.property-calendar-day-head > strong {
  opacity: var(--calendar-date-detail, 1);
}
.property-calendar-res-chip-name,
.property-calendar-task-chip-title,
.property-calendar-unassigned-chip-title {
  opacity: var(--calendar-primary-detail, 1);
}
.property-calendar-res-chip-meta,
.property-calendar-res-chip-channel,
.property-calendar-task-chip-num,
.property-calendar-turnover-label {
  opacity: var(--calendar-secondary-detail, 1);
}
.property-calendar-day-marker {
  opacity: var(--calendar-primary-detail, 1);
}
.property-calendar-grid-shell[data-zoom-stage="compact"]
  .property-calendar-day-marker {
  opacity: 0.72 !important;
}
.property-calendar-day-head-density {
  position: absolute;
  left: max(2px, 12%);
  right: max(2px, 12%);
  bottom: 4px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-text) 11%, transparent);
  opacity: var(--calendar-overview-detail, 0);
  pointer-events: none;
}
.property-calendar-day-head-density::after {
  display: block;
  width: calc(var(--calendar-day-density, 0) * 100%);
  height: 100%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--status-confirmed) 72%, var(--cal-text));
  content: "";
}

/* Toolbar camera control: semantic level is the user-facing value; pixel
   widths are just the rendering implementation. */
.property-calendar-zoom-cap {
  min-width: 20px;
  text-align: center;
  color: color-mix(in srgb, var(--cal-text) 55%, transparent);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  user-select: none;
}
.property-calendar-zoom-level {
  min-width: 46px;
  color: var(--cal-text);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  text-align: left;
}

/* Shared by desktop and the phone web calendar mounted by the iOS shell. */
.calendar-zoom-portal {
  position: absolute;
  top: 74px;
  left: 50%;
  z-index: 55;
  display: block;
  width: max-content;
  color: var(--cal-text, var(--ph-text, #f4f4f5));
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition:
    opacity 140ms ease,
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.calendar-zoom-portal.is-active {
  opacity: 1;
  transform: translate(-50%, 0);
}
.calendar-zoom-portal.is-phone {
  position: fixed;
  top: calc(122px + env(safe-area-inset-top));
  color: var(--ph-text, #f4f4f5);
}
.calendar-zoom-hud {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  border-radius: 999px;
  background: color-mix(
    in srgb,
    var(--cal-surface, var(--ph-bg, #111116)) 88%,
    transparent
  );
  box-shadow: 0 8px 22px -14px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.calendar-zoom-hud-kicker {
  color: color-mix(in srgb, currentColor 58%, transparent);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.calendar-zoom-hud strong {
  font-size: 0.68rem;
  font-weight: 760;
}
/* Retired hour-view notch rules retained only for cached bundles from before
   the Calendar / Agenda cutover. Current density zoom never renders them. */
.calendar-day-time-notches {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 10px;
  color: color-mix(in srgb, currentColor 58%, transparent);
  opacity: var(--calendar-fine-detail, 0);
  pointer-events: none;
}
.calendar-day-time-notch {
  position: absolute;
  bottom: 0;
  display: grid;
  justify-items: center;
  transform: translateX(-50%);
}
.calendar-day-time-notch i {
  width: 1px;
  height: 4px;
  background: currentColor;
}
.calendar-day-time-notch b {
  position: absolute;
  bottom: 3px;
  font-size: 0.44rem;
  font-weight: 700;
  line-height: 1;
}
.calendar-day-time-notch.is-intermediate {
  opacity: var(--calendar-day-progress, 0);
}
.calendar-day-time-notch.is-intermediate i {
  height: 3px;
  opacity: 0.72;
}
/* A live wall-clock wash through the current date. It matches the strong
   neutral elapsed-region treatment below so the header does not imply that
   this morning and this afternoon are the same state. */
.calendar-current-past-progress {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  background: color-mix(in srgb, var(--cal-surface-2) 46%, transparent);
  -webkit-backdrop-filter: grayscale(0.92) saturate(0.16) brightness(0.7);
  backdrop-filter: grayscale(0.92) saturate(0.16) brightness(0.7);
  box-shadow: 2px 0 0 color-mix(in srgb, var(--today-line, #f59e0b) 78%, transparent);
  pointer-events: none;
}
[data-theme="light"] .calendar-current-past-progress {
  background: color-mix(in srgb, var(--cal-surface-2) 38%, transparent);
  -webkit-backdrop-filter: grayscale(0.92) saturate(0.14) brightness(0.91);
  backdrop-filter: grayscale(0.92) saturate(0.14) brightness(0.91);
}
@media (prefers-reduced-motion: reduce) {
  .calendar-depth-back,
  .calendar-depth-mid,
  .calendar-depth-front,
  .calendar-zoom-portal {
    transition: none !important;
    transform: none !important;
  }
  .calendar-zoom-portal {
    left: 50%;
    transform: translateX(-50%) !important;
  }
}
/* Range input, restyled premium and theme-aware: a thin rounded rail with a
   clear accent thumb that reads in both light and dark. */
.property-calendar-zoom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 118px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-text) 22%, transparent);
  cursor: pointer;
  outline: none;
}
.property-calendar-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--cal-accent);
  border: 2px solid var(--cal-surface);
  box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.property-calendar-zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--cal-surface);
  border-radius: 999px;
  background: var(--cal-accent);
  box-shadow: 0 1px 3px -1px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}
.property-calendar-zoom-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cal-accent) 40%, transparent);
}
.property-calendar-zoom-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cal-accent) 40%, transparent);
}
.property-calendar-col-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background: var(--cal-accent-soft);
  border-left: 1px solid color-mix(in srgb, var(--cal-accent) 35%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--cal-accent) 35%, transparent);
  z-index: 1;
  transform: translateX(-9999px);
  transition: opacity 0.08s ease;
  will-change: transform;
}
.property-calendar-past-overlay,
.property-calendar-now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}
.property-calendar-past-overlay {
  left: 0;
  z-index: 12;
  /* Elapsed time must read as a different region before somebody starts
     decoding individual objects. The old 16% black wash barely moved the
     already-dark calendar. This neutral veil removes semantic colour and
     contrast while keeping text legible; hover/focus still lifts an object
     above it. Theme tokens keep the same relationship in light mode. */
  background: color-mix(in srgb, var(--cal-surface-2) 46%, transparent);
  -webkit-backdrop-filter: grayscale(0.92) saturate(0.16) brightness(0.7);
  backdrop-filter: grayscale(0.92) saturate(0.16) brightness(0.7);
  border-right: 1px solid color-mix(in srgb, var(--cal-muted) 58%, transparent);
}
[data-theme="light"] .property-calendar-past-overlay {
  background: color-mix(in srgb, var(--cal-surface-2) 38%, transparent);
  -webkit-backdrop-filter: grayscale(0.92) saturate(0.14) brightness(0.91);
  backdrop-filter: grayscale(0.92) saturate(0.14) brightness(0.91);
}
.property-calendar-now-line {
  z-index: 13;
  width: 2px;
  background: color-mix(in srgb, var(--today-line) 88%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cal-surface) 32%, transparent),
    0 0 10px color-mix(in srgb, var(--today-line) 28%, transparent);
  transform: translateX(-1px);
}

/* Header — no chunky shadow, just a hairline divider. The high z-index lets
   the day-head hover tooltip render on top of everything below it (chips,
   active row tints, column highlight) without escaping a stacking context. */
.property-calendar-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--cal-surface);
  box-shadow: 0 1px 0 0 color-mix(in srgb, var(--cal-line-strong) 80%, transparent);
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}
.property-calendar-header-row {
  display: flex;
  align-items: stretch;
}
.property-calendar-header-month-row {
  height: var(--month-h, 28px);
}
.property-calendar-header-day-row {
  height: var(--day-h, 40px);
  border-top: 1px solid color-mix(in srgb, var(--cal-line) 70%, transparent);
}
.property-calendar-month-strip,
.property-calendar-day-strip {
  position: relative;
  display: block;
  flex: 0 0 auto;
}
.property-calendar-month-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  border-right: 1px solid color-mix(in srgb, var(--cal-line) 70%, transparent);
  background: var(--cal-surface);
  /* NO `overflow: hidden` here — that would create a horizontal scroll
     context that traps `position: sticky` children inside the cell, killing
     the month-label drift effect. The label is wrapped in an inline-block,
     so it can't visually leak past the next cell's label which is rendered
     on top in DOM order. */
}
.property-calendar-month-cell:last-child {
  border-right: none;
}
/* Label slides along the calendar's left edge while we're scrolling within
   its month, then is "handed off" to the next month's label as that cell
   takes over. The sticky element sits inside the month cell, so its drift
   range is bounded by the cell's own width — once the cell scrolls fully
   past, the label disappears and the next month's label has already
   started its drift. The label has an opaque background so it visually
   covers any earlier cell's label that might still be drifting beneath. */
.property-calendar-month-cell-label {
  position: sticky;
  left: 0.6rem;
  display: inline-block;
  padding: 0.1rem 0.55rem 0.1rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cal-text);
  white-space: nowrap;
  background: var(--cal-surface);
  z-index: 2;
}
.property-calendar-day-head {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--day-width, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 0.72rem;
  color: var(--cal-muted);
  padding: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-right: 1px solid color-mix(in srgb, var(--cal-line-strong) 58%, transparent);
  border-radius: 0;
  background: transparent;
  font: inherit;
  appearance: none;
  cursor: default;
  transition: background 0.08s ease, color 0.08s ease;
}
.property-calendar-day-head.is-actionable {
  cursor: pointer;
}
.property-calendar-day-head:focus-visible {
  z-index: 3;
  outline: 2px solid color-mix(in srgb, #d97706 78%, transparent);
  outline-offset: -2px;
}
.property-calendar-day-head:hover {
  background: color-mix(in srgb, var(--cal-accent) 22%, transparent);
  color: var(--cal-text);
}
.property-calendar-day-head:hover strong {
  color: var(--cal-text);
}
.property-calendar-day-head strong {
  position: relative;
  z-index: 1;
  font-size: calc(0.85rem * var(--cal-type-scale, 1));
  color: var(--cal-text);
  font-weight: 600;
}
.property-calendar-day-head-weekday {
  position: relative;
  z-index: 1;
  font-size: calc(0.62rem * var(--cal-type-scale, 1));
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.property-calendar-day-head.is-weekend {
  background: var(--weekend-bg);
}
.property-calendar-day-head.is-week-start {
  border-left: 1px solid color-mix(in srgb, var(--cal-line-strong) 92%, transparent);
}
.property-calendar-day-head.is-month-start {
  border-left: 2px solid color-mix(in srgb, var(--cal-line-strong) 100%, transparent);
}
/* Today is both a labelled column and the live boundary between elapsed and
   upcoming time. The body continues this edge with `.property-calendar-now-line`. */
.property-calendar-day-head.is-today {
  color: var(--today-line);
  background: color-mix(in srgb, var(--today-line) 8%, var(--cal-surface));
  box-shadow:
    inset 1px 0 0 color-mix(in srgb, var(--today-line) 42%, transparent),
    inset -1px 0 0 color-mix(in srgb, var(--today-line) 30%, transparent);
}
.property-calendar-day-head.is-today strong {
  color: var(--today-line);
}
/* Day-head hover tooltip — pure CSS reveal so hovering a date never causes
   any React re-render. The popover is portalled visually below the sticky
   header by using z-index above the rows. */
.property-calendar-day-head-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(2px);
  display: grid;
  gap: 0.18rem;
  padding: 0.45rem 0.6rem;
  min-width: 130px;
  background: var(--cal-surface-3);
  border: 1px solid var(--cal-line-strong);
  border-radius: 9px;
  box-shadow: 0 18px 36px -14px rgba(0, 0, 0, 0.6);
  font-size: 0.7rem;
  color: var(--cal-text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 32;
}
.property-calendar-day-head:hover .property-calendar-day-head-pop {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.property-calendar-day-head-pop-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.property-calendar-day-head-pop-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
}
.property-calendar-day-head-pop-dot[data-kind="reservations"] {
  background: var(--status-confirmed);
}
.property-calendar-day-head-pop-dot[data-kind="checkins"] {
  background: #16a34a;
}
.property-calendar-day-head-pop-dot[data-kind="checkouts"] {
  background: #d97706;
}
.property-calendar-day-head-pop-dot[data-kind="tasks"] {
  background: #38bdf8;
}
.property-calendar-day-head-pop-dot[data-kind="events"] {
  background: #8b5cf6;
}
.property-calendar-day-head-pop-dot[data-kind="blocks"] {
  background: #ef4444;
}
.property-calendar-day-head-pop-dot[data-kind="rates"] {
  background: #22c55e;
}
.property-calendar-day-head-pop-dot[data-kind="missing"] {
  background: #64748b;
}

/* Resource rows need visible boundaries across a wide calendar. */
.property-calendar-row {
  display: flex;
  align-items: stretch;
  background: color-mix(in srgb, var(--cal-surface-2) 30%, transparent);
  transition: background 0.12s ease;
  position: relative;
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--cal-line-strong) 72%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--cal-line-strong) 82%, transparent);
}
.property-calendar-row:last-child {
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--cal-line-strong) 72%, transparent),
    inset 0 -1px 0 color-mix(in srgb, var(--cal-line-strong) 82%, transparent);
}
.property-calendar-dashboard-row-label {
  position: sticky;
  left: 10px;
  z-index: 28;
  flex: 0 0 180px;
  width: 180px;
  margin: 10px -180px 10px 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--cal-line-strong) 72%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--cal-surface) 92%, transparent);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(16px) saturate(1.15);
  pointer-events: none;
}
.property-calendar-dashboard-row-label img,
.property-calendar-dashboard-row-placeholder {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  object-fit: cover;
  background: color-mix(in srgb, var(--cal-surface-3) 90%, var(--cal-line));
}
.property-calendar-dashboard-row-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 760;
  color: var(--cal-text);
}

/* Authenticated client-dashboard invitation composer. */
.fin-dashboard-invite-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 18, 0.72);
  backdrop-filter: blur(10px);
}
.fin-dashboard-invite {
  width: min(1040px, 100%);
  max-height: min(900px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: 0 32px 90px rgba(0,0,0,.38);
}
.fin-dashboard-invite > header,
.fin-dashboard-invite > footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
}
.fin-dashboard-invite > header { border-bottom: 1px solid var(--border-subtle); }
.fin-dashboard-invite > footer { border-top: 1px solid var(--border-subtle); }
.fin-dashboard-invite > header > div,
.fin-dashboard-invite > header > div > div,
.fin-dashboard-invite > footer > div,
.fin-dashboard-invite-link a { display: flex; align-items: center; }
.fin-dashboard-invite > header > div { gap: 11px; }
.fin-dashboard-invite > header > div > div { align-items: flex-start; flex-direction: column; gap: 2px; }
.fin-dashboard-invite > header h2 { margin: 0; font-size: 1rem; }
.fin-dashboard-invite > header p { margin: 0; color: var(--text-muted); font-size: .7rem; }
.fin-dashboard-invite > header > button { border: 0; background: transparent; padding: 7px; color: var(--text-muted); cursor: pointer; }
.fin-dashboard-invite-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#6565e5,#3b3ea7); }
.fin-dashboard-invite-loading { min-height: 180px; display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--text-muted); font-size: .78rem; }
.fin-dashboard-invite-error { margin: 14px 18px 0; padding: 10px 12px; border: 1px solid color-mix(in srgb,var(--danger) 34%,var(--border-subtle)); border-radius: 10px; color: var(--danger); background: color-mix(in srgb,var(--danger) 8%,transparent); font-size: .74rem; }
.fin-dashboard-invite-warning { margin: 14px 18px 0; padding: 10px 12px; border: 1px solid color-mix(in srgb,#d99a24 42%,var(--border-subtle)); border-radius: 10px; color: #a76a08; background: color-mix(in srgb,#d99a24 9%,transparent); font-size: .74rem; }
.fin-dashboard-access-summary { margin: 16px 18px 0; padding: 14px; display: grid; grid-template-columns: minmax(230px,1fr) auto; align-items: center; gap: 12px 18px; border: 1px solid var(--border-subtle); border-radius: 13px; background: color-mix(in srgb,var(--bg-base) 82%,transparent); }
.fin-dashboard-access-summary > div:first-child { min-width: 0; }
.fin-dashboard-access-summary strong,.fin-dashboard-access-summary small { display: block; }
.fin-dashboard-access-summary strong { margin: 7px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.fin-dashboard-access-summary small { color: var(--text-muted); font-size: .66rem; line-height: 1.45; }
.fin-dashboard-access-summary small.danger { margin-top: 4px; color: var(--danger); }
.fin-dashboard-access-state { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb,var(--text-muted) 12%,transparent); color: var(--text-muted); font-size: .62rem; font-weight: 780; text-transform: uppercase; letter-spacing: .04em; }
.fin-dashboard-access-state.is-active { color: var(--success); background: color-mix(in srgb,var(--success) 12%,transparent); }
.fin-dashboard-access-state.is-invited { color: var(--accent); background: color-mix(in srgb,var(--accent) 12%,transparent); }
.fin-dashboard-access-state.is-failed { color: var(--danger); background: color-mix(in srgb,var(--danger) 12%,transparent); }
.fin-dashboard-access-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.fin-dashboard-access-actions .btn { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.fin-dashboard-access-summary > p { grid-column: 1 / -1; margin: 0; padding-top: 10px; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: .68rem; line-height: 1.45; }
.fin-dashboard-invite-body { padding: 18px; }
.fin-dashboard-invite-meta { display: grid; grid-template-columns: repeat(auto-fit,minmax(165px,1fr)); gap: 10px; }
.fin-dashboard-invite-meta > div,.fin-dashboard-invite-meta > label { padding: 12px; border: 1px solid var(--border-subtle); border-radius: 11px; background: var(--bg-base); min-width: 0; }
.fin-dashboard-invite-meta span,.fin-dashboard-invite-meta small { display: block; color: var(--text-muted); font-size: .65rem; }
.fin-dashboard-invite-meta strong { display: block; margin: 5px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.fin-dashboard-invite-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-dashboard-invite-start input { width: 100%; margin: 4px 0 3px; border: 0; border-bottom: 1px solid var(--border-subtle); background: transparent; color: var(--text-primary); padding: 2px 0 4px; font: 700 .78rem/1.2 inherit; }
.fin-dashboard-invite-editor { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(300px,.95fr); gap: 14px; margin-top: 14px; }
.fin-dashboard-invite-editor > div,.fin-dashboard-invite-editor > aside { border: 1px solid var(--border-subtle); border-radius: 12px; padding: 14px; min-width: 0; }
.fin-dashboard-invite-editor label { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.fin-dashboard-invite-editor label > span,.fin-dashboard-invite-editor > aside > span,.fin-dashboard-invite-link > span { color: var(--text-muted); font-size: .64rem; font-weight: 750; text-transform: uppercase; letter-spacing: .045em; }
.fin-dashboard-invite-editor input,.fin-dashboard-invite-editor select,.fin-dashboard-invite-editor textarea { width: 100%; border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--bg-base); color: var(--text-primary); padding: 9px 10px; font: inherit; font-size: .74rem; }
.fin-dashboard-invite-editor textarea { resize: vertical; line-height: 1.48; }
.fin-dashboard-invite-editor .autobuild-email { min-width: 0; margin-bottom: 10px; }
.fin-dashboard-invite-editor > div > a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: .68rem; text-decoration: none; }
.fin-dashboard-invite-editor > aside { background: color-mix(in srgb,var(--bg-base) 78%,transparent); }
.fin-dashboard-invite-editor article { margin-top: 8px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated); padding: 12px; }
.fin-dashboard-invite-editor article > strong { display: block; padding-bottom: 9px; border-bottom: 1px solid var(--border-subtle); font-size: .76rem; }
.fin-dashboard-invite-editor article iframe { width: 100%; min-height: 310px; margin-top: 10px; border: 0; border-radius: 8px; background: #fff; }
.fin-dashboard-invite-editor article > p { margin: 12px 0 0; font-size: .7rem; }
.fin-dashboard-invite-plain { margin-top: 8px; border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--bg-elevated); }
.fin-dashboard-invite-plain summary { padding: 8px 10px; cursor: pointer; color: var(--text-muted); font-size: .66rem; font-weight: 700; }
.fin-dashboard-invite-plain pre { margin: 0; padding: 0 10px 10px; white-space: pre-wrap; word-break: break-word; color: var(--text-primary); font: 400 .68rem/1.5 inherit; }
.fin-dashboard-invite-editor aside > small { display: block; margin-top: 8px; color: var(--text-muted); font-size: .63rem; line-height: 1.4; }
.fin-dashboard-invite-link { margin-top: 12px; display: flex; align-items: center; gap: 12px; min-width: 0; }
.fin-dashboard-invite-link a { gap: 5px; color: var(--accent); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.fin-dashboard-invite-link strong { color: var(--text-primary); font-size: .68rem; font-weight: 650; line-height: 1.4; }
.fin-dashboard-invite > footer > div { gap: 8px; }
.fin-dashboard-invite > footer .btn { display: inline-flex; align-items: center; gap: 5px; }
.fin-dashboard-invite-sent { display: flex; align-items: center; gap: 6px; color: var(--success); font-size: .72rem; font-weight: 700; }
.fin-dashboard-invite-footer-error { max-width: 620px; color: var(--danger); font-size: .72rem; font-weight: 650; line-height: 1.4; }
@media(max-width:760px){.fin-dashboard-invite-backdrop{padding:8px}.fin-dashboard-access-summary{grid-template-columns:1fr}.fin-dashboard-access-actions{justify-content:flex-start}.fin-dashboard-invite-meta{grid-template-columns:1fr}.fin-dashboard-invite-editor{grid-template-columns:1fr}.fin-dashboard-invite > footer{align-items:flex-start;flex-direction:column}.fin-dashboard-invite > footer > div{width:100%;justify-content:flex-end}}
.property-calendar-row.is-active {
  background: color-mix(in srgb, var(--cal-accent) 10%, transparent);
  box-shadow:
    inset 3px 0 0 0 var(--cal-accent-active),
    inset 0 -1px 0 0 color-mix(in srgb, var(--cal-accent) 25%, transparent);
  /* No z-index here — assigning one creates a new stacking context that
     would seal the chip hover popover (z=40) underneath the sticky
     header (z=30). The inset accent box-shadow renders correctly without
     it. */
}
.property-calendar-row.is-active .property-calendar-day-cell:not(.is-weekend):not(.is-selected) {
  background: color-mix(in srgb, var(--cal-accent) 6%, transparent);
}
/* Weekend/past cell washes are OPAQUE, so on the active row they punch
   holes straight through the row's transparent accent tint. Mix the
   accent INTO those washes (16% ≈ the row 10% + cell 6% composite on
   plain cells) so the selection reads as one continuous band while
   weekend/past depth stays faintly visible inside it. `.is-selected`
   is excluded so the stronger picked-cell tint keeps winning. */
.property-calendar-row.is-active .property-calendar-day-cell.is-weekend:not(.is-selected) {
  background: color-mix(in srgb, var(--cal-accent) 16%, var(--weekend-bg));
}
.property-calendar-row.is-active .property-calendar-day-cell.is-past:not(.is-weekend):not(.is-selected) {
  background: color-mix(
    in srgb,
    var(--cal-accent) 16%,
    color-mix(in srgb, var(--cal-surface) 88%, var(--cal-text) 9%)
  );
}
.property-calendar-row.is-active .property-calendar-day-cell.is-past.is-weekend:not(.is-selected) {
  background: color-mix(
    in srgb,
    var(--cal-accent) 16%,
    color-mix(in srgb, var(--weekend-bg) 88%, var(--cal-text) 9%)
  );
}
.property-calendar-row--shimmer {
  background: linear-gradient(
    90deg,
    var(--cal-surface) 0%,
    color-mix(in srgb, var(--cal-surface-2) 80%, var(--cal-surface)) 50%,
    var(--cal-surface) 100%
  );
  background-size: 200% 100%;
  animation: cal-shimmer 1.4s linear infinite;
  opacity: 0.55;
}
.property-calendar-row--placeholder {
  background:
    repeating-linear-gradient(
      to right,
      transparent 0 calc(var(--day-width, 64px) - 1px),
      color-mix(in srgb, var(--cal-line) 72%, transparent)
        calc(var(--day-width, 64px) - 1px) var(--day-width, 64px)
    ),
    color-mix(in srgb, var(--cal-surface-2) 34%, var(--cal-surface));
  opacity: 0.7;
}
@keyframes cal-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.property-calendar-row-days {
  position: relative;
  flex: 1 1 auto;
}
.property-calendar-row-days .property-calendar-day-strip {
  height: 100%;
}

/* Day cells — price and min stay read as ONE muted line in the empty band
   above the reservation chip, so the chips still dominate the row visually
   while the pricing layer survives however booked the row is. See the
   banner comment in PropertyCalendarDayCell.tsx for why this replaced the
   old opposite-corners grid. */
.property-calendar-day-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--day-width, 64px);
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--cal-line-strong) 50%, transparent);
  /* Global button chrome gives every button a 12px radius. Calendar days are
     grid coordinates, not cards, so they must stay square. */
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--cal-muted);
  text-align: left;
  padding: 0;
  display: block;
  cursor: pointer;
  font-size: 0.7rem;
  overflow: hidden;
  isolation: isolate;
}
/* The physical axis gains real sub-day divisions as the semantic camera moves
   closer. Quarter-day lines arrive first; all 24 hour lines fade in only
   during the final grid → Day transition. */
.property-calendar-day-cell::after,
.property-calendar-day-cell::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(
    90deg,
    transparent calc(100% - 1px),
    color-mix(in srgb, var(--cal-line) 50%, transparent) calc(100% - 1px)
  );
  content: "";
  pointer-events: none;
}
.property-calendar-day-cell::after {
  background-size: 25% 100%;
  opacity: calc(var(--calendar-fine-detail, 0) * 0.72);
}
.property-calendar-day-cell::before {
  background-size: calc(100% / 24) 100%;
  opacity: calc(var(--calendar-day-progress, 0) * 0.42);
}
.property-calendar-day-cell.is-weekend {
  background: var(--weekend-bg);
}
.property-calendar-day-cell.is-week-start {
  border-left: 1px solid color-mix(in srgb, var(--cal-line-strong) 88%, transparent);
}
.property-calendar-day-cell.is-month-start {
  border-left: 2px solid color-mix(in srgb, var(--cal-line-strong) 100%, transparent);
}
.property-calendar-day-cell.is-today {
  background: color-mix(in srgb, var(--today-line) 2.5%, transparent);
}
/* Per-cell colour remains modest; one continuous overlay below dims the
   objects as well as the cells, so elapsed time reads as a region rather than
   a checkerboard of unrelated grey boxes. */
.property-calendar-day-cell.is-past {
  background: color-mix(in srgb, var(--cal-surface) 96%, #020617 4%);
}
.property-calendar-day-cell.is-past.is-weekend {
  background: color-mix(in srgb, var(--weekend-bg) 94%, #020617 6%);
}
.property-calendar-day-cell.is-past .property-calendar-day-marker {
  opacity: 0.55;
}
/* Day-strip headers for past dates fade their weekday + day number
   gently — matching the cell wash so the strip and grid feel like a
   single softly-muted block. */
.property-calendar-day-head.is-past {
  background: color-mix(in srgb, var(--cal-surface-2) 62%, var(--cal-surface));
  color: color-mix(in srgb, var(--cal-muted) 44%, transparent);
}
.property-calendar-day-head.is-past strong {
  color: color-mix(in srgb, var(--cal-text) 38%, transparent);
}
.property-calendar-day-head.is-past.is-weekend {
  background: color-mix(in srgb, var(--cal-surface-2) 68%, var(--weekend-bg));
}
.property-calendar-day-head.is-selected {
  z-index: 2;
  color: var(--cal-text);
  background: color-mix(in srgb, var(--accent) 18%, var(--cal-surface));
  box-shadow:
    inset 2px 0 0 color-mix(in srgb, var(--accent) 74%, transparent),
    inset -2px 0 0 color-mix(in srgb, var(--accent) 74%, transparent),
    inset 0 -2px 0 color-mix(in srgb, var(--accent) 74%, transparent);
}
.property-calendar-day-head.is-selected:not(.is-range-start) {
  box-shadow:
    inset 0 -2px 0 color-mix(in srgb, var(--accent) 74%, transparent);
}
.property-calendar-day-head.is-selected.is-range-start:not(.is-range-end) {
  box-shadow:
    inset 2px 0 0 color-mix(in srgb, var(--accent) 74%, transparent),
    inset 0 -2px 0 color-mix(in srgb, var(--accent) 74%, transparent);
}
.property-calendar-day-head.is-selected.is-range-end:not(.is-range-start) {
  box-shadow:
    inset -2px 0 0 color-mix(in srgb, var(--accent) 74%, transparent),
    inset 0 -2px 0 color-mix(in srgb, var(--accent) 74%, transparent);
}
.property-calendar-day-head.is-selected strong {
  color: var(--cal-text);
}
.property-calendar-day-cell:hover {
  background: color-mix(in srgb, var(--cal-accent) 10%, transparent);
}
.property-calendar-day-cell:not(.is-past):not(.is-covered):not(.is-block-preview):not(.is-rate-view):not([data-availability="booked"]):not([data-availability="blocked"]):empty:is(:hover, :focus-visible)::after {
  inset: 50% auto auto 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 20px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--cal-accent) 32%, var(--cal-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-surface-2) 94%, transparent);
  background-image: none;
  box-shadow: 0 4px 12px color-mix(in srgb, #020617 24%, transparent);
  color: color-mix(in srgb, var(--cal-text) 84%, var(--cal-muted));
  content: "+ Add";
  font-size: 0.62rem;
  font-weight: 720;
  line-height: 1;
  opacity: 1;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.property-calendar-day-cell:focus-visible {
  outline: 1px solid color-mix(in srgb, var(--cal-accent) 72%, transparent);
  outline-offset: -2px;
}
.property-calendar-day-cell.is-selected {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  outline: 1px solid color-mix(in srgb, var(--accent) 56%, transparent);
  outline-offset: -1px;
}
.property-calendar-grid-shell[data-content-filter] {
  --calendar-fine-detail: 0 !important;
  --calendar-day-progress: 0 !important;
}
.property-calendar-day-cell.is-block-preview {
  background: color-mix(in srgb, #f87171 14%, transparent) !important;
  outline: 1px solid color-mix(in srgb, #f87171 45%, transparent);
  outline-offset: -1px;
}
.property-calendar-day-cell.is-block-preview .property-calendar-day-marker {
  opacity: 0.45;
}
/* A covered cell (a reservation chip overlays it) stays click-through so the
   chip owns the pointer — but it KEEPS its price/min-stay marker. It used to
   `visibility: hidden` them, which meant a fully-booked row showed no pricing
   at all. The marker sits in the chip's empty top gutter, so there is nothing
   to hide from. The cell's own background — including the weekend tint —
   stays visible behind the semi-transparent chip, per design: weekend depth
   must read no matter how busy the calendar gets. */
.property-calendar-day-cell.is-covered {
  pointer-events: none;
}
.property-calendar-day-cell.is-rate-view {
  pointer-events: auto;
}
.property-calendar-rate-cell {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 5px 6px;
  color: var(--cal-text);
  pointer-events: none;
}
.property-calendar-rate-cell strong {
  overflow: hidden;
  color: var(--cal-text);
  font-size: 0.76rem;
  font-weight: 780;
  font-feature-settings: "tnum";
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-rate-cell-min {
  overflow: hidden;
  color: var(--cal-muted);
  font-size: 0.6rem;
  font-weight: 620;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-rate-cell-state {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border: 1px solid color-mix(in srgb, #38bdf8 58%, var(--cal-surface));
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 0 2px color-mix(in srgb, #38bdf8 12%, transparent);
}
.property-calendar-rate-cell-state[data-state="blocked"] {
  border-color: color-mix(in srgb, #ef4444 62%, var(--cal-surface));
  background: #ef4444;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ef4444 12%, transparent);
}
.property-calendar-rate-cell.is-missing {
  color: var(--cal-muted);
}
.property-calendar-rate-cell-empty {
  color: color-mix(in srgb, var(--cal-muted) 52%, transparent);
  font-size: 0.68rem;
  line-height: 1;
}
.property-calendar-rate-row-empty {
  position: sticky;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  width: max-content;
  height: 100%;
  padding: 0 8px;
  color: color-mix(in srgb, var(--cal-muted) 80%, transparent);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.005em;
  pointer-events: none;
  white-space: nowrap;
}
.property-calendar-grid-shell[data-zoom-stage="compact"] .property-calendar-rate-cell {
  align-items: center;
  padding-inline: 3px;
  text-align: center;
}
.property-calendar-grid-shell[data-zoom-stage="compact"] .property-calendar-rate-cell-state {
  top: 4px;
  right: 4px;
}
/* The price band — ONE uniform treatment for every day cell.
   `--cal-price-band` is the reserved top strip (written per row by
   PropertyMultiCalendarGrid); the booking chip is laid out strictly below it,
   so this marker always sits in guaranteed-empty space on booked AND empty days
   alike. That is the whole fix for "everything is uneven, fonts inconsistent":
   there is no longer a big centred price on empty cells beside a tiny gutter
   price on booked ones — every cell shows the same size, weight, colour and
   position, all the prices in a row landing on one line. */
.property-calendar-day-marker {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  height: var(--cal-price-band, 16px);
  display: flex;
  align-items: center;
  padding: 0 0.25rem;
  /* Three ceilings, smallest wins: a fixed reading size (~14px), the band
     height (so `overflow: hidden` can never clip a line whose box equals its
     font-size, with line-height: 1), and a fraction of the column so a full
     "£167 · 2n" still fits at the tightest zoom. Type does NOT ride the zoom
     any more — it is one calm size everywhere (see typeScaleFor). */
  font-size: min(
    0.74rem,
    calc(var(--cal-price-band, 16px) * 0.92),
    calc(var(--day-width, 64px) * 0.21)
  );
  font-weight: 560;
  color: color-mix(in srgb, var(--cal-text) 68%, transparent);
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
}
/* Fallback for rows too short to have a usable gutter (density "tiny",
   where chips are logo-only anyway). The price floats over the chip in a
   frosted pill. `z-index: 3` is load-bearing: `.property-calendar-res-layer`
   and its chips are z-index:auto, and the chip's own `backdrop-filter` would
   otherwise blur this pill into mush behind it. */
.property-calendar-day-marker.is-float {
  top: 50%;
  left: 50%;
  right: auto;
  height: auto;
  z-index: 3;
  transform: translate(-50%, -50%);
  padding: 1px 4px;
  font-size: 0.55rem;
  border-radius: 999px;
  color: var(--cal-text);
  background: color-mix(in srgb, var(--cal-surface) 84%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cal-line) 45%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* Reservation chips */
.property-calendar-res-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Reservation chips keep a restrained channel tint. The previous correction
   removed the saturated solid fills but went too far and turned the schedule
   into one grey field. A shallow wash plus a clearer leading rail preserves
   provenance without making every booking compete for attention. */
.property-calendar-res-chip {
  --res-tint: var(--cal-accent);
  position: absolute;
  pointer-events: auto;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--res-tint) 38%, var(--cal-line-strong));
  border-left: 3px solid color-mix(in srgb, var(--res-tint) 82%, transparent);
  border-radius: 5px;
  padding: 0 0.55rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: default;
  text-align: left;
  /* Rides the zoom — see `typeScaleFor` in PropertyMultiCalendarGrid.tsx. */
  font-size: calc(0.72rem * var(--cal-type-scale, 1));
  font-weight: 600;
  color: var(--cal-text, #f8fafc);
  text-shadow: none;
  background: color-mix(in srgb, var(--res-tint) 14%, var(--cal-surface));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  white-space: nowrap;
  /* Promote the chip to its own GPU compositor layer so scrolling /
     hovering doesn't repaint the calendar grid behind it. We
     deliberately don't use `contain: paint` here — it would clip the
     hover popover (which lives inside the chip but renders outside
     its bounds via `position: absolute; top: 100%`) and the popover
     would silently never appear. `will-change` still promotes the
     chip to its own compositor layer for the scrolling perf win. */
  will-change: transform;
  /* `overflow: hidden` would clip the absolutely-positioned hover popover.
     We instead clip the long guest name on the inner span and let the chip
     itself stay visually flat — the chip's children are all sized so they
     can't spill outside its bounds. */
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.16s ease,
    background 0.16s ease, border-color 0.16s ease;
}
.property-calendar-res-chip-select {
  align-self: stretch;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0 0 0.55rem;
  display: flex;
  align-items: center;
  gap: inherit;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
}
.property-calendar-res-chip-select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: -2px;
}
.property-calendar-res-chip:hover {
  background: color-mix(in srgb, var(--res-tint) 12%, var(--cal-surface));
  border-color: color-mix(in srgb, var(--res-tint) 38%, var(--cal-line-strong));
  filter: none;
  transform: none;
  box-shadow: none;
  /* Lift above sibling chips and the sticky header so the popover (z=40)
     and the chip itself land cleanly on top of every other layer. */
  z-index: 35;
}
.property-calendar-res-chip[data-channel*="airbnb"] {
  --res-tint: #ff385c;
}
.property-calendar-res-chip[data-channel*="booking"] {
  --res-tint: #2681ff;
}
.property-calendar-res-chip[data-channel*="vrbo"] {
  --res-tint: #3b82f6;
}
.property-calendar-res-chip[data-channel*="expedia"] {
  --res-tint: #f59e0b;
}
.property-calendar-res-chip[data-channel*="direct"],
.property-calendar-res-chip[data-channel*="uos"],
.property-calendar-res-chip[data-channel*="upgraded"] {
  --res-tint: #14b8a6;
}
.property-calendar-res-cluster[data-conflict="true"] {
  z-index: 5;
}
.property-calendar-res-cluster:hover {
  z-index: 35;
}
.property-calendar-res-cluster:has(:focus-visible) {
  z-index: 35;
}
.property-calendar-grid-shell.has-context-reservations
  .property-calendar-res-chip:not(.is-selected) {
  opacity: 0.62;
}
.property-calendar-grid-shell.has-context-reservations
  .property-calendar-res-chip:hover {
  opacity: 1;
}
.property-calendar-grid-shell.has-context-reservations
  .property-calendar-res-chip:has(:focus-visible) {
  opacity: 1;
}
/* Status treatments remain quiet unless the stay needs attention. */
.property-calendar-res-chip[data-status="cancelled"] {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.06) 6px,
      transparent 6px,
      transparent 12px
    ),
    color-mix(in srgb, var(--cal-text) 3%, var(--cal-surface));
  text-decoration: line-through;
  opacity: 0.7;
}
.property-calendar-res-chip[data-status="blocked"] {
  /* Owner / blocked nights: opposite-direction stripe + neutral slate so
     blocked time can never be confused with a real booking, regardless
     of what channel string upstream attached to it. */
  --res-tint: var(--status-blocked);
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.08) 6px,
      transparent 6px,
      transparent 12px
    ),
    color-mix(in srgb, var(--status-blocked) 7%, var(--cal-surface));
}
.property-calendar-res-chip[data-status="pending"] {
  --res-tint: var(--state-warning);
  border-color: color-mix(in srgb, var(--state-warning) 34%, var(--cal-line-strong));
  border-left-color: color-mix(in srgb, var(--state-warning) 68%, transparent);
  border-left-style: dashed;
  background: color-mix(in srgb, var(--state-warning) 8%, var(--cal-surface));
  opacity: 0.92;
}
/* Overlap-tail continuation (owners view): the chip is only the uncovered
   TAIL of a stay whose check-in sits under the previous chip. Same liquid
   glass, dialled to roughly a third strength — ghosted sheen + tint wash —
   with the whole outline dashed, so it reads as "the rest of an overlapped
   stay emerging from under the chip before it", never a fresh booking.
   Hover re-solidifies it to full glass for inspection (the hover card
   carries the stay's true full dates). */
.property-calendar-res-chip[data-overlap-tail="true"] {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--res-tint) 20%, rgba(255, 255, 255, 0.12));
  border-left: 3px dashed color-mix(in srgb, var(--res-tint) 45%, transparent);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0.01) 100%
    ),
    color-mix(in srgb, var(--res-tint) 4%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0.85;
}
/* The [data-overlap-tail] selector outweighs the base interaction rules, so
   its materialised state must be restated explicitly. Keep pointer hover
   separate from :has() so an older browser still retains the hover path. */
.property-calendar-res-chip[data-overlap-tail="true"]:hover {
  opacity: 1;
  border-style: solid;
  border-color: color-mix(in srgb, var(--res-tint) 40%, rgba(255, 255, 255, 0.28));
  border-left: 3px solid color-mix(in srgb, var(--res-tint) 75%, transparent);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.22) 0%,
      rgba(255, 255, 255, 0.06) 100%
    ),
    color-mix(in srgb, var(--res-tint) 18%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 8px 20px -10px rgba(0, 0, 0, 0.5);
}
.property-calendar-res-chip.is-selected {
  outline: 2px solid color-mix(in srgb, var(--accent) 74%, transparent);
  outline-offset: -2px;
  filter: none;
}
/* Conflict state — two or more live (confirmed/pending) bookings overlap
   the same dates on this property. The chip gets a hot-coral ring, an
   amber-red glow, and a small ! badge in the chip body. Channel provenance
   stays available in the mark and hover. The cluster wrapper carries the
   same data-attribute so its surrounding stack / overflow bubbles can
   adopt the conflict styling consistently. */
.property-calendar-res-chip[data-conflict="true"] {
  border-color: #ef4444;
  /* Tighter conflict ring — a sharper 1px outline + a small 8px halo,
     no more 18-26px outward bloom (which made the chip *feel* taller
     even though its layout box was unchanged). The pulse animation
     keeps the operator's eye on it without enlarging the visual
     footprint. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(239, 68, 68, 0.65),
    0 0 8px -1px rgba(239, 68, 68, 0.45),
    0 4px 14px -10px rgba(0, 0, 0, 0.4);
  animation: propertyCalendarResConflictPulse 1.8s ease-in-out infinite;
}
.property-calendar-res-chip[data-conflict="true"]:hover,
.property-calendar-res-chip[data-conflict="true"]:focus-visible {
  border-color: #f87171;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(248, 113, 113, 0.85),
    0 0 12px -1px rgba(248, 113, 113, 0.55),
    0 8px 20px -10px rgba(0, 0, 0, 0.5);
}
@keyframes propertyCalendarResConflictPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      inset 0 -1px 0 rgba(0, 0, 0, 0.18),
      0 0 0 1px rgba(239, 68, 68, 0.55),
      0 0 8px -1px rgba(239, 68, 68, 0.4),
      0 4px 14px -10px rgba(0, 0, 0, 0.4);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      inset 0 -1px 0 rgba(0, 0, 0, 0.18),
      0 0 0 1px rgba(239, 68, 68, 0.85),
      0 0 12px -1px rgba(239, 68, 68, 0.65),
      0 4px 14px -10px rgba(0, 0, 0, 0.4);
  }
}
/* Inline ! warning badge inside the chip body — small circular red dot
   that sits in the same row as the channel logo / guest name / nights. */
.property-calendar-res-chip-warn {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: none;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.18),
    0 0 8px -1px rgba(239, 68, 68, 0.7);
  margin-right: 0.05rem;
}
/* Linked-task bubble. Sits to the right of the conflict warning
   when both are present (the !important conflict still wins
   visually). Hover the bubble to reveal a popover listing the
   non-closed tasks linked to the reservation via task_relations. */
.property-calendar-res-chip-tasks {
  flex: 0 0 auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 18px;
}
.property-calendar-res-chip-tasks-badge {
  height: 18px;
  min-width: 22px;
  padding: 0 4px;
  gap: 3px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 34%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--state-warning) 12%, var(--cal-surface));
  color: var(--state-warning);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-shadow: none;
  box-shadow: none;
  cursor: pointer;
}
.property-calendar-res-chip-tasks-pop {
  /* Anchored to the chip's own bubble — this popover sits inside
     the chip but renders outside its bounds; the chip already has
     no overflow:hidden so this works the same way the reservation
     hover card does. */
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 240px;
  max-width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 1px;
  text-shadow: none;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 500;
  /* Tiny invisible bridge so the cursor can leave the badge and
     enter the popover without :hover ever flickering off. */
  margin-top: -2px;
}
.property-calendar-res-chip-tasks:hover .property-calendar-res-chip-tasks-pop,
.property-calendar-res-chip-tasks:focus-within .property-calendar-res-chip-tasks-pop,
.property-calendar-res-chip-tasks.is-open .property-calendar-res-chip-tasks-pop,
.property-calendar-res-chip-tasks-pop.is-open {
  display: flex;
}
.property-calendar-res-chip.has-task-menu > .property-calendar-res-hover {
  display: none;
}
.property-calendar-res-chip-tasks-pop-head {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 4px 8px 2px;
}
.property-calendar-res-chip-tasks-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font: inherit;
  color: var(--text-soft);
  cursor: pointer;
  text-align: left;
}
.property-calendar-res-chip-tasks-row:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.property-calendar-res-chip-tasks-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.property-calendar-res-chip-tasks-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.property-calendar-res-chip-tasks-meta {
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-res-chip-tasks-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-res-chip-tasks-status {
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: var(--text-muted);
  display: inline-flex;
  align-items: center;
}
.property-calendar-res-chip-tasks-assignees {
  flex-shrink: 0;
}
.property-calendar-res-chip-tasks-more {
  padding: 2px 8px 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Conflict line in the hover popover. Red wash background, white !
   marker, and an explanatory message. Sits directly under the title
   row so it's the FIRST thing the user reads after opening hover. */
.property-calendar-res-hover-conflict {
  display: block !important;
  margin: 0.1rem 0 0.15rem;
  padding: 0.32rem 0.5rem;
  border-radius: 7px;
  background: color-mix(in srgb, #ef4444 18%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 55%, transparent);
  color: #fee2e2;
}
.property-calendar-res-hover-conflict-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
}
.property-calendar-res-hover-conflict-head > span:first-child {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.property-calendar-res-hover-conflict-list {
  list-style: none;
  margin: 0.32rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}
.property-calendar-res-hover-conflict-row {
  appearance: none;
  background: color-mix(in srgb, #ef4444 8%, transparent);
  border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
  border-radius: 5px;
  padding: 0.28rem 0.42rem;
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.property-calendar-res-hover-conflict-row:hover {
  background: color-mix(in srgb, #ef4444 16%, transparent);
  border-color: color-mix(in srgb, #ef4444 55%, transparent);
}
.property-calendar-res-hover-conflict-row-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fee2e2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}
.property-calendar-res-hover-conflict-row-meta {
  font-size: 0.66rem;
  color: color-mix(in srgb, #fee2e2 80%, transparent);
  white-space: nowrap;
  flex: 0 0 auto;
}
.property-calendar-res-hover-conflict-more {
  list-style: none;
  font-size: 0.66rem;
  color: color-mix(in srgb, #fee2e2 70%, transparent);
  text-align: center;
  padding: 0.18rem 0;
}
@media (prefers-color-scheme: light) {
  .property-calendar-res-hover-conflict,
  .property-calendar-res-hover-conflict-row-name {
    color: #7f1d1d;
  }
  .property-calendar-res-hover-conflict-row-meta,
  .property-calendar-res-hover-conflict-more {
    color: color-mix(in srgb, #7f1d1d 80%, transparent);
  }}
/* Channel is quiet provenance, but still recognisable. */
.property-calendar-res-chip-channel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* The logo grows with the type so a zoomed-in chip stays proportionate
     instead of a big name beside a stamp-sized badge. Clamped at 16px so it
     never drops below the project's minimum icon size when zoomed out. */
  width: max(16px, calc(18px * var(--cal-type-scale, 1)));
  height: max(16px, calc(18px * var(--cal-type-scale, 1)));
  border-radius: 50%;
  background: transparent;
  color: inherit;
  flex: 0 0 max(16px, calc(18px * var(--cal-type-scale, 1)));
  overflow: visible;
  font-size: calc(0.58rem * var(--cal-type-scale, 1));
  font-weight: 700;
  letter-spacing: 0.04em;
  filter: saturate(0.72) opacity(0.84);
  transition: filter 0.12s ease;
}
.property-calendar-res-chip:hover .property-calendar-res-chip-channel {
  filter: saturate(0.95) opacity(0.96);
}
.property-calendar-res-chip:has(:focus-visible) .property-calendar-res-chip-channel {
  filter: saturate(0.95) opacity(0.96);
}
.property-calendar-res-chip-channel .workspace-platform-logo,
.property-calendar-res-chip-channel .platform-logo-image {
  width: max(16px, calc(18px * var(--cal-type-scale, 1))) !important;
  height: max(16px, calc(18px * var(--cal-type-scale, 1))) !important;
  object-fit: contain;
  background: transparent;
  border-radius: 50%;
  display: block;
}
.property-calendar-res-chip-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.property-calendar-res-chip-meta {
  flex: 0 0 auto;
  font-size: calc(0.66rem * var(--cal-type-scale, 1));
  font-weight: 500;
  opacity: 0.85;
}
.property-calendar-grid-shell[data-content-filter="overview"]
  .property-calendar-res-chip-meta {
  display: none;
}
/* Tiny: chip is < 36 px tall — only the logo fits cleanly. We still
   keep the wrapper at 16 px so the brand badge stays a recognizable
   round button rather than a faint pinprick. */
/* 🔴 These density rules out-specify `.property-calendar-res-chip`, so they
   have to carry the zoom scale too — otherwise the base rule scales and the
   density override silently pins the size back. Measured 2026-07-23: the chip
   read 11.2px at every zoom level because `[data-density="compact"]` was
   winning with a flat 0.7rem. */
.property-calendar-res-chip[data-density="tiny"] {
  padding: 0 0.35rem 0 0;
  font-size: calc(0.66rem * var(--cal-type-scale, 1));
  gap: 0.3rem;
}
.property-calendar-res-chip[data-density="tiny"] .property-calendar-res-chip-select {
  padding-left: 0.35rem;
}
.property-calendar-res-chip[data-density="tiny"] .property-calendar-res-chip-channel {
  width: max(16px, calc(16px * var(--cal-type-scale, 1)));
  height: max(16px, calc(16px * var(--cal-type-scale, 1)));
  flex: 0 0 max(16px, calc(16px * var(--cal-type-scale, 1)));
}
.property-calendar-res-chip[data-density="tiny"] .property-calendar-res-chip-channel .platform-logo-image {
  width: max(16px, calc(16px * var(--cal-type-scale, 1))) !important;
  height: max(16px, calc(16px * var(--cal-type-scale, 1))) !important;
}
/* Compact: chip is 36–64 px tall (e.g. minimal calendar mode). The
   guest name still shows but at a tighter scale; logo stays full-size
   so the brand badge reads cleanly. */
.property-calendar-res-chip[data-density="compact"] {
  padding: 0 0.45rem 0 0;
  font-size: calc(0.7rem * var(--cal-type-scale, 1));
  gap: 0.45rem;
}
.property-calendar-res-chip[data-density="compact"] .property-calendar-res-chip-select {
  padding-left: 0.45rem;
}
.property-calendar-res-chip[data-density="compact"] .property-calendar-res-chip-channel {
  width: max(16px, calc(18px * var(--cal-type-scale, 1)));
  height: max(16px, calc(18px * var(--cal-type-scale, 1)));
  flex: 0 0 max(16px, calc(18px * var(--cal-type-scale, 1)));
}
.property-calendar-res-chip[data-density="compact"] .property-calendar-res-chip-channel .platform-logo-image {
  width: max(16px, calc(18px * var(--cal-type-scale, 1))) !important;
  height: max(16px, calc(18px * var(--cal-type-scale, 1))) !important;
}

/* Hover popover — the outer element normally sits beneath the chip and uses
   padding as an invisible hover bridge. Reservation chips measure the visible
   calendar viewport on entry: rows near the bottom flip the card above, while
   long money waterfalls get a bounded, scrollable inner surface instead of
   being cut off by the grid's required overflow/paint containment.

   Anchor X tracks the cursor: `--res-hover-x` is updated by the chip handlers.
   `translateX(-12px)` keeps the content just left of the pointer hotspot. */
.property-calendar-res-hover {
  position: absolute;
  top: 100%;
  left: var(--res-hover-x, 0px);
  transform: translateX(-12px);
  display: none;
  z-index: 40;
  padding-top: 8px;
  pointer-events: auto;
  white-space: normal;
  max-width: min(320px, calc(100vw - 32px));
}
.property-calendar-res-chip > .property-calendar-res-hover:not(.property-calendar-res-hover--stack),
.property-calendar-task-chip > .property-calendar-res-hover:not(.property-calendar-res-hover--stack) {
  width: var(--res-hover-width, min(320px, calc(100vw - 32px)));
}
.property-calendar-res-chip[data-hover-side="above"] > .property-calendar-res-hover:not(.property-calendar-res-hover--stack),
.property-calendar-task-chip[data-hover-side="above"] > .property-calendar-res-hover:not(.property-calendar-res-hover--stack) {
  top: auto;
  bottom: 100%;
  padding-top: 0;
  padding-bottom: 8px;
}
.property-calendar-res-hover-inner {
  box-sizing: border-box;
  min-width: min(240px, 100%);
  max-height: var(--res-hover-max-h, calc(100vh - 32px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--cal-line-strong) transparent;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--cal-line-strong);
  border-radius: 10px;
  /* A detail card must fully occlude the schedule beneath it. The calendar
     canvas uses translucent layers elsewhere, but carrying that treatment
     into a reading surface makes bars and grid lines show through the copy. */
  background: var(--bg-elevated, #17171a);
  color: var(--cal-text);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 0.35rem;
  font-weight: 500;
  opacity: 1;
}
.property-calendar-res-chip:hover .property-calendar-res-hover,
.property-calendar-res-chip .property-calendar-res-hover:hover,
.property-calendar-res-chip .property-calendar-res-hover:focus-within,
/* Task chips share the .property-calendar-res-hover element (so we
   reuse the panel chrome, popover positioning, and stack variant)
   but they're not reservation chips — without these rules the
   default `display: none` from .property-calendar-res-hover wins
   and the task hover card never appears. */
.property-calendar-task-chip:hover .property-calendar-res-hover,
.property-calendar-task-chip:focus-visible .property-calendar-res-hover,
.property-calendar-task-chip .property-calendar-res-hover:hover,
.property-calendar-task-chip .property-calendar-res-hover:focus-within,
.property-calendar-res-stack-item--task:hover .property-calendar-res-hover,
.property-calendar-res-stack-item--task:focus-visible .property-calendar-res-hover,
/* Unassigned-lane chips (tasks + events). Their card is the NEXT SIBLING,
   not a child — the chip clips its own overflow (see the chip rule) so a
   nested card would be trapped inside a ~20px box. The card's own
   `padding-top` is the hover bridge across the gap. */
.property-calendar-unassigned-chip:hover + .property-calendar-unassigned-hover,
.property-calendar-unassigned-chip:focus-visible + .property-calendar-unassigned-hover,
.property-calendar-unassigned-hover:hover,
.property-calendar-unassigned-hover:focus-within {
  display: block;
}
.property-calendar-res-chip:not(.has-task-menu):has(:focus-visible)
  > .property-calendar-res-hover,
.property-calendar-task-chip:has(:focus-visible) .property-calendar-res-hover {
  display: block;
}

/* ── Block strip ──────────────────────────────────────────────────────────── */
.property-calendar-block-strip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.55rem;
  border-radius: 5px;
  background: color-mix(in srgb, var(--status-blocked) 8%, var(--cal-surface));
  border: 1px dashed color-mix(in srgb, var(--status-blocked) 36%, var(--cal-line));
  border-left: 3px solid color-mix(in srgb, var(--status-blocked) 58%, transparent);
  overflow: visible;
  cursor: default;
  box-sizing: border-box;
  /* Availability is supporting context. A real stay or dated job must remain
     visible and clickable wherever their spans intersect this strip. */
  z-index: 2;
  pointer-events: auto;
}
.property-calendar-block-strip-icon { color: var(--cal-muted); flex-shrink: 0; opacity: 0.85; }
.property-calendar-block-strip-label { font-size: 0.68rem; font-weight: 680; color: var(--cal-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.01em; min-width: 0; flex: 1; }

.property-calendar-block-hover {
  position: fixed;
  z-index: 12000;
  pointer-events: none;
  white-space: normal;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
}
.property-calendar-block-hover[data-hover-side="above"] {
  transform: translateY(-100%);
}
.property-calendar-block-hover-inner {
  background: var(--cal-surface-3);
  border: 1px solid var(--cal-line-strong);
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(0,0,0,0.55);
  overflow: hidden;
  display: grid;
  max-height: var(--res-hover-max-h, calc(100vh - 32px));
  overflow-y: auto;
}
.property-calendar-block-hover-title {
  font-size: 0.8rem; font-weight: 700; color: var(--cal-text);
  padding: 0.5rem 0.75rem 0.35rem;
  border-bottom: 1px solid var(--cal-line-strong);
}
.property-calendar-block-hover-dates {
  font-size: 0.75rem; color: var(--cal-text); opacity: 0.8;
  padding: 0.35rem 0.75rem;
}
.property-calendar-block-hover-nights { opacity: 0.55; }
.property-calendar-block-hover-note {
  font-size: 0.75rem; color: var(--cal-text); opacity: 0.65;
  padding: 0.2rem 0.75rem 0.45rem;
  border-top: 1px solid var(--cal-line-strong);
}
/* Provenance lines under the note: who blocked it, and the check-out that
   caused it when it is a turnover buffer. Quieter than the note — the note is
   the person's own words, these are just facts. (2026-07-26.) */
.property-calendar-block-hover-meta {
  font-size: 0.72rem; color: var(--cal-text); opacity: 0.5;
  padding: 0 0.75rem 0.35rem;
}
.property-calendar-block-hover-meta:first-of-type {
  padding-top: 0.3rem;
}

/* Stack-item variant. The overflow list lives at the chip's top-right
   corner, so the popover anchors to the LEFT of the list (`right:
   100%`) rather than below the item — that keeps the popover from
   colliding with the list itself and prevents it from sliding off the
   right edge of the calendar pane. The `.property-calendar-res-hover`
   base rules apply (z=40, padding-bridge for the cursor handoff). */
.property-calendar-res-hover.property-calendar-res-hover--stack {
  top: 0;
  left: auto;
  right: calc(100% + 8px);
  transform: none;
  padding-top: 0;
  /* Replace the top-side bridge with a right-side one so the cursor
     can travel from the stack item leftwards into the popover without
     :hover flickering off mid-air. */
  padding-right: 8px;
}
.property-calendar-res-stack-item:hover > .property-calendar-res-hover--stack,
.property-calendar-res-stack-item:focus-visible > .property-calendar-res-hover--stack,
.property-calendar-res-stack-item > .property-calendar-res-hover--stack:hover,
.property-calendar-res-stack-item > .property-calendar-res-hover--stack:focus-within {
  display: block;
}
.property-calendar-res-hover p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--cal-text);
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}
.property-calendar-res-hover-head {
  align-items: center;
  font-size: 0.82rem;
}
.property-calendar-res-hover-head strong {
  font-size: 0.88rem;
  font-weight: 700;
}
.property-calendar-res-hover-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--status-confirmed-soft);
  color: var(--status-confirmed);
}
.property-calendar-res-hover-pill[data-status="pending"] {
  background: var(--status-pending-soft);
  color: var(--status-pending);
}
.property-calendar-res-hover-pill[data-status="cancelled"] {
  background: var(--status-cancelled-soft);
  color: var(--status-cancelled);
}
.property-calendar-res-hover-pill[data-status="blocked"] {
  background: var(--status-blocked-soft);
  color: var(--status-blocked);
}
.property-calendar-res-hover-pill[data-status="neutral"] {
  background: var(--status-neutral-soft);
  color: var(--status-neutral);
}

/* Pricing panel (right pane when empty day selected) */
.property-calendar-pricing-panel {
  display: grid;
  gap: 0.7rem;
}
.property-calendar-pricing-head {
  display: grid;
  gap: 0.2rem;
}
.property-calendar-pricing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* Complete date detail for the rebuilt Calendar. Pane 4 is a plain readable
   record: time, object, property, status and owner stay visible on every row. */
.property-calendar-day-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  color: var(--text-primary);
  background: var(--bg-base);
}
.property-calendar-day-panel-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 0.62rem;
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-elevated) 96%, transparent);
  backdrop-filter: blur(12px);
}
.property-calendar-day-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.property-calendar-day-panel-head > span:nth-child(2) {
  display: grid;
  gap: 0.13rem;
  min-width: 0;
}
.property-calendar-day-panel-head small {
  color: var(--accent);
  font-size: 0.61rem;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.property-calendar-day-panel-head strong {
  font-size: 0.79rem;
  line-height: 1.3;
}
.property-calendar-day-panel-head > span > span {
  color: var(--text-muted);
  font-size: 0.66rem;
}
.property-calendar-day-panel-head > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
}
.property-calendar-day-panel-scroll {
  display: grid;
  align-content: start;
  gap: 0.72rem;
  min-height: 0;
  padding: 0.75rem;
}
.property-calendar-day-detail-group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.property-calendar-day-detail-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 34px;
  padding: 0 0.68rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-soft);
  background: color-mix(in srgb, var(--bg-deep) 68%, transparent);
}
.property-calendar-day-detail-group > header strong {
  font-size: 0.66rem;
  font-weight: 810;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.property-calendar-day-detail-group > header span {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  font-size: 0.61rem;
  font-weight: 780;
  text-align: center;
}
.property-calendar-day-detail-row {
  display: grid;
  grid-template-columns: 48px 8px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 0.52rem;
  width: 100%;
  min-height: 64px;
  padding: 0.58rem 0.66rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 75%, transparent);
  border-radius: 0;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
}
.property-calendar-day-detail-row:last-child {
  border-bottom: 0;
}
.property-calendar-day-detail-row:not(:disabled) {
  cursor: pointer;
}
.property-calendar-day-detail-row:not(:disabled):hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.property-calendar-day-detail-row:disabled {
  opacity: 1;
}
.property-calendar-day-detail-time {
  color: var(--text-muted);
  font-size: 0.63rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.property-calendar-day-detail-mark {
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 74%, var(--text-muted));
}
.property-calendar-day-detail-row[data-kind="arrival"] .property-calendar-day-detail-mark {
  background: var(--success);
}
.property-calendar-day-detail-row[data-kind="departure"] .property-calendar-day-detail-mark {
  background: var(--danger);
}
.property-calendar-day-detail-row[data-kind="block"] .property-calendar-day-detail-mark {
  background: var(--text-muted);
}
.property-calendar-day-detail-copy {
  display: grid;
  gap: 0.13rem;
  min-width: 0;
}
.property-calendar-day-detail-kicker {
  color: var(--text-muted);
  font-size: 0.57rem;
  font-weight: 790;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.property-calendar-day-detail-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.75rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-day-detail-copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.64rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-day-rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 58px;
  padding: 0.58rem 0.68rem;
  border-bottom: 1px solid var(--border-subtle);
}
.property-calendar-day-rate-row:last-child {
  border-bottom: 0;
}
.property-calendar-day-rate-row > span {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}
.property-calendar-day-rate-row > span strong {
  overflow: hidden;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-day-rate-row small {
  color: var(--text-muted);
  font-size: 0.62rem;
}
.property-calendar-day-rate-row > strong {
  color: var(--text-primary);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.property-calendar-day-panel-state {
  padding: 1.4rem 0.8rem;
  border: 1px dashed var(--border-subtle);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}
.property-calendar-day-panel-state.is-error {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border-subtle));
}
.property-calendar-staff-day-details {
  display: grid;
  gap: 0.72rem;
}
.property-calendar-staff-day-group > header > span:first-child {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.property-calendar-staff-day-group > header > span:first-child small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.61rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-staff-day-group
  > header
  > .property-calendar-staff-uncovered {
  color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 13%, transparent);
  white-space: nowrap;
}
.property-calendar-staff-day-person,
.property-calendar-staff-day-open {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.58rem;
  min-height: 54px;
  padding: 0.5rem 0.68rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 75%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: default;
}
.property-calendar-staff-day-person:last-child {
  border-bottom: 0;
}
.property-calendar-staff-day-open:hover,
.property-calendar-staff-day-open:focus-visible {
  background: color-mix(in srgb, #14b8a6 8%, transparent);
  outline: 0;
}
.property-calendar-staff-day-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, #14b8a6 36%, var(--border-subtle));
  border-radius: 999px;
  background-color: color-mix(in srgb, #14b8a6 12%, var(--bg-deep));
  background-position: center;
  background-size: cover;
  color: var(--text-soft);
  font-size: 0.58rem;
  font-weight: 800;
}
.property-calendar-staff-day-person > span:nth-child(2),
.property-calendar-staff-day-open > span {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}
.property-calendar-staff-day-person strong,
.property-calendar-staff-day-open strong {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-staff-day-person small,
.property-calendar-staff-day-open small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-staff-day-add-task {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 30px;
  padding: 0.34rem 0.5rem;
  border: 1px solid color-mix(in srgb, #14b8a6 32%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, #14b8a6 8%, transparent);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.property-calendar-staff-day-add-task:hover,
.property-calendar-staff-day-add-task:focus-visible {
  border-color: color-mix(in srgb, #14b8a6 65%, var(--border-subtle));
  background: color-mix(in srgb, #14b8a6 14%, transparent);
  color: var(--text-primary);
  outline: 0;
}
.property-calendar-staff-day-open {
  grid-template-columns: minmax(0, 1fr) 16px;
  min-height: 58px;
  border: 1px solid color-mix(in srgb, #14b8a6 30%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, #14b8a6 6%, var(--bg-elevated));
  cursor: pointer;
}

/* ── Block dates panel ─────────────────────────────────────── */
.cal-block-panel { display:flex; flex-direction:column; height:100%; width:100%; min-width:0; box-sizing:border-box; overflow-x:hidden; container-type:inline-size; }
.cal-block-panel * { box-sizing:border-box; min-width:0; }
@container (max-width: 280px) {
  .cal-block-range-arrow { display:none; }
  .cal-block-section { padding:0.75rem 0.65rem 0; }
  .cal-block-head { padding:0.85rem 0.65rem 0.65rem; }
  .cal-block-footer { padding:0.75rem 0.65rem; }}
.cal-block-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.75rem; height:100%; opacity:0.45; padding:2rem; text-align:center; }
.cal-block-empty-icon { opacity:0.6; }
.cal-block-empty-text { font-size:0.82rem; color:var(--text-soft); }

.cal-block-head { display:flex; align-items:center; gap:0.75rem; padding:1rem 1rem 0.75rem; border-bottom:1px solid var(--border-subtle); }
.cal-block-head > div:not(.cal-block-head-icon) { min-width:0; flex:1; }
.cal-block-head-title, .cal-block-head-sub { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cal-block-head-icon { width:2rem; height:2rem; border-radius:8px; background:color-mix(in srgb,var(--ring) 12%,var(--surface-muted)); display:flex; align-items:center; justify-content:center; color:var(--ring); flex-shrink:0; }
.cal-block-head-title { font-size:0.88rem; font-weight:700; color:var(--text-primary); line-height:1.2; }
.cal-block-head-sub { font-size:0.72rem; color:var(--text-soft); margin-top:0.1rem; }

.cal-block-section { padding:0.85rem 1rem 0; }
.cal-block-section-label { font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; color:var(--text-muted); margin-bottom:0.55rem; }
.cal-block-optional { font-weight:400; text-transform:none; letter-spacing:0; opacity:0.6; font-size:0.68rem; }

.cal-block-ranges { display:flex; flex-direction:column; gap:0.5rem; }
.cal-block-range-row { background:var(--bg-elevated); border:1px solid var(--border-subtle); border-radius:10px; padding:0.65rem 0.7rem; position:relative; }
.cal-block-range-inputs { display:flex; align-items:flex-end; gap:0.4rem; flex-wrap:wrap; }
.cal-block-date-wrap { display:flex; flex-direction:column; gap:0.2rem; flex:1 1 7.5rem; min-width:7.5rem; }
.cal-block-date-lbl { font-size:0.65rem; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.05em; }
.cal-block-date-input { font-size:0.78rem !important; padding:0.3rem 0.45rem !important; width:100%; min-width:0; }
.cal-block-range-arrow { font-size:0.75rem; color:var(--text-muted); padding-bottom:0.35rem; flex-shrink:0; }
.cal-block-range-meta { display:flex; align-items:center; gap:0.5rem; margin-top:0.45rem; flex-wrap:wrap; }
.cal-block-range-nights { font-size:0.72rem; font-weight:700; color:var(--text-primary); background:color-mix(in srgb,var(--ring) 10%,var(--surface-muted)); border-radius:5px; padding:0.1rem 0.4rem; }
.cal-block-range-dates { font-size:0.72rem; color:var(--text-soft); }
.cal-block-rm { position:absolute; top:0.45rem; right:0.5rem; width:1.2rem; height:1.2rem; border-radius:50%; background:transparent; border:none; color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; opacity:0.6; }
.cal-block-rm:hover { opacity:1; background:var(--surface-muted); }

.cal-block-add-range { display:inline-flex; align-items:center; gap:0.25rem; margin-top:0.5rem; font-size:0.76rem; font-weight:600; color:var(--ring); background:transparent; border:none; cursor:pointer; padding:0; opacity:0.8; }
.cal-block-add-range:hover { opacity:1; }

.cal-block-reason-chips { display:flex; flex-wrap:wrap; gap:0.4rem; }
.cal-block-chip { padding:0.28rem 0.7rem; border-radius:20px; font-size:0.76rem; font-weight:600; border:1px solid var(--border-subtle); background:var(--surface-muted); color:var(--text-muted); cursor:pointer; transition:all 0.15s; }
.cal-block-chip:hover { border-color:color-mix(in srgb,var(--ring) 40%,var(--border-subtle)); color:var(--text-primary); }
.cal-block-chip.is-sel { background:color-mix(in srgb,var(--ring) 12%,var(--surface-muted)); border-color:color-mix(in srgb,var(--ring) 55%,var(--border-subtle)); color:var(--ring); }
.cal-block-reason-input { margin-top:0.5rem; width:100%; font-size:0.8rem !important; }
.cal-block-note { width:100%; resize:none; font-size:0.8rem !important; line-height:1.5; }

.cal-block-footer { margin-top:auto; padding:0.85rem 1rem; border-top:1px solid var(--border-subtle); display:flex; flex-direction:column; gap:0.5rem; }
.cal-block-summary { font-size:0.76rem; color:var(--text-soft); }
.cal-block-summary-count { font-weight:700; color:var(--text-primary); }
.cal-block-summary-ranges { color:var(--text-soft); }
.cal-block-summary-reason { color:var(--text-soft); }
.cal-block-error { font-size:0.75rem; color:#f87171; }
.cal-block-footer-actions { display:flex; gap:0.5rem; }
.cal-block-delete-link { background:transparent; border:none; color:#f87171; font-size:0.78rem; font-weight:600; cursor:pointer; padding:0; opacity:0.85; }
.cal-block-delete-link:hover { opacity:1; text-decoration:underline; }
.cal-block-delete-link:disabled { opacity:0.4; cursor:default; }
.btn-danger { background:#dc2626; border:1px solid #dc2626; color:#fff; }
.btn-danger:hover:not(:disabled) { background:#b91c1c; border-color:#b91c1c; }
.btn-danger:disabled { opacity:0.5; cursor:default; }
.cal-block-cancel { flex-shrink:0; font-size:0.84rem; padding:0.6rem 0.9rem; }
.cal-block-cta { flex:1; justify-content:center; font-size:0.84rem; padding:0.6rem 1rem; }

.cal-block-done { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.6rem; flex:1; padding:2rem; text-align:center; }
.cal-block-done-icon { width:3.5rem; height:3.5rem; border-radius:50%; background:color-mix(in srgb,#4ade80 12%,var(--surface-muted)); display:flex; align-items:center; justify-content:center; color:#4ade80; }
.cal-block-done-title { font-size:0.95rem; font-weight:700; color:var(--text-primary); }
.cal-block-done-sub { font-size:0.78rem; color:var(--text-soft); }
.cal-block-done-reset { margin-top:0.5rem; font-size:0.78rem; }

/* Cluster + overlap bubbles */
.property-calendar-res-cluster {
  position: absolute;
  pointer-events: auto;
  /* z-index 4 (matching resting chips) makes the RESTING cluster a stacking
     context, which is load-bearing: without it the count bubbles inside
     (.property-calendar-res-stack, z 50) rank GLOBALLY and paint over the
     sticky day header (30), the unassigned strip (29) and other chips' open
     cards as the row scrolls beneath them — the 2026-08-07 floating "1"
     bubbles. With it, the bubble's 50 only ranks against the cluster's own
     children (still above its own open card at 40, which is what the 50 is
     for), and the whole cluster is worth 4 at rest or 5 for a conflict —
     under all sticky chrome. The pointer and keyboard rules further up lift the
     cluster to 35 while it is actually in use, so its open card clears every
     resting object and the sticky chrome without latching after a click. Pinned by
     PropertyMultiCalendarGrid.task-hover-stacking.test.ts. */
  z-index: 4;
}
.property-calendar-res-stack {
  /* Anchor at the chip's top-right corner, INSIDE the row. This used to be
     -10px/-6px so the bubble "visibly juts above the chip" — fine on the
     single-property calendar, but on the multicalendar rows sit flush and the
     overhang painted the bubble on top of the ROW ABOVE's chips, reading as
     random floating numbers (Hakim, 2026-08-01: "number bubble things are
     appearing on top of the containers"). -2px keeps a hint of the badge
     overhang while staying inside the bubble's own row in every density.

     The 50 is INTERNAL: both hosts of this stack (.property-calendar-res-
     cluster and .property-calendar-block-strip) are stacking contexts, so
     this number only ranks the bubble against the host's own children —
     chiefly the bottom-anchored hover popover (z=40), which the bubble must
     stay above so the count remains reachable while an info card is
     showing. From outside, the whole stack is worth its host: 4 for a stay and
     2 for availability. A stay cluster rises to 35 only while hovered or
     keyboard focused. Availability never rises over a stay; its read-only card
     is portalled instead. Do NOT try to make this 50 beat anything outside the
     host (it cannot), and do NOT remove the hosts' z-indexes —
     an un-contexted host lets this 50 rank globally and the bubbles float
     over the sticky header and unassigned strip (2026-08-07). */
  position: absolute;
  top: -2px;
  right: 0;
  z-index: 50;
  pointer-events: auto;
}
.property-calendar-res-stack-bubbles {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: var(--cal-surface-3);
  border: 1px solid var(--cal-line-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.property-calendar-res-stack-bubble {
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  border: 1px solid var(--cal-line-strong);
  color: var(--cal-text-soft);
  background: color-mix(in srgb, var(--cal-text) 7%, var(--cal-surface));
  line-height: 1;
}
.property-calendar-res-stack-bubble[data-status="confirmed"] {
  background: color-mix(in srgb, var(--cal-text) 7%, var(--cal-surface));
}
.property-calendar-res-stack-bubble[data-status="cancelled"] {
  background: color-mix(in srgb, var(--cal-text) 5%, var(--cal-surface));
  opacity: 0.72;
}
.property-calendar-res-stack-bubble[data-status="pending"] {
  border-color: color-mix(in srgb, var(--state-warning) 36%, var(--cal-line));
  background: color-mix(in srgb, var(--state-warning) 14%, var(--cal-surface));
  color: var(--state-warning);
}
.property-calendar-res-stack-bubble[data-status="blocked"] {
  background: color-mix(in srgb, var(--status-blocked) 12%, var(--cal-surface));
}
.property-calendar-res-stack-bubble[data-status="neutral"] {
  background: color-mix(in srgb, var(--cal-text) 7%, var(--cal-surface));
}
.property-calendar-res-stack-list {
  position: absolute;
  top: -2px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 10px;
  background: var(--cal-surface-3);
  border: 1px solid var(--cal-line-strong);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
  min-width: 200px;
  /* Visible overflow so each stack-item's leftward hover popover can
     escape the list bounds. Stack lists are rarely longer than a
     handful of items so we accept the trade-off of no internal
     scrolling for tall lists in exchange for the rich hover info. */
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -8px) scale(0.92);
  transform-origin: top right;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 30;
}
.property-calendar-res-stack:hover .property-calendar-res-stack-list,
.property-calendar-res-stack:focus-within .property-calendar-res-stack-list {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  pointer-events: auto;
}
.property-calendar-res-stack:hover .property-calendar-res-stack-bubbles,
.property-calendar-res-stack:focus-within .property-calendar-res-stack-bubbles {
  opacity: 0.5;
}
.property-calendar-res-stack-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border: 0;
  border-left: 2px solid var(--cal-text-soft);
  border-radius: 6px;
  background: var(--cal-surface);
  color: var(--cal-text);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transform: translateX(8px);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}
.property-calendar-res-stack:hover .property-calendar-res-stack-item,
.property-calendar-res-stack:focus-within .property-calendar-res-stack-item {
  opacity: 1;
  transform: translateX(0);
}
.property-calendar-res-stack-item:nth-child(1) { transition-delay: 0.02s; }
.property-calendar-res-stack-item:nth-child(2) { transition-delay: 0.05s; }
.property-calendar-res-stack-item:nth-child(3) { transition-delay: 0.08s; }
.property-calendar-res-stack-item:nth-child(4) { transition-delay: 0.11s; }
.property-calendar-res-stack-item:nth-child(5) { transition-delay: 0.14s; }
.property-calendar-res-stack-item:nth-child(n+6) { transition-delay: 0.17s; }
.property-calendar-res-stack-item[data-status="confirmed"] { border-left-color: var(--cal-text-soft); }
.property-calendar-res-stack-item[data-status="cancelled"] { border-left-color: var(--cal-muted); opacity: 0.72; text-decoration: line-through; }
.property-calendar-res-stack-item[data-status="pending"] { border-left-color: #ca8a04; }
.property-calendar-res-stack-item[data-status="blocked"] { border-left-color: #475569; }
.property-calendar-res-stack-item[data-status="neutral"] { border-left-color: #6b7280; }
.property-calendar-res-stack-item:hover {
  background: color-mix(in srgb, var(--cal-accent) 16%, var(--cal-surface) 84%);
}
.property-calendar-res-stack-item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-res-stack-item-meta {
  flex: 0 0 auto;
  font-size: 0.66rem;
  color: var(--cal-muted);
}

/* Minimalist mode — applied on list scroll when calendar minimal toggle on */
/* Calendar mode forces every property card to the height of the TALLEST
   card. PropertiesListPane measures the visible cards on every layout
   change and writes the largest measured height into `--cal-card-h` on
   the list scroll element; we feed that into `min-height` here so every
   card grows to match without clipping the taller ones' content. Card
   contents are vertically centred so a short card (e.g. one with no
   subtitle) sits cleanly in the middle of the taller frame instead of
   floating at the top with empty space underneath.

   We deliberately do NOT transition `min-height`. ResizeObserver fires
   constantly while scrolling (sticky headers, hover-tooltip rendering)
   and animating min-height on every tick visibly stutters the scroll.
   The card's existing border / background transitions handle the rest.

   Other tabs (config, financials, …) deliberately skip this — they
   want cards at their natural heights. */
.workspace-list-scroll--calendar .workspace-list-card--property {
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: var(--cal-card-h, 50px);
  padding: 0.42rem 0.48rem;
  gap: 0.5rem;
  align-self: stretch;
  align-items: center;
}
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-avatar-wrap,
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-thumb,
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-avatar-fallback {
  width: 32px !important;
  height: 32px !important;
  flex: 0 0 32px;
  border-radius: 6px;
}
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-title {
  font-size: 0.8rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-row-top {
  min-width: 0;
  padding-right: 0;
  align-items: center;
}
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-subtitle,
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-meta-row,
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-actions,
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-property-actions,
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .workspace-list-property-pill,
.workspace-list-scroll--calendar
  .workspace-list-card--property
  .properties-tag-icon-btn {
  display: none !important;
}
.workspace-list-scroll--calendar-minimal .workspace-list-card--property {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 42px;
  padding: 0.3rem 0.42rem;
  gap: 0.4rem;
  /* Compact mode hides the meta rows + tag tray, so every card has
     identical structure (avatar + title + subtitle) and the same
     natural height. We disable the "tallest card" min-height rule
     here so cards (and therefore the calendar rows that key off
     them) actually shrink to the compact size — without this the
     CSS variable stays pinned at the previous full-mode max and
     locks the rows tall. */
  min-height: auto;
}
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-avatar-wrap,
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-thumb,
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-avatar-fallback {
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px;
  border-radius: 5px;
}
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-row-top {
  align-items: center;
}
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-title {
  font-size: 0.82rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-subtitle {
  font-size: 0.7rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-meta-row,
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-actions,
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-property-actions,
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .properties-tag-icon-btn {
  display: none !important;
}
/* In compact mode the pill no longer needs to anchor to the card's
   top-right corner — the body has only title + subtitle so there's no
   risk of it being lost in a centred layout. We flow it back inline
   beside the title (where the row-top is now `align-items: center`,
   set above) so the pill sits on the same baseline as the listing
   nickname and feels visually tied to it. Smaller padding/font keep it
   from dominating the compact card. */
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-property-pill {
  position: static;
  top: auto;
  right: auto;
  font-size: 0.54rem;
  padding: 0.04rem 0.32rem;
  letter-spacing: 0.03em;
}
/* Compact mode brings the pill inline, so the row-top no longer needs
   to reserve right-side space for an absolute pill. Reset to 0. */
.workspace-list-scroll--calendar-minimal .workspace-list-card--property .workspace-list-row-top {
  padding-right: 0;
}

/* Calendar mode list pane — hide scrollbar, tighten gap, shrink right padding
   so the cards finish closer to the pane edge. The 4px gap here matches
   ROW_GAP_PX inside the calendar grid so cards and rows stay aligned. */
.workspace-list-scroll--calendar {
  /* Pane 2 sits outside `.property-calendar-tab`, so mirror the calendar's
     semantic surface tokens here instead of relying on invalid scoped vars. */
  --cal-surface: var(--bg-elevated);
  --cal-surface-2: var(--bg-deep);
  --cal-surface-3: var(--bg-base);
  --cal-line: var(--border-subtle);
  --cal-line-strong: var(--border-strong);
  --cal-text: var(--text-primary);
  --cal-muted: var(--text-muted);
  scrollbar-width: none;
  scrollbar-gutter: auto;
  scroll-behavior: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  /* The Calendar axis and measured rows must stay adjacent; a shared workspace
     gap moves pane 2 after the axis has already been measured. */
  gap: 0 !important;
  padding: 0 0.35rem 0.6rem 0.45rem;
  padding-top: 0 !important;
}
.workspace-properties-list-rows {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  min-width: 0;
}
.workspace-list-scroll--calendar .workspace-properties-list-rows {
  flex: 0 0 auto;
  gap: 4px;
  padding-top: 4px;
}

/* Enabled Google/UOS calendars are ordinary resource rows. They deliberately
   live inside `.workspace-properties-list-rows` (never the sticky axis), so
   their labels and timeline rows scroll in lockstep with the listings below. */
.workspace-list-card--calendar-source {
  border-left: 2px solid
    color-mix(
      in srgb,
      var(--calendar-source-color, var(--cal-accent)) 55%,
      var(--cal-line)
    );
}
.workspace-calendar-source-avatar {
  display: grid;
  place-items: center;
  border: 1px solid
    color-mix(
      in srgb,
      var(--calendar-source-color, var(--cal-accent)) 58%,
      var(--cal-line)
    );
  background: color-mix(
    in srgb,
    var(--calendar-source-color, var(--cal-accent)) 16%,
    var(--cal-surface-2)
  );
  color: var(--calendar-source-color, var(--cal-accent));
}
.workspace-calendar-source-avatar .ui-icon {
  width: 17px;
  height: 17px;
}
.workspace-calendar-source-badge {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--cal-line) 82%, transparent);
  border-radius: 999px;
  padding: 0.08rem 0.34rem;
  color: var(--cal-muted);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1.2;
}
.property-calendar-row.is-calendar-source {
  background: color-mix(in srgb, var(--cal-surface-2) 46%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--cal-line-strong) 42%, transparent);
}
.workspace-calendar-list-axis {
  position: sticky;
  top: 0;
  z-index: 12;
  flex: 0 0 var(--cal-list-axis-h, 68px);
  height: var(--cal-list-axis-h, 68px);
  min-height: 0;
  align-self: stretch;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--cal-text);
  background: var(--cal-surface);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--cal-line-strong) 36%, transparent);
}
/* Expanded Staff rows scroll in normal flow instead of covering properties. */
.workspace-calendar-list-axis.has-expanded-staff { position: relative; }
.workspace-calendar-list-axis-month,
.workspace-calendar-list-axis-day,
.workspace-calendar-list-axis-lanes,
.workspace-calendar-list-axis-lane,
.workspace-calendar-list-axis-leading,
.workspace-calendar-list-axis-trailing {
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.workspace-calendar-list-axis-leading {
  flex: 0 0 var(--cal-list-axis-leading-h, 0px);
  height: var(--cal-list-axis-leading-h, 0px);
}
.workspace-calendar-list-axis-month {
  flex: 0 0 var(--cal-list-axis-month-h, 28px);
  height: var(--cal-list-axis-month-h, 28px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0 0.6rem;
  color: var(--cal-muted);
  font-size: 0.63rem;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.workspace-calendar-list-axis-month > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-calendar-source-toggle {
  flex: 0 0 auto;
  min-width: 24px;
  min-height: 24px;
  padding: 0 0.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cal-muted);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.workspace-calendar-source-toggle:hover {
  color: var(--cal-text);
  background: color-mix(in srgb, var(--cal-text) 6%, transparent);
}
.workspace-calendar-source-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--cal-accent) 64%, transparent);
  outline-offset: -2px;
}
.workspace-calendar-source-toggle svg {
  flex: 0 0 16px;
}
.workspace-calendar-list-axis-day {
  flex: 0 0 var(--cal-list-axis-day-h, 40px);
  height: var(--cal-list-axis-day-h, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.6rem;
  border-top: 1px solid color-mix(in srgb, var(--cal-line) 70%, transparent);
}
.workspace-calendar-list-axis-day strong {
  overflow: hidden;
  font-size: 0.73rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-calendar-list-axis-day small {
  flex: 0 0 auto;
  color: var(--cal-muted);
  font-size: 0.62rem;
  white-space: nowrap;
}
.workspace-calendar-list-axis-lanes {
  flex: 0 0 var(--cal-list-axis-lane-h, 0px);
  height: var(--cal-list-axis-lane-h, 0px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.workspace-calendar-list-axis-trailing {
  flex: 0 0 var(--cal-list-axis-trailing-h, 0px);
  height: var(--cal-list-axis-trailing-h, 0px);
}
.workspace-calendar-list-axis-lane {
  flex: 0 0 var(--cal-list-source-lane-h, 32px);
  height: var(--cal-list-source-lane-h, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.6rem;
  appearance: none;
  border: 0;
  border-top: 1px solid var(--cal-line-strong);
  background: var(--cal-surface-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.workspace-calendar-list-axis-lane-group {
  position: relative;
  flex: 0 0 var(--cal-list-source-lane-h, 32px);
  height: var(--cal-list-source-lane-h, 32px);
  min-height: 0;
  display: flex;
  align-items: stretch;
}
.workspace-calendar-list-axis-lane-group
  > .workspace-calendar-list-axis-lane {
  min-width: 0;
  flex: 1 1 auto;
  height: 100%;
  padding-right: 2.35rem;
}
.workspace-calendar-list-axis-lane-toggle {
  position: absolute;
  inset-block: 0;
  right: 0;
  width: 2.25rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--cal-line) 76%, transparent);
  background: transparent;
  color: var(--cal-muted);
  cursor: pointer;
}
.workspace-calendar-list-axis-lane-toggle:hover:not(:disabled),
.workspace-calendar-list-axis-lane-toggle:focus-visible {
  background: color-mix(in srgb, #14b8a6 13%, transparent);
  color: var(--cal-text);
  outline: 0;
}
.workspace-calendar-list-axis-lane-toggle:disabled {
  cursor: default;
  opacity: 0.5;
}
.workspace-calendar-list-axis-lane-toggle .ui-icon {
  width: 15px;
  height: 15px;
}
.workspace-calendar-list-axis-lane[data-lane-kind="staff-person"] {
  padding-left: 1.35rem;
  background: color-mix(in srgb, #14b8a6 4%, var(--cal-surface-2));
}
.workspace-calendar-list-axis-lane:hover:not(:disabled) {
  background: color-mix(
    in srgb,
    var(--cal-surface-2) 88%,
    var(--cal-text) 12%
  );
}
.workspace-calendar-list-axis-lane:focus-visible {
  outline: 2px solid var(--cal-accent);
  outline-offset: -2px;
}
.workspace-calendar-list-axis-lane:disabled {
  cursor: default;
}
.workspace-calendar-list-axis-lane span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  overflow: hidden;
  color: var(--cal-muted);
  font-size: 0.68rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-calendar-list-axis-lane i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: var(--cal-list-source-lane-color, var(--cal-accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cal-list-source-lane-color, var(--cal-accent)) 18%, transparent);
}
.workspace-calendar-list-axis-lane small {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--cal-muted);
  font-size: 0.6rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-list-pane--calendar-focus .workspace-list-toolbar-properties {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.3rem;
  padding: 0.45rem;
}
.workspace-list-pane--calendar-focus .workspace-properties-toolbar-row,
.workspace-list-pane--calendar-focus .workspace-properties-list-meta {
  grid-column: 1 / -1;
}
.workspace-list-pane--calendar-focus .workspace-properties-density-toggle,
.workspace-list-pane--calendar-focus .workspace-properties-mode-picker {
  min-width: 0;
}
.workspace-list-pane--calendar-focus .workspace-properties-density-toggle {
  padding: 0 0.45rem;
  gap: 0.35rem;
  font-size: 0.68rem;
}
.workspace-list-pane--calendar-focus
  .workspace-properties-density-toggle-knob {
  transform: scale(0.88);
  transform-origin: right center;
}
.workspace-list-pane--calendar-focus .workspace-properties-list-meta {
  min-height: 26px;
  padding: 0.18rem 0.35rem;
  font-size: 0.68rem;
}
.workspace-list-scroll--calendar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Group containers across every properties tab: render as flex columns
   with no rounded outer box, just a clear vertical guide running down the
   left edge so it's instantly obvious these listings are grouped together.
   The compact look is what we want on every tab on the properties page —
   not just calendar — so the selector targets the broader
   `.workspace-list-scroll--properties` class instead of being scoped to
   calendar mode. The header is hidden by default and floats in on hover
   so it never eats vertical space when you're working with the cards. */
.workspace-list-scroll--properties .workspace-property-selection-group,
.workspace-list-scroll--properties .workspace-property-group {
  margin: 0;
  padding: 0 0 0 0.6rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  position: relative;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}
/* The vertical accent line that runs down the left edge of every grouped
   listing block. Lives on the `::before` pseudo-element of the group so it
   doesn't disturb layout. We use a literal color (with a CSS variable
   fallback) here because the calendar accent tokens used to be scoped to
   `.property-calendar-tab`, which meant the var() resolved to nothing in
   the list pane and the line silently disappeared. The literal color is
   the source of truth — the `var(--cal-accent, …)` indirection is just
   there so theme overrides can re-tint the line in one place. */
.workspace-list-scroll--properties .workspace-property-selection-group::before,
.workspace-list-scroll--properties .workspace-property-group::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  border-radius: 2px;
  background: var(--cal-accent, #94a3b8);
  opacity: 1;
  z-index: 2;
  pointer-events: none;
}
.workspace-list-scroll--properties .workspace-property-selection-group:hover::before,
.workspace-list-scroll--properties .workspace-property-selection-group:focus-within::before,
.workspace-list-scroll--properties .workspace-property-group:hover::before,
.workspace-list-scroll--properties .workspace-property-group:focus-within::before {
  background: var(--cal-accent-active);
  width: 4px;
}
/* In-flow sticky group header. This USED to be a hover-revealed banner
   floated ABOVE the group (`bottom: calc(100% + 2px)`) plus an invisible
   36px `::after` strip extending the hover hit-box upward — both of which
   permanently overlapped the bottom of the PRECEDING card and stole its
   hovers/clicks: the banner faded in under the cursor, and (being a child
   of the group) hovering the banner kept the group's :hover alive, so the
   card underneath could never be clicked. Removed 2026-07-23. The header
   now takes its own row and sticks to the pane top while scrolling inside
   a tall group — which also replaced the JS hover-portal in
   PropertiesListPane.tsx that existed only to patch the scrolled-off case. */
.workspace-list-scroll--properties .workspace-property-selection-group-head,
.workspace-list-scroll--properties .workspace-property-group-head {
  position: sticky;
  top: var(--cal-list-axis-h, 0px);
  margin: 0;
  padding: 0.32rem 0.55rem;
  background: color-mix(in srgb, var(--cal-surface-3) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--cal-line-strong);
  border-radius: 9px;
  z-index: 6;
}
.workspace-list-scroll--properties .workspace-property-group .workspace-property-group-headbar {
  margin: 0;
}
.workspace-list-pane--calendar-focus .workspace-property-group {
  /* The outer list already supplies the canonical 4px gap before a group.
     Header + gap is therefore always 28 + 4 = 32px on the grid axis. */
  gap: 0;
}
.workspace-list-pane--calendar-focus .workspace-property-group-head {
  box-sizing: border-box;
  flex: 0 0 28px;
  height: 28px;
  min-height: 28px;
  padding: 1px 4px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--cal-surface-2) 91%, var(--cal-accent) 9%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.workspace-list-pane--calendar-focus .workspace-property-group-body {
  gap: 4px;
  padding: 0;
}
.workspace-list-pane--calendar-focus .workspace-property-group-toggle {
  min-height: 22px;
  gap: 0.25rem;
  padding: 1px 4px;
  border-radius: 5px;
  font-size: 0.72rem;
  line-height: 1;
}
.workspace-list-pane--calendar-focus .workspace-property-group-toggle-title {
  min-width: 0;
  gap: 0.25rem;
}
.workspace-list-pane--calendar-focus .workspace-property-group-toggle-title > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workspace-list-pane--calendar-focus .workspace-property-group-toggle-title .ui-icon {
  width: 12px;
  height: 12px;
}
.workspace-list-pane--calendar-focus .workspace-property-group-actions-trigger {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}
.workspace-list-scroll--properties .workspace-property-selection-group .workspace-list-card--property,
.workspace-list-scroll--properties .workspace-property-group .workspace-list-card--property,
.workspace-list-scroll--properties .workspace-property-group-stack .workspace-list-card--property {
  margin: 0;
}

/* Filter pill + dropdown */
.property-calendar-filter {
  position: relative;
  display: inline-flex;
}
.property-calendar-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-accent) 35%, transparent);
  color: var(--cal-text);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.property-calendar-filter-pop {
  /* The toolbar now lives above the canvas, so its menus open into the
     calendar rather than escaping the viewport. */
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  right: 0;
  z-index: 60;
  display: grid;
  gap: 0.2rem;
  min-width: 220px;
  padding: 0.55rem;
  background: var(--cal-surface);
  border: 1px solid var(--cal-line-strong);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
  /* Lightweight reveal so the menu doesn't pop in jarringly. */
  transform-origin: top right;
  animation: property-calendar-filter-pop-in 0.12s ease-out;
}
@keyframes property-calendar-filter-pop-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.property-calendar-filter-pop-head {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cal-muted);
  padding: 0.15rem 0.25rem 0.2rem;
}
.property-calendar-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.4rem;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--cal-text);
  cursor: pointer;
  user-select: none;
}
.property-calendar-filter-row:hover {
  background: color-mix(in srgb, var(--cal-accent) 12%, transparent);
}
.property-calendar-filter-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--cal-accent);
  cursor: pointer;
}
.property-calendar-filter-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
/* Filter sections — parent rows that fly out a submenu of the
   tokens in their group. Two groups today (Reservations, Tasks);
   adding a third only requires another entry in FILTER_GROUPS. */
.property-calendar-filter-group {
  position: relative;
  display: flex;
  flex-direction: column;
}
.property-calendar-filter-group-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.5rem;
  background: transparent;
  border: 0;
  font: inherit;
  color: var(--cal-text);
  text-align: left;
  cursor: default;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
}
.property-calendar-filter-group:hover > .property-calendar-filter-group-row,
.property-calendar-filter-group:focus-within > .property-calendar-filter-group-row {
  background: color-mix(in srgb, var(--cal-accent) 14%, transparent);
}
.property-calendar-filter-group-label {
  flex: 1 1 auto;
}
.property-calendar-filter-group-meta {
  font-size: 0.66rem;
  color: var(--cal-muted);
  font-feature-settings: "tnum";
}
.property-calendar-filter-group-caret {
  color: var(--cal-muted);
}
.property-calendar-filter-submenu {
  position: absolute;
  top: 0;
  /* Open to the LEFT of the popover so it never pushes off-screen
     when the toolbar sits near the right edge. The parent popover
     opens upward (see .property-calendar-filter-pop above) so the
     submenu's vertical anchor is its top edge. */
  right: calc(100% + 6px);
  min-width: 220px;
  padding: 6px;
  background: var(--bg-elevated, #131520);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  box-shadow: var(--shadow-soft, 0 8px 22px rgba(0, 0, 0, 0.32));
  display: none;
  flex-direction: column;
  z-index: 1;
}
.property-calendar-filter-group:hover > .property-calendar-filter-submenu,
.property-calendar-filter-group:focus-within > .property-calendar-filter-submenu {
  display: flex;
}
.property-calendar-cleans-filter {
  white-space: nowrap;
}
.property-calendar-filter-types {
  display: grid;
  max-height: 210px;
  margin-top: 3px;
  padding-top: 6px;
  overflow-y: auto;
  border-top: 1px solid var(--cal-line);
}
.property-calendar-filter-types-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 6px 4px;
  color: var(--cal-text);
  font-size: .72rem;
  font-weight: 700;
}
.property-calendar-filter-types-head small {
  color: var(--cal-muted);
  font-size: .6rem;
  font-weight: 500;
}
.property-calendar-filter-types .property-calendar-filter-row > svg {
  flex: 0 0 auto;
}

.property-calendar-filter-pop-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.3rem;
  padding-top: 0.3rem;
  margin-top: 0.2rem;
  border-top: 1px solid var(--cal-line);
}
.property-calendar-filter-link {
  background: transparent;
  border: 0;
  color: var(--cal-muted);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.18rem 0.35rem;
  border-radius: 6px;
}
.property-calendar-filter-link:hover {
  background: color-mix(in srgb, var(--cal-accent) 14%, transparent);
  color: var(--cal-text);
}

/* Settings editors render inside the shared WorkspaceShell. Navigation lives
   in pane 2; only editor vocabulary belongs in this global block. */
.settings-section {
  display: grid;
  gap: 1.2rem;
}
.settings-section-head h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}
.settings-section-head p {
  margin: 0;
  max-width: 60ch;
}
.settings-status {
  margin: 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.84rem;
}
.settings-status.is-error {
  background: color-mix(in srgb, #ef4444 14%, var(--bg-elevated));
  border-color: color-mix(in srgb, #ef4444 45%, var(--border-subtle));
  color: #fecaca;
}
.settings-status.is-warning {
  background: color-mix(in srgb, #f59e0b 12%, var(--bg-elevated));
  border-color: color-mix(in srgb, #f59e0b 50%, var(--border-subtle));
  color: var(--text-primary);
}

.vp-status-durations {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.8rem;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
}
.vp-status-durations > strong {
  font-size: 0.82rem;
}
.vp-status-durations > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.settings-card {
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  border-radius: 14px;
  padding: 1.2rem 1.4rem;
  display: grid;
  gap: 1rem;
}
.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.settings-card-head h2 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}
.settings-card-head p {
  margin: 0;
  max-width: 60ch;
  font-size: 0.82rem;
}
.settings-workspace-name-field {
  width: min(560px, 100%);
  display: grid;
  gap: 0.4rem;
}
.settings-tab-switch {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
  border-radius: 999px;
  padding: 2px;
}
.settings-tab-switch-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.32rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}
.settings-tab-switch-btn.is-active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.settings-asset-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.settings-asset-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.8rem;
  background: var(--bg-deep);
}
.settings-asset-preview {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  background: var(--bg-base);
  border: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 92px;
  overflow: hidden;
}
.settings-asset-preview.is-favicon {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
}
.settings-asset-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.settings-asset-meta {
  display: grid;
  gap: 0.25rem;
  flex: 1 1 auto;
  min-width: 0;
}
.settings-asset-meta strong {
  font-size: 0.92rem;
}
.settings-asset-meta p {
  margin: 0;
  font-size: 0.76rem;
}
.settings-asset-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
/* Integrations settings page — email/channel connection cards (light + dark via tokens). */
.integrations-grid {
  margin-top: 0.25rem;
  /* Wider min than the asset grid so the logo + description + action row has room
     (the settings sidebar + AI rail leave pane-3 narrow) — only split to two columns
     once each card can comfortably hold a single-line description. */
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}
.integration-card {
  align-items: flex-start;
}
.integration-card .settings-asset-meta p {
  /* Keep the description readable rather than collapsing to a sliver. */
  min-width: 0;
}
.integration-logo {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-style: solid;
  border-color: var(--border-subtle);
}
.integration-logo[data-brand="gmail"] {
  background: color-mix(in srgb, #ea4335 14%, var(--bg-base));
  color: #ea4335;
}
.integration-logo[data-brand="whatsapp"] {
  background: color-mix(in srgb, #25d366 16%, var(--bg-base));
  color: #1aa856;
}
.integration-logo[data-brand="sms"] {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-base));
  color: var(--accent);
}
.integration-logo[data-brand="voice"] {
  background: color-mix(in srgb, #7c3aed 16%, var(--bg-base));
  color: #7c3aed;
}
.integration-logo[data-brand="stripe"] {
  /* Stripe brand indigo. color-mix against --bg-base keeps it legible in light + dark. */
  background: color-mix(in srgb, #635bff 16%, var(--bg-base));
  color: #635bff;
}
.integration-logo[data-brand="clickup"] {
  background: color-mix(in srgb, #7b68ee 16%, var(--bg-base));
  color: #7b68ee;
}
.integration-status {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  width: fit-content;
  margin-top: 0.15rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}
.integration-status.is-connected {
  background: color-mix(in srgb, var(--state-success, #16a34a) 16%, transparent);
  color: var(--state-success, #16a34a);
}
.integration-status.is-idle {
  background: var(--bg-base);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.integration-spin {
  animation: integration-spin 0.8s linear infinite;
}
@keyframes integration-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Chrome-free result shown after a manual direct-booking Checkout session. */
.direct-payment-result {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%),
    var(--bg-base);
  color: var(--text-primary);
}
.direct-payment-result-card {
  width: min(100%, 520px);
  display: grid;
  gap: 14px;
  padding: clamp(24px, 6vw, 44px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  background: var(--bg-deep);
  box-shadow: 0 24px 70px rgb(0 0 0 / 14%);
}
.direct-payment-result-card h1,
.direct-payment-result-card p {
  margin: 0;
}
.direct-payment-result-card p {
  color: var(--text-muted);
  line-height: 1.55;
}
.direct-payment-result-kicker {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.direct-payment-result-code {
  width: fit-content;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-base));
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 750;
  letter-spacing: 0.08em;
}

/* Integrations > Stripe: multi-account routing and booking policy. */
.payment-settings-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.payment-settings-section {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.payment-settings-section-head,
.payment-property-policies-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.payment-settings-section h2,
.payment-settings-section h3,
.payment-settings-section p {
  margin: 0;
}
.payment-settings-section h2 { font-size: 1rem; }
.payment-settings-section h3 { font-size: 0.9rem; }
.payment-account-list,
.payment-property-policy-list {
  display: grid;
  gap: 10px;
}
.payment-account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-deep);
}
.payment-account-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #635bff;
  background: color-mix(in srgb, #635bff 14%, var(--bg-base));
}
.payment-account-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
}
.payment-account-assurance {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.payment-account-assurance > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}
.payment-account-assurance small {
  color: var(--text-muted);
  font-size: 0.65rem;
}
.payment-account-assurance strong {
  overflow-wrap: anywhere;
  color: var(--text-primary);
  font-size: 0.72rem;
}
.payment-account-check-meta {
  color: var(--text-muted);
  font-size: 0.67rem;
  line-height: 1.45;
}
.payment-account-purpose {
  color: var(--text-soft);
  font-size: 0.72rem;
  line-height: 1.4;
}
.payment-account-actions,
.payment-policy-actions,
.payment-property-add {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.payment-settings-empty {
  min-height: 132px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 20px;
  border: 1px dashed var(--border-subtle);
  border-radius: 14px;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.8rem;
}
.payment-routing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.payment-route-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-deep);
}
.payment-route-card > span {
  display: grid;
  gap: 3px;
}
.payment-route-card small { color: var(--text-muted); }
.payment-route-card .selectmenu-trigger,
.payment-property-add .selectmenu-trigger,
.payment-policy-card .direct-booking-policy-control-grid .selectmenu-trigger,
.payment-policy-card .direct-booking-policy-control-grid input:not([type="checkbox"]) {
  min-height: 38px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 0 10px;
  color: var(--text-primary);
  background: var(--bg-base);
}
.payment-route-card .selectmenu-trigger,
.payment-property-add .selectmenu-trigger,
.payment-policy-card .direct-booking-policy-control-grid .selectmenu-trigger {
  width: 100%;
  justify-content: space-between;
  font-weight: 500;
}
.payment-policy-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-deep);
}
.payment-policy-title { display: grid; gap: 3px; }
.payment-policy-title strong { color: var(--text-primary); font-size: 0.82rem; }
.payment-policy-title small { max-width: 72ch; color: var(--text-muted); font-size: 0.69rem; line-height: 1.45; }
.payment-policy-cancellation {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}
.payment-policy-cancellation > legend {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 5px;
  color: var(--text-primary);
}
.payment-policy-cancellation > legend > span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-muted));
  color: var(--accent);
  font-size: 0.63rem;
  font-weight: 800;
}
.payment-policy-cancellation > legend strong { font-size: 0.74rem; }
.payment-policy-cancellation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding-top: 4px;
}
.payment-policy-cancellation-grid > label {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}
.payment-policy-cancellation-grid label > span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}
.payment-policy-cancellation-grid label > small {
  color: var(--text-muted);
  font-size: 0.64rem;
  line-height: 1.42;
}
.payment-policy-cancellation-grid .selectmenu-trigger {
  width: 100%;
  min-height: 38px;
  justify-content: space-between;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-base);
  color: var(--text-primary);
  font-weight: 500;
}
.payment-settings-embedded {
  gap: 16px;
}
.payment-settings-embedded.payment-settings-loading {
  min-height: 108px;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-elevated);
}
.payment-settings-embedded .payment-settings-section {
  gap: 16px;
  margin-top: 0;
  padding: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.025);
}
.payment-settings-embedded .payment-settings-section-head h2 {
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}
.payment-settings-embedded .payment-settings-section-head p {
  max-width: 72ch;
  margin-top: 5px;
  font-size: 0.72rem;
  line-height: 1.55;
}
.payment-settings-embedded .payment-account-card,
.payment-settings-embedded .payment-route-card,
.payment-settings-embedded .payment-policy-card {
  background: var(--surface-muted);
}
.payment-settings-embedded .settings-status {
  background: var(--bg-elevated);
}
@media (max-width: 720px) {
  .payment-settings .settings-section-head,
  .payment-settings-section-head,
  .payment-property-policies-head,
  .payment-account-card {
    align-items: stretch;
    flex-direction: column;
  }
  .payment-account-actions > *,
  .payment-property-add > * { flex: 1 1 auto; }
  .payment-account-assurance { grid-template-columns: minmax(0, 1fr); }
  .payment-policy-cancellation-grid { grid-template-columns: minmax(0, 1fr); }
  .payment-settings-embedded .payment-settings-section { padding: 16px; }
}

.fin-payout-bank-check {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 13px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}
.fin-payout-bank-check.is-ready {
  border-color: color-mix(in srgb, var(--success) 38%, var(--border-subtle));
}
.fin-payout-bank-check.is-missing {
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border-subtle));
}
.fin-payout-bank-check p { margin: 0; line-height: 1.55; }
.fin-payout-bank-audit {
  padding-top: 9px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-soft);
  font-size: 0.76rem;
}
.fin-payout-bank-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-base));
  cursor: pointer;
}
.fin-payout-bank-confirm.is-disabled { opacity: 0.62; cursor: not-allowed; }
.fin-payout-bank-confirm input { margin-top: 3px; }
.fin-payout-bank-confirm > span { display: grid; gap: 3px; }
.fin-payout-bank-confirm small { color: var(--text-muted); line-height: 1.45; }

/* ClickUp → Tasks onboarding. The browser intentionally orchestrates one source
   page and one task at a time so a long file migration remains resumable on
   serverless infrastructure. */
.clickup-import {
  max-width: 980px;
}
.clickup-import-head {
  align-items: flex-start;
  gap: 1rem;
}
.clickup-import-head h1 {
  margin-top: 0.55rem;
}
.clickup-import-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-decoration: none;
}
.clickup-import-back:hover {
  color: var(--text-primary);
}
.clickup-import-panel {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-deep);
}
.clickup-import-panel.is-loading {
  align-items: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}
.clickup-import-step {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, #7b68ee 18%, var(--bg-base));
  color: #7b68ee;
  font-weight: 700;
  font-size: 0.82rem;
}
.clickup-import-step.is-done {
  background: color-mix(in srgb, var(--state-success, #16a34a) 16%, var(--bg-base));
  color: var(--state-success, #16a34a);
}
.clickup-import-panel-body {
  flex: 1 1 auto;
  min-width: 0;
}
.clickup-import-panel-body h2,
.clickup-import-panel-body h3 {
  margin: 0;
}
.clickup-import-panel-body h2 {
  font-size: 1rem;
}
.clickup-import-panel-body > p {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}
.clickup-import-token {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
  max-width: 620px;
  font-size: 0.76rem;
  font-weight: 650;
}
.clickup-import-token input {
  width: 100%;
  min-height: 40px;
  padding: 0.55rem 0.7rem;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
}
.clickup-import-token input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.clickup-import-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.clickup-import-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.clickup-import-actions.is-final {
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}
.clickup-import-actions.is-final > span {
  font-size: 0.75rem;
}
.clickup-import-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.clickup-import-picker-head p {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
}
.clickup-import-workspaces {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  max-height: min(55vh, 620px);
  overflow: auto;
  padding-right: 0.25rem;
}
.clickup-import-workspace {
  display: grid;
  gap: 0.65rem;
}
.clickup-import-workspace > h3 {
  font-size: 0.88rem;
}
.clickup-import-space {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
}
.clickup-import-space > strong {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.clickup-import-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.45rem;
}
.clickup-import-list {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  cursor: pointer;
  background: var(--bg-deep);
}
.clickup-import-list:has(input:checked) {
  border-color: color-mix(in srgb, #7b68ee 55%, var(--border-subtle));
  background: color-mix(in srgb, #7b68ee 8%, var(--bg-deep));
}
.clickup-import-list input {
  margin-top: 0.12rem;
  accent-color: #7b68ee;
}
.clickup-import-list > span {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}
.clickup-import-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
}
.clickup-import-list small {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.clickup-import-current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clickup-import-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}
.clickup-import-metrics span {
  padding: 0.28rem 0.52rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-base);
  color: var(--text-muted);
  font-size: 0.72rem;
}
.clickup-import-metrics .is-error {
  color: var(--state-danger, #dc2626);
}
.clickup-import-stay-open {
  margin-top: 0.8rem !important;
}
.clickup-import-errors {
  margin-top: 0.75rem;
  color: var(--state-danger, #dc2626);
  font-size: 0.75rem;
}
.clickup-import-errors summary {
  cursor: pointer;
}
.clickup-import-errors ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}

@media (max-width: 720px) {
  .clickup-import-panel {
    padding: 0.8rem;
  }
  .clickup-import-step {
    display: none;
  }
  .clickup-import-picker-head {
    align-items: stretch;
    flex-direction: column;
  }
  .clickup-import-lists {
    grid-template-columns: 1fr;
  }
}
/* Slice 11 — email send-from addresses (aliases) panel. Theme tokens → light/dark parity. */
.integration-aliases {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-base);
}
.integration-aliases-head strong {
  font-size: 0.92rem;
}
.integration-aliases-head p {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
}
.integration-aliases-list {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
/* One address = a block: the address line, its sender-name field, then a live preview of
   exactly what the recipient will see. Tokens only, so light/dark come free (CLAUDE.md §5). */
.integration-alias-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-subtle, var(--border, rgba(128, 128, 128, 0.18)));
}
.integration-alias-row:last-child {
  border-bottom: 0;
}
.integration-alias-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}
.integration-alias-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}
.integration-alias-name-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  flex: 0 0 auto;
}
.integration-alias-name input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 0.34rem 0.5rem;
  font-size: 0.82rem;
  border-radius: 7px;
  border: 1px solid var(--border, rgba(128, 128, 128, 0.28));
  background: var(--surface, transparent);
  color: var(--text, inherit);
}
.integration-alias-name input:focus-visible {
  outline: 2px solid var(--accent, #4f46e5);
  outline-offset: 1px;
}
.integration-alias-saved {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--state-success, #16a34a);
}
.integration-alias-preview {
  font-size: 0.74rem;
  margin: 0;
  word-break: break-word;
}
.integration-alias-addr {
  font-size: 0.84rem;
  font-weight: 600;
  word-break: break-all;
}
.integration-alias-tag {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #4f46e5) 14%, transparent);
  color: var(--accent, #4f46e5);
}
.integration-alias-tag.is-pending {
  background: color-mix(in srgb, var(--state-warning, #d97706) 16%, transparent);
  color: var(--state-warning, #d97706);
}
.integration-alias-add {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.integration-alias-add input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-base);
  color: inherit;
  font-size: 0.84rem;
}
.integration-aliases-reauth {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}
.settings-color-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}
@media (min-width: 800px) {
  .settings-color-grid {
    grid-template-columns: 1fr 1fr;
  }}
.settings-color-row {
  display: grid;
  grid-template-columns: 36px 1fr 116px auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-deep);
}
.settings-color-row.is-overridden {
  border-color: color-mix(in srgb, var(--text-primary) 25%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-elevated) 70%, var(--bg-deep));
}
.settings-color-row input[type="color"] {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  padding: 2px;
  cursor: pointer;
}
.settings-color-row input[type="color"]:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.settings-color-meta {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}
.settings-color-meta strong {
  font-size: 0.78rem;
}
.settings-color-meta code {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
}
.settings-color-hex {
  height: 30px;
  padding: 0 0.45rem;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: 100%;
}
.settings-color-reset {
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  padding: 0.22rem 0.5rem;
  border-radius: 7px;
  font-size: 0.7rem;
  cursor: pointer;
}
.settings-color-reset:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.settings-color-flag {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.settings-preview {
  margin-top: 0.6rem;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.settings-preview-card strong {
  font-size: 0.94rem;
}
.settings-preview-card p {
  margin: 0.2rem 0 0.7rem;
  font-size: 0.78rem;
}
.settings-preview-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.settings-preview-pill {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.settings-preview-pill.is-secondary {
  background: var(--bg-deep);
  color: var(--text-soft);
}
.settings-preview-pill.is-accent {
  background: var(--primary-gradient, var(--bg-elevated));
  color: #fff;
  border: 0;
}
.settings-section-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

/* Workspace email templates: named drafts, one published default, shared
   Visual/HTML composer and the exact recipient render. */
.email-template-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.email-template-settings-head code,
.email-template-slot-help code {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  color: var(--text-primary);
}
.email-template-grid {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.email-template-list {
  position: sticky;
  top: 1rem;
  gap: 0.45rem;
}
.email-template-list-item {
  display: grid;
  gap: 0.15rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}
.email-template-list-item:hover {
  border-color: var(--border-subtle);
  background: var(--bg-deep);
}
.email-template-list-item.is-active {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-deep));
}
.email-template-list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.84rem;
  font-weight: 650;
}
.email-template-list-meta {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.email-template-editor-stack {
  display: grid;
  gap: 1rem;
  min-width: 0;
}
.email-template-editor-card .autobuild-email {
  min-width: 0;
}
.email-template-name-field {
  display: grid;
  gap: 0.35rem;
  max-width: 520px;
}
.email-template-slot-help {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-deep);
  font-size: 0.76rem;
}
.email-template-slot-help span {
  color: var(--text-muted);
}
.email-template-statuses {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.email-template-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 650;
}
.email-template-badge.is-default {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  color: var(--accent);
}
.email-template-badge.is-warning {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border-subtle));
  color: #d97706;
}
.email-template-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.email-template-actions-spacer {
  flex: 1 1 auto;
}
.email-template-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}
.email-template-recipient-preview .inbox-email-frame {
  width: 100%;
  min-height: 520px;
  max-height: 720px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
}
.ph-email-template-row {
  min-height: 40px;
}
.ph-email-template-select {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: right;
}
@container settings-main (max-width: 850px) {
  .email-template-grid {
    grid-template-columns: 1fr;
  }
  .email-template-list {
    position: static;
  }
}

/* ======================================================================
 * Tasks (ClickUp-style) — page, list, board, drawer, calendar strip
 * ====================================================================== */

:root {
  --tasks-accent: #7c3aed;
  --tasks-accent-soft: color-mix(in srgb, #7c3aed 18%, transparent);
  --tasks-accent-strong: #6d28d9;
  --tasks-row-h: 38px;
  --tasks-row-h-comfortable: 42px;
  --tasks-radius: 10px;
  --tasks-radius-lg: 14px;
  --tasks-shadow-card: 0 1px 2px rgba(15, 23, 42, 0.08), 0 4px 12px -4px rgba(15, 23, 42, 0.1);
  --tasks-shadow-pop: 0 18px 50px -12px rgba(15, 23, 42, 0.45), 0 4px 12px rgba(15, 23, 42, 0.15);
  --tasks-bg-row-hover: color-mix(in srgb, var(--tasks-accent) 6%, transparent);
}

/* Shell --------------------------------------------------------------- */
.tasks-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 24px 24px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-base, #050507);
  position: relative;
}

/* Header -------------------------------------------------------------- */
.tasks-header { display: flex; flex-direction: column; gap: 14px; }

.tasks-title-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 2px;
}
.tasks-count {
  color: var(--text-soft, rgba(229, 231, 235, 0.55));
  font-size: 0.78rem;
  font-weight: 500;
}
/* Shown beside the count while the rest of a long list is still arriving, so
   the chip and group numbers above are never read as final. Quieter than the
   count itself — it is a state, not a figure. */
.tasks-count-filling {
  color: var(--text-muted, rgba(229, 231, 235, 0.4));
  font-size: 0.72rem;
  font-weight: 500;
  margin-left: 8px;
  font-style: italic;
}

.tasks-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: var(--tasks-radius-lg);
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.08));
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
}

.tasks-create-inline { flex: 0 0 280px; min-width: 220px; display:flex; flex-direction:column; gap:7px; }
.tasks-create-input,
.tasks-search-input {
  width: 100%;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--bg-deep, rgba(0, 0, 0, 0.3));
  color: var(--text-primary, #f1f5f9);
  font-size: 0.84rem;
  transition: border-color 120ms ease, background 120ms ease;
}
.tasks-create-input::placeholder,
.tasks-search-input::placeholder {
  color: var(--text-soft, rgba(229, 231, 235, 0.45));
}
.tasks-create-input:focus,
.tasks-search-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--tasks-accent) 50%, transparent);
  background: color-mix(in srgb, var(--tasks-accent) 8%, var(--bg-deep, rgba(0,0,0,0.3)));
}

.tasks-search { flex: 1 1 220px; max-width: 360px; }
.tasks-toolbar-spacer { flex: 1; }
.tasks-toolbar-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tasks-toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.tasks-toolbar-btn:hover {
  background: color-mix(in srgb, var(--text-primary, #fff) 6%, transparent);
  color: var(--text-primary, #fff);
}
/* Footer under a paged task list. Layout only — the button inside is the
   canonical .tasks-toolbar-btn, so colour and theming come from there. */
.tasks-more-row {
  display: flex;
  justify-content: center;
  padding: 12px 0 20px;
}
.tasks-more-row .tasks-toolbar-btn {
  border-color: var(--border-soft, rgba(148, 163, 184, 0.28));
}
.tasks-more-row .tasks-toolbar-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.tasks-view-switcher {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-deep, rgba(0, 0, 0, 0.4));
  border-radius: 10px;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.06));
}
.tasks-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  color: var(--text-soft, rgba(229, 231, 235, 0.65));
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.tasks-view-btn:hover { color: var(--text-primary, #fff); }
.tasks-view-btn.is-active {
  background: color-mix(in srgb, var(--tasks-accent) 22%, transparent);
  color: #ddd6fe;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tasks-accent) 50%, transparent);
}

/* Quick due-date buckets --------------------------------------------------
   Desktop port of the phone Tasks screen's Overdue / Today / Upcoming / All
   chips (shared rule: lib/tasks-ui.ts bucketOfTask). The row reuses the
   canonical SegmentedControl; only the wrapper and the live count badge are
   styled here. Tokens only — light/dark parity comes from the theme vars.
   The descendant selectors also outrank the small-screen
   `.segmented-control-btn > span { display:block }` flattener, keeping the
   badge inline at every width. */
/* Wraps, and the bucket control scrolls inside its line. Measured 2026-07-27 at
   a 1500px window: this bar is 336px wide while the due-date control alone is
   419px, so "Standing" and "All" were already being cut off by the pane edge —
   pre-existing, and adding "Show closed" beside them would have put a control
   Hakim asked for entirely off-screen. Wrapping gives the chip its own line when
   the buckets fill one; the scroll keeps the far end of the control reachable
   rather than clipped. Scoped to this bar so no other SegmentedControl moves. */
.tasks-quick-buckets { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tasks-quick-buckets > .segmented-control { max-width: 100%; overflow-x: auto; }
.tasks-quick-buckets .segmented-control-btn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.tasks-quick-buckets .tasks-bucket-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  margin-left: 7px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-muted);
}
.tasks-quick-buckets .segmented-control-btn.is-on .tasks-bucket-count {
  background: var(--tasks-accent-soft);
  color: var(--tasks-accent);
}

.tasks-toolbar-popover { position: relative; }
.tasks-toolbar-popover-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  max-width: 360px;
  z-index: 60;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
  background: var(--bg-deep, #0b0b13);
  box-shadow: var(--tasks-shadow-pop);
  animation: tasks-pop 140ms ease;
}
@keyframes tasks-pop {
  from { transform: translateY(-4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.tasks-popover-list { display: flex; flex-direction: column; gap: 1px; }
.tasks-popover-item {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text-primary, #e7e7ee);
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
}
.tasks-popover-item:hover { background: color-mix(in srgb, var(--text-primary, #fff) 8%, transparent); }
.tasks-popover-item.is-active {
  background: color-mix(in srgb, var(--tasks-accent) 25%, transparent);
  color: #ddd6fe;
}
.tasks-toolbar-popover-content:has(.tasks-fields-manager) {
  width: min(620px, calc(100vw - 24px));
  max-width: min(620px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 110px));
  overflow-y: auto;
}
.tasks-fields-manager { display: grid; gap: 10px; }
.tasks-fields-manager-head { display: grid; gap: 2px; }
.tasks-fields-manager-head strong { color: var(--text-primary); font-size: 0.9rem; }
.tasks-fields-manager-head span,
.tasks-fields-empty,
.tasks-field-card-options > span {
  color: var(--text-muted);
  font-size: 0.73rem;
}
.tasks-fields-new,
.tasks-field-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.55fr) auto;
  gap: 6px;
}
.tasks-field-card-row { grid-template-columns: minmax(0, 1fr) minmax(145px, 0.55fr); }
/* The type pickers are SelectMenu triggers now — listed here so they keep this
   box, with the normal weight the global button rule would take away. */
.tasks-fields-new input,
.tasks-fields-new .selectmenu-trigger,
.tasks-field-card input[type="text"],
.tasks-field-card input:not([type]),
.tasks-field-card .selectmenu-trigger {
  min-height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 5px 8px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 400;
}
.tasks-fields-new button,
.tasks-field-card-actions button {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: color-mix(in srgb, var(--tasks-accent) 18%, var(--bg-input));
  color: var(--text-primary);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.tasks-fields-new button:disabled,
.tasks-field-card-actions button:disabled { opacity: 0.55; cursor: default; }
.tasks-fields-list { display: grid; gap: 8px; }
.tasks-field-card {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg-elevated) 72%, transparent);
}
.tasks-field-card-stack,
.tasks-field-card-options { display: grid; gap: 5px; }
.tasks-field-card-stack > span,
.tasks-field-streams legend { color: var(--text-soft); font-size: 0.72rem; }
.tasks-field-card-options label,
.tasks-field-streams label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--text-primary);
  font-size: 0.75rem;
}
.tasks-field-streams {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.tasks-field-streams legend { padding: 0 4px; }
.tasks-field-card-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.tasks-field-card-actions .is-danger { color: var(--state-danger); background: transparent; }
.tasks-field-delete-confirm {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  color: var(--state-danger);
  font-size: 0.76rem;
}
.tasks-fields-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--state-success);
  font-size: 0.75rem;
}
.tasks-fields-message button {
  min-height: 30px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tasks-fields-message.is-error { color: var(--state-danger); }
@media (max-width: 640px) {
  .tasks-fields-new,
  .tasks-field-card-row { grid-template-columns: 1fr; }
}

.tasks-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tasks-accent) 22%, transparent), color-mix(in srgb, #ec4899 18%, transparent));
  border: 1px solid color-mix(in srgb, var(--tasks-accent) 50%, transparent);
  color: #fff;
  animation: tasks-pop 140ms ease;
}
.tasks-bulk-bar > span:first-child { font-weight: 600; font-size: 0.84rem; padding-right: 4px; }
.tasks-bulk-select,
.tasks-bulk-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.78rem;
  cursor: pointer;
  font-weight: 500;
}
.tasks-bulk-btn:hover { background: rgba(0, 0, 0, 0.65); }
.tasks-bulk-btn.danger { color: #fecaca; border-color: rgba(248, 113, 113, 0.5); }
.tasks-bulk-btn.danger:hover { background: rgba(248, 113, 113, 0.18); }
.tasks-bulk-btn.ghost { background: transparent; border-color: transparent; }
.tasks-bulk-btn.ghost:hover { background: rgba(0, 0, 0, 0.35); }
.tasks-bulk-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.tasks-bulk-confirm strong { font-size: 0.82rem; }

.tasks-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.1);
  color: #fecaca;
  border: 1px solid rgba(244, 63, 94, 0.4);
  font-size: 0.82rem;
}
.tasks-error button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: 7px;
  background: rgba(244, 63, 94, 0.12);
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}
.tasks-error button:hover { background: rgba(244, 63, 94, 0.2); }

/* List ---------------------------------------------------------------- */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
  padding-bottom: 30px;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
}
.tasks-list::-webkit-scrollbar { width: 8px; }
.tasks-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }

.tasks-group { display: flex; flex-direction: column; gap: 6px; }
.tasks-group-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary, #e7e7ee);
  width: fit-content;
}
.tasks-group-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-soft, rgba(229, 231, 235, 0.4));
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 8%, transparent);
}
.tasks-group-label { letter-spacing: -0.005em; }
.tasks-group-count {
  background: var(--bg-deep, rgba(0,0,0,0.4));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.08));
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
  font-weight: 600;
}
.tasks-group-rows {
  display: flex;
  flex-direction: column;
  border-radius: var(--tasks-radius);
  overflow: hidden;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.06));
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
}
/* Stands in for the rows a long list is not currently rendering (see
   lib/tasks-virtual-window.ts). Purely structural — it inherits the card's
   own background, so it is invisible in both themes and needs no colour of
   its own. `flex: none` stops the column shrinking it back to nothing. */
.tasks-row-spacer {
  flex: none;
  pointer-events: none;
}

/* Row ----------------------------------------------------------------- */
.task-row {
  display: grid;
  grid-template-columns:
    14px
    18px
    22px
    18px
    minmax(80px, auto)
    /* Title gets a FLOOR: before the ClickUp import no row had listing chips,
       so minmax(0,1fr) never fought anyone. With chips present, a narrow pane
       let the 200px chip column crush the title to ~38px. Titles outrank
       chips: title keeps ≥140px and the chip column is the one that yields. */
    minmax(140px, 1fr)
    auto
    minmax(0, 160px)
    minmax(70px, 86px)
    minmax(60px, 90px)
    minmax(96px, 130px);
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 8px;
  height: var(--tasks-row-h);
  border-bottom: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.05));
  cursor: pointer;
  transition: background 80ms ease;
  position: relative;
}
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: var(--tasks-bg-row-hover); }
.task-row.is-open {
  background: color-mix(in srgb, var(--tasks-accent) 12%, transparent);
  box-shadow: inset 3px 0 0 var(--tasks-accent);
}
.task-row.is-selected {
  background: color-mix(in srgb, var(--tasks-accent) 18%, transparent);
  box-shadow: inset 3px 0 0 var(--tasks-accent);
}
.task-row.is-closed .task-row-title {
  text-decoration: line-through;
  color: var(--text-soft, rgba(229, 231, 235, 0.45));
}

/* Subtasks render nested under their parent — same row layout, just
   inset and visually subordinate. The wrapper draws a thin guide line
   to indicate the parent/child relationship without committing to a
   full tree-view UI. */
.tasks-task-with-subs { display: flex; flex-direction: column; }
.tasks-subtask-list {
  position: relative;
  padding-left: 26px;
}
.tasks-subtask-list::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle, rgba(229, 231, 235, 0.12));
}
.task-row.is-subtask {
  height: calc(var(--tasks-row-h) * 0.85);
  font-size: 0.85em;
  background: transparent;
}
.task-row.is-subtask .task-row-number { opacity: 0.6; }
.task-row-subcount {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1;
}

.task-row-grip {
  color: var(--text-soft, rgba(229, 231, 235, 0.25));
  opacity: 0;
  transition: opacity 100ms ease;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: grab;
}
.task-row:hover .task-row-grip { opacity: 1; }

.task-row-checkbox {
  width: 16px; height: 16px;
  accent-color: var(--tasks-accent);
  cursor: pointer;
  margin: 0;
}

.task-row-complete {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle, rgba(229, 231, 235, 0.32));
  background: transparent;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
  padding: 0;
}
.task-row-complete:hover {
  border-color: #22c55e;
  background: color-mix(in srgb, #22c55e 14%, transparent);
  color: #22c55e;
}
.task-row-complete.is-checked {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.task-row-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  opacity: 0.85;
}
.task-row-priority[data-priority="none"] { opacity: 0.25; }

.task-row-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 6px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-deep, rgba(0, 0, 0, 0.32));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-row-type.is-empty { background: transparent; border-color: transparent; }
.task-row-type-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 7px;
}

.task-row-title-block {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.task-row-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-soft, rgba(229, 231, 235, 0.4));
  font-size: 0.7rem;
  font-weight: 500;
  flex: 0 0 auto;
}
.task-row-title {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary, #f1f5f9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
}

.task-row-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  padding: 1px 7px;
  height: 18px;
  border-radius: 999px;
  background: var(--bg-deep, rgba(0, 0, 0, 0.3));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
  white-space: nowrap;
  font-weight: 500;
  flex: 0 0 auto;
}
.task-row-tag.muted { opacity: 0.55; }

.task-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 100ms ease;
}
.task-row:hover .task-row-actions { opacity: 1; }
.task-row-action {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: transparent;
  border: 0;
  color: var(--text-soft, rgba(229, 231, 235, 0.55));
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.task-row-action:hover {
  background: color-mix(in srgb, var(--text-primary, #fff) 10%, transparent);
  color: var(--text-primary, #fff);
}

.task-row-listings { display: inline-flex; gap: 4px; overflow: hidden; }
.task-row-listing-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  padding: 2px 8px;
  height: 20px;
  border-radius: 5px;
  background: color-mix(in srgb, #06b6d4 12%, var(--bg-deep, rgba(0,0,0,0.3)));
  border: 1px solid color-mix(in srgb, #06b6d4 26%, transparent);
  color: #67e8f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  font-weight: 500;
}
.task-row-listing-chip.muted {
  background: var(--bg-deep, rgba(0,0,0,0.3));
  border-color: var(--border-subtle, rgba(229, 231, 235, 0.1));
  color: var(--text-soft, rgba(229, 231, 235, 0.5));
}

.task-row-assignees {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding-left: 6px;
}
.task-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated, #0a0a14);
  font-size: 0.66rem;
  font-weight: 700;
  /* App-canon look (Plan 4B): flat tone wash + theme text, matching
     .workspace-list-avatar-fallback. The per-user tone comes from the
     .tone-* classes (avatarToneClass); this is only the no-tone fallback. */
  color: var(--text-primary);
  margin-left: -6px;
  overflow: hidden;
  flex: 0 0 auto;
  background: color-mix(in srgb, var(--primary-gradient-soft) 55%, var(--bg-input));
}
.task-row-assignees > .task-avatar:first-child,
.task-board-card-avatars > .task-avatar:first-child { margin-left: 0; }
.task-avatar img { width: 100%; height: 100%; object-fit: cover; }
.task-avatar.is-group {
  border-color: color-mix(in srgb, var(--primary, #7c3aed) 64%, var(--bg-elevated, #0a0a14));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary, #7c3aed) 42%, transparent);
}
.task-avatar.is-muted { background: var(--bg-deep, rgba(0,0,0,0.4)); color: var(--text-soft, rgba(229, 231, 235, 0.65)); }
.task-avatar.is-empty {
  background: transparent;
  border: 1.5px dashed var(--border-subtle, rgba(229, 231, 235, 0.2));
  width: 22px;
  height: 22px;
}

.task-row-due {
  font-size: 0.74rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.65));
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-row-due[data-due="overdue"] {
  color: #fca5a5;
  font-weight: 600;
}
.task-row-due[data-due="today"] {
  color: #fbbf24;
  font-weight: 600;
}
.task-row-due[data-due="soon"] { color: #93c5fd; }
.task-row-due.is-empty {
  color: var(--text-soft, rgba(229, 231, 235, 0.25));
  display: inline-flex; align-items: center; justify-content: flex-end;
}

.task-row-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-deep, rgba(0,0,0,0.3));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-row-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}

.tasks-inline-add {
  display: flex;
  flex-direction:column;
  align-items: stretch;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  color: var(--text-soft, rgba(229, 231, 235, 0.4));
  cursor: text;
  border-top: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.04));
  font-size: 0.8rem;
  transition: color 100ms ease, background 100ms ease;
}
.tasks-inline-add-main{ display:flex; align-items:center; gap:8px; min-height:18px; }
.tasks-inline-add .task-tag-requirement-field{ padding-left:22px; }
.tasks-inline-add-error{ padding-left:22px; font-size:11px; color:var(--state-danger); }
.tasks-inline-add:hover { color: var(--text-soft, rgba(229, 231, 235, 0.7)); background: color-mix(in srgb, var(--text-primary, #fff) 3%, transparent); }
.tasks-inline-add.is-active { color: var(--text-primary, #fff); background: color-mix(in srgb, var(--tasks-accent) 6%, transparent); }
.tasks-inline-add-icon { display: inline-flex; }
.tasks-inline-add-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  outline: none;
  padding: 0;
}
.tasks-inline-add-input::placeholder { color: var(--text-soft, rgba(229, 231, 235, 0.35)); }

.tasks-filter-panel { display: flex; flex-direction: column; gap: 12px; max-width: 340px; }
.tasks-filter-section h4 {
  margin: 0 0 6px;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft, rgba(229, 231, 235, 0.4));
  font-weight: 600;
}
.tasks-filter-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tasks-filter-chip {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.15));
  color: var(--text-primary, #e7e7ee);
  cursor: pointer;
  font-weight: 500;
  transition: background 100ms ease, border-color 100ms ease;
}
.tasks-filter-chip:hover { background: color-mix(in srgb, var(--text-primary, #fff) 6%, transparent); }
.tasks-filter-chip.is-active {
  background: color-mix(in srgb, var(--tasks-accent) 22%, transparent);
  border-color: var(--tasks-accent);
  /* Was a hardcoded #ddd6fe. That is a pale lilac, and this same rule paints a
     pale lilac background — readable on dark, near-invisible in light mode
     (CLAUDE.md §5). It only ever lived inside the Filters popover so nobody
     caught it; "Show closed" puts the same chip in the always-visible toolbar.
     The token flips with the theme, the hex could not. */
  color: var(--text-primary);
}
/* "Show closed" sits beside the due-date buckets, reusing the Filters panel's
   chip so one flag does not grow two different looks. Only placement is new. */
.tasks-quick-buckets .tasks-quick-closed {
  padding: 4px 11px;
  white-space: nowrap;
}
.tasks-filter-clear {
  font-size: 0.72rem;
  padding: 4px;
  background: transparent;
  border: 0;
  color: var(--text-soft, rgba(229, 231, 235, 0.55));
  cursor: pointer;
  text-align: left;
}
.tasks-filter-clear:hover { color: var(--text-primary, #fff); }

.tasks-skeleton { display: flex; flex-direction: column; gap: 6px; padding: 0; }
.tasks-skeleton-row {
  display: grid;
  grid-template-columns: 22px 80px minmax(0, 1fr) 80px 100px;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.04));
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
}
.tasks-skeleton-block {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: tasks-shimmer 1.4s ease-in-out infinite;
}
.tasks-skeleton-check { width: 18px; height: 18px; border-radius: 50%; }
.tasks-skeleton-pill { height: 18px; border-radius: 6px; }
.tasks-skeleton-pill.short { width: 60%; }
.tasks-skeleton-line { height: 12px; }
@keyframes tasks-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.tasks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 64px 30px;
  color: var(--text-soft, rgba(229, 231, 235, 0.6));
  border-radius: var(--tasks-radius-lg);
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--tasks-accent) 14%, transparent), transparent 70%),
    var(--bg-elevated, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.05));
}
.tasks-empty strong {
  font-size: 1.05rem;
  color: var(--text-primary, #f1f5f9);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.tasks-empty p {
  margin: 0;
  max-width: 460px;
  line-height: 1.55;
  font-size: 0.84rem;
}
.tasks-empty-illustration {
  color: #c4b5fd;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tasks-accent) 25%, transparent), color-mix(in srgb, #ec4899 18%, transparent));
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--tasks-accent) 38%, transparent);
}
.tasks-empty-action {
  margin-top: 6px;
  padding: 7px 16px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tasks-accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--tasks-accent) 50%, transparent);
  color: #ddd6fe;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
}
.tasks-empty-action:hover { background: color-mix(in srgb, var(--tasks-accent) 35%, transparent); }

/* Board --------------------------------------------------------------- */
.task-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  align-items: flex-start;
  padding: 4px 0 30px;
  flex: 1;
  min-height: 0;
}
.task-board::-webkit-scrollbar { height: 8px; }
.task-board::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 4px; }

.task-board-category {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.task-board-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.task-board-category-head > :last-child {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.task-board-category-columns {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-board-column {
  flex: 0 0 286px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--tasks-radius-lg);
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.06));
  max-height: 100%;
  overflow: hidden;
  position: relative;
}
.task-board-column::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--col-accent, var(--tasks-accent));
  opacity: 0.6;
}
.task-board-column.is-drop-over {
  border-color: var(--col-accent, var(--tasks-accent));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--col-accent, var(--tasks-accent)) 35%, transparent);
}

.task-board-column-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary, #f1f5f9);
  border-bottom: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.06));
}
.task-board-column-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--col-accent, var(--tasks-accent));
}
.task-board-column-name { flex: 1; }
.task-board-column-count {
  background: var(--bg-deep, rgba(0, 0, 0, 0.4));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
  font-weight: 600;
  letter-spacing: 0;
}
.task-board-column-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
}

.task-board-card {
  background: var(--bg-deep, #0e0e18);
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.06));
  border-radius: 10px;
  padding: 10px 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  position: relative;
  overflow: hidden;
}
.task-board-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--card-tint, transparent);
  opacity: 0.85;
}
.task-board-card:hover {
  border-color: color-mix(in srgb, var(--text-primary, #fff) 14%, transparent);
  transform: translateY(-1px);
  box-shadow: var(--tasks-shadow-card);
}
.task-board-card.is-dragging { opacity: 0.5; transform: rotate(-1deg) scale(0.98); }
.task-board-card-head { display: flex; align-items: center; gap: 6px; }
.task-board-card-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-soft, rgba(229, 231, 235, 0.4));
  font-size: 0.66rem;
  font-weight: 500;
}
.task-board-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 0.66rem;
  font-weight: 600;
  background: var(--bg-deep, rgba(0,0,0,0.3));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.08));
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
}
.task-board-card-spacer { flex: 1; }
.task-board-priority { display: inline-flex; align-items: center; }
.task-board-card-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.35;
}
.task-board-card-status {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  color: var(--text-soft);
  font-size: 0.67rem;
}
.task-board-card-status > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.task-board-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.task-board-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.05));
}
.task-board-card-avatars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.task-assignment-response {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: .62rem;
  font-weight: 650;
  white-space: nowrap;
}
.task-assignment-response.is-accepted,
.task-assignment-response.is-in_progress,
.task-assignment-response.is-finished {
  border-color: color-mix(in srgb, var(--state-success) 36%, var(--border-subtle));
  color: var(--state-success);
}
.task-assignment-response.is-declined {
  border-color: color-mix(in srgb, var(--state-danger) 40%, var(--border-subtle));
  color: var(--state-danger);
}
.task-board-column-empty {
  font-size: 0.78rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.35));
  padding: 16px 8px;
  text-align: center;
  border: 1px dashed var(--border-subtle, rgba(229, 231, 235, 0.1));
  border-radius: 8px;
}

/* Drawer -------------------------------------------------------------- */
.task-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(820px, 94vw);
  background: var(--bg-deep, #08080f);
  border-left: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.08));
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
  z-index: 80;
  display: flex;
  flex-direction: column;
  animation: task-drawer-in 220ms cubic-bezier(0.22, 0.9, 0.32, 1);
  min-height: 0;
}
@keyframes task-drawer-in {
  from { transform: translateX(40px); opacity: 0.4; }
  to { transform: translateX(0); opacity: 1; }
}

.task-drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 22px;
  border-bottom: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.06));
  flex: 0 0 auto;
  position: relative;
}
.task-drawer-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.task-drawer-breadcrumb {
  font-size: 0.74rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.4));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.task-drawer-breadcrumb-sep { color: var(--text-soft, rgba(229, 231, 235, 0.3)); font-size: 0.78rem; }
.task-drawer-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary, #f1f5f9);
  padding: 1px 7px;
  background: var(--bg-elevated, rgba(255,255,255,0.04));
  border-radius: 5px;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
}
.task-drawer-type,
.task-drawer-status,
.task-drawer-priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
  background: var(--bg-elevated, rgba(255,255,255,0.04));
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
}
.task-drawer-priority { letter-spacing: 0.02em; }

.task-drawer-head-actions { display: inline-flex; align-items: center; gap: 6px; }
.task-drawer-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
  color: var(--text-primary, #e7e7ee);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.task-drawer-mini-btn:hover {
  background: color-mix(in srgb, var(--text-primary, #fff) 8%, var(--bg-elevated, rgba(255,255,255,0.04)));
}
.task-drawer-mini-btn.primary {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: rgba(34, 197, 94, 0.6);
  color: #fff;
}
.task-drawer-mini-btn.primary:hover { filter: brightness(1.08); }
.task-drawer-mini-btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-soft, rgba(229, 231, 235, 0.55));
}
.task-drawer-mini-btn.ghost:hover { color: var(--text-primary, #fff); background: color-mix(in srgb, var(--text-primary, #fff) 6%, transparent); }
.task-drawer-close {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 0;
  color: var(--text-soft, rgba(229, 231, 235, 0.55));
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.task-drawer-close:hover { background: color-mix(in srgb, var(--text-primary, #fff) 8%, transparent); color: var(--text-primary, #fff); }

.task-drawer-title {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text-primary, #f1f5f9);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  outline: none;
  padding: 14px 22px 8px;
  flex: 0 0 auto;
}
.task-drawer-title:focus { background: color-mix(in srgb, var(--tasks-accent) 6%, transparent); }

.task-drawer-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.task-drawer-main {
  flex: 1;
  padding: 6px 22px 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  scrollbar-width: thin;
}
.task-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-drawer-section h4 {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft, rgba(229, 231, 235, 0.45));
  font-weight: 700;
}
.task-drawer-tabs {
  display: flex;
  gap: 2px;
  padding: 0;
  border-bottom: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.06));
  overflow-x: auto;
  scrollbar-width: none;
}
.task-drawer-tabs::-webkit-scrollbar { display: none; }
.task-drawer-tab {
  background: transparent;
  border: 0;
  color: var(--text-soft, rgba(229, 231, 235, 0.55));
  font-size: 0.78rem;
  font-weight: 500;
  padding: 9px 12px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease;
}
.task-drawer-tab:hover { color: var(--text-primary, #fff); }
.task-drawer-tab.is-active {
  color: var(--text-primary, #fff);
  border-bottom-color: var(--tasks-accent);
}
.task-drawer-tab-body { padding: 6px 0; min-height: 200px; }

.task-drawer-sidebar {
  width: 280px;
  flex: 0 0 280px;
  border-left: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.06));
  padding: 12px 16px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: color-mix(in srgb, var(--bg-base, #050507) 60%, transparent);
}
.task-drawer-sidebar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.04));
}
.task-drawer-sidebar-row:last-child { border-bottom: 0; }
.task-drawer-sidebar-label {
  color: var(--text-soft, rgba(229, 231, 235, 0.45));
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.task-drawer-sidebar-control { display: flex; flex-direction: column; gap: 4px; }
.task-drawer-input,
.task-drawer-select {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.1));
  background: var(--bg-elevated, rgba(255, 255, 255, 0.03));
  color: var(--text-primary, #f1f5f9);
  font-size: 0.82rem;
}
.task-drawer-input.small { width: 90px; }
.task-drawer-input:focus,
.task-drawer-select:focus {
  outline: none;
  border-color: var(--tasks-accent);
  background: color-mix(in srgb, var(--tasks-accent) 6%, var(--bg-elevated, rgba(255,255,255,0.03)));
}

.task-people-picker { display: flex; flex-direction: column; gap: 6px; }
.task-people-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.task-people-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  padding: 2px 4px 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--tasks-accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tasks-accent) 38%, transparent);
  color: #ddd6fe;
  font-weight: 500;
}
.task-people-chip button {
  background: transparent; border: 0; color: inherit; cursor: pointer; padding: 0 4px;
  border-radius: 4px;
  line-height: 1;
}
.task-people-chip button:hover { background: rgba(0, 0, 0, 0.3); }
.task-tag-add { display: flex; gap: 4px; }
.task-recurring { display: flex; gap: 6px; align-items: center; }

.task-comments { display: flex; flex-direction: column; gap: 12px; }
.task-comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.task-comment {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.04));
}
.task-comment-avatar { width: 28px; height: 28px; margin: 0; border-width: 0; font-size: 0.72rem; }
.task-comment-body-wrap { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-comment-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem;
}
.task-comment-meta strong { color: var(--text-primary, #f1f5f9); font-weight: 600; }
.task-comment-time { color: var(--text-soft, rgba(229, 231, 235, 0.45)); font-size: 0.7rem; }
.task-comment-edited {
  font-size: 0.66rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.4));
  font-style: italic;
}
.task-comment-body { margin: 0; font-size: 0.84rem; line-height: 1.5; color: var(--text-primary, #e7e7ee); white-space: pre-wrap; word-wrap: break-word; }
.task-comment-empty {
  list-style: none;
  text-align: center;
  padding: 24px 8px;
  color: var(--text-soft, rgba(229, 231, 235, 0.4));
  font-size: 0.82rem;
  border: 1px dashed var(--border-subtle, rgba(229, 231, 235, 0.08));
  border-radius: 10px;
}
.task-comments-foot { display: flex; justify-content: flex-end; }

.task-activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; position: relative; }
.task-activity::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-subtle, rgba(229, 231, 235, 0.08));
}
.task-activity-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 0.78rem;
  padding: 4px 0;
  position: relative;
}
.task-activity-row::before {
  content: "";
  position: relative;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tasks-accent);
  margin-left: 3px;
  box-shadow: 0 0 0 3px var(--bg-deep, #08080f);
}
.task-activity-actor { color: var(--text-primary, #f1f5f9); font-weight: 600; }
.task-activity-kind { color: var(--text-soft, rgba(229, 231, 235, 0.7)); }
.task-activity-time { color: var(--text-soft, rgba(229, 231, 235, 0.45)); font-size: 0.7rem; text-align: right; }

.task-subtasks { display: flex; flex-direction: column; gap: 8px; }
.task-subtasks-add { display: flex; gap: 6px; }
.task-subtasks-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task-subtasks-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 6px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.04));
  cursor: pointer;
  font-size: 0.84rem;
  transition: background 100ms ease, border-color 100ms ease;
}
.task-subtasks-row:hover {
  background: color-mix(in srgb, var(--tasks-accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--tasks-accent) 30%, transparent);
}
.task-subtasks-meta { color: #4ade80; font-weight: 700; }

.task-checklist { display: flex; flex-direction: column; gap: 6px; }
.task-checklist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task-checklist-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 0.84rem;
  transition: background 100ms ease;
}
.task-checklist-row:hover { background: color-mix(in srgb, var(--text-primary, #fff) 4%, transparent); }
.task-checklist-row.is-done span:nth-child(2) { text-decoration: line-through; color: var(--text-soft, rgba(229, 231, 235, 0.4)); }
.task-checklist-row input[type="checkbox"] { accent-color: var(--tasks-accent); width: 14px; height: 14px; }
.task-checklist-row > span { flex: 1; }

.task-attachments { display: flex; flex-direction: column; gap: 8px; }
.task-attachments-file {
  font-size: 0.78rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.6));
  padding: 6px;
  border-radius: 8px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  border: 1px dashed var(--border-subtle, rgba(229, 231, 235, 0.15));
}
.task-attachments-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.task-attachments-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-radius: 6px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  font-size: 0.82rem;
}
.task-attachments-row a { color: #93c5fd; text-decoration: none; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-attachments-row a:hover { text-decoration: underline; }
.task-attachments-meta { font-size: 0.7rem; color: var(--text-soft, rgba(229, 231, 235, 0.45)); }

.task-time { display: flex; flex-direction: column; gap: 8px; }
.task-time-total { margin: 0; font-size: 0.84rem; color: var(--text-soft, rgba(229, 231, 235, 0.7)); }
.task-time-total strong { color: var(--text-primary, #f1f5f9); }
.task-time-add { display: flex; gap: 6px; flex-wrap: wrap; }
.task-time-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task-time-row {
  display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  font-size: 0.82rem;
  align-items: center;
}
.task-time-note { color: var(--text-soft, rgba(229, 231, 235, 0.7)); }
.task-time-time { color: var(--text-soft, rgba(229, 231, 235, 0.45)); font-size: 0.7rem; text-align: right; }

.task-dependencies { display: flex; flex-direction: column; gap: 10px; }
.task-dependencies h5 { margin: 6px 0 0; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft, rgba(229, 231, 235, 0.5)); font-weight: 600; }
.task-deps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.task-deps-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.02));
  font-size: 0.82rem;
}
.task-deps-kind {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 7px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--tasks-accent) 22%, transparent);
  color: #c4b5fd;
  font-weight: 600;
}
.task-deps-add { display: flex; flex-direction: column; gap: 6px; }
.task-deps-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.task-deps-result {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 6px; background: var(--bg-elevated, rgba(255,255,255,0.02));
  font-size: 0.8rem;
}

.task-custom-fields { display: flex; flex-direction: column; gap: 10px; }
.task-custom-field-row { display: flex; flex-direction: column; gap: 4px; }

.task-drawer-skeleton {
  padding: 80px 20px;
  text-align: center;
  color: var(--text-soft, rgba(229, 231, 235, 0.5));
  font-size: 0.84rem;
}

/* Calendar task strip ----------------------------------------------- */
.property-calendar-task-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle, rgba(229, 231, 235, 0.08));
  background: color-mix(in srgb, var(--bg-elevated, #1a1a22) 80%, transparent);
  border-radius: 12px;
  flex-wrap: wrap;
}
.property-calendar-task-strip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.property-calendar-task-strip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--tasks-accent), #ec4899);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0;
}
.property-calendar-task-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
/* (legacy .property-calendar-task-chip duplicate removed — canonical
   rules live further down under "FULL-HEIGHT TASK CHIP".) */
.property-calendar-task-chip-due {
  font-size: 0.66rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.5));
  margin-left: 2px;
}
.property-calendar-task-strip-more {
  font-size: 0.72rem;
  color: var(--text-soft, rgba(229, 231, 235, 0.7));
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.property-calendar-task-strip-more:hover { background: color-mix(in srgb, var(--bg-elevated, #232331) 60%, white 8%); }
.property-calendar-task-strip-hint {
  flex: 1;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
  min-width: 200px;
}
.property-calendar-task-strip-new {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 11px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.property-calendar-task-strip-new:hover {
  background: var(--text-primary);
  color: var(--bg-base);
  border-color: var(--text-primary);
}
.property-calendar-task-strip-new.is-active {
  background: color-mix(in srgb, var(--state-error) 18%, var(--bg-input));
  border-color: color-mix(in srgb, var(--state-error) 50%, transparent);
  color: var(--state-error);
}

/* Light theme overrides --------------------------------------------- */
[data-theme="light"] .task-drawer {
  background: #fff;
  box-shadow: -24px 0 60px rgba(15, 23, 42, 0.18);
}
[data-theme="light"] .task-drawer-sidebar {
  background: rgba(15, 23, 42, 0.02);
}
[data-theme="light"] .task-board-card { background: #fff; }
[data-theme="light"] .task-board-column { background: rgba(15, 23, 42, 0.025); }
[data-theme="light"] .tasks-toolbar {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .tasks-shell { background: #f6f7fb; }
[data-theme="light"] .tasks-group-rows {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .task-row { border-bottom-color: rgba(15, 23, 42, 0.05); }
[data-theme="light"] .task-row:hover {
  background: color-mix(in srgb, var(--tasks-accent) 5%, transparent);
}
[data-theme="light"] .task-board-card,
[data-theme="light"] .task-comment,
[data-theme="light"] .task-subtasks-row,
[data-theme="light"] .task-attachments-row,
[data-theme="light"] .task-time-row,
[data-theme="light"] .task-deps-row {
  border-color: rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .task-row-due[data-due="overdue"] { color: #dc2626; }
[data-theme="light"] .task-row-due[data-due="today"] { color: #d97706; }
[data-theme="light"] .task-row-due[data-due="soon"] { color: #2563eb; }

/* ======================================================================
 * Task modal — ClickUp-style full-page task view (left activity, right body)
 * ====================================================================== */

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: stretch;
  justify-content: center;
  animation: tasks-pop 180ms ease;
}
/* Pane mode — same component, embedded inside the properties
   right pane (.workspace-property-nav-pane) instead of overlaying
   the viewport. Drops the overlay + fixed positioning so the same
   chrome lives within whatever container portals it in. */
.task-modal.task-modal--pane {
  position: absolute;
  inset: 0;
  z-index: 30;
  animation: support-pane-in 140ms ease-out;
}
.task-modal.task-modal--pane .task-modal-frame {
  margin: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
/* Pane mode lives in a narrower column than the modal — collapse the
   left activity rail into the narrow-tab toggle even on wide screens
   so the body has room to breathe. */
.task-modal.task-modal--pane .task-modal-narrow-tabs { display: inline-flex; }
.task-modal.task-modal--pane .task-modal-side {
  position: absolute;
  inset: 44px 0 0 0;
  z-index: 5;
  background: var(--bg-elevated);
  display: none;
  /* Override the inline-column width (360px) — pane-mode side is a
     full-cover overlay, otherwise narrow panes show a sliver of the
     details column on the right edge ("semi-exposed comments"). */
  width: auto;
  flex: initial;
  border-right: 0;
}
.task-modal.task-modal--pane.is-showing-activity .task-modal-side { display: flex; }
.task-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.task-modal-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 16px;
  width: min(1320px, calc(100vw - 32px));
  height: calc(100vh - 32px);
  border-radius: 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  /* Container query parent for the topbar/cluster/comments — every
     responsive switch inside the drawer keys off this so behaviour
     is identical whether we're rendered as a full-screen modal or
     embedded in a 360px right pane. */
  container-type: inline-size;
  container-name: task-modal;
}
@media (max-width: 900px) {
  .task-modal-frame { margin: 0; width: 100vw; height: 100vh; border-radius: 0; }}
.task-modal-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-size: 0.85rem;
}
.task-modal-load-error {
  flex: 1;
  min-height: 220px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.task-modal-load-error strong { color: var(--text-primary); font-size: 1rem; }
.task-modal-load-error > span { max-width: 420px; color: var(--text-muted); font-size: .8rem; line-height: 1.5; }
.task-modal-load-error > div { display: flex; gap: 8px; margin-top: 8px; }

/* Topbar -------------------------------------------------------- */
.task-modal-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  flex: 0 0 auto;
  height: 44px;
}
.task-modal-crumbs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.task-modal-crumb {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}
.task-modal-crumb-sep { color: var(--text-muted); font-size: 0.85rem; }
.task-modal-crumb-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-soft);
  padding: 1px 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  /* "T-18" was wrapping to "T-" over "18" once the top bar got tight, which
     made a two-line lump of the one thing in that bar that identifies the task. */
  white-space: nowrap;
  flex: 0 0 auto;
}
.task-modal-narrow-tabs { display: none; }
/* Reveal the Details / Activity tabs whenever the modal/pane itself
   is too narrow to host both columns side-by-side, regardless of
   viewport. Pane mode also force-shows them via the rule below. */
@container task-modal (max-width: 900px) {
  .task-modal-narrow-tabs { display: inline-flex; gap: 2px; }
}
@media (max-width: 900px) {
  .task-modal-narrow-tabs { display: inline-flex; gap: 2px; }}
/* On a phone the bar has to carry the crumb, both tabs and four actions, and it
   does not fit: the crumbs box was squeezed to 61px while "T-18" inside it kept
   its own width, so the tag ran 29px past its container and under the Details
   tab. Drop the word "Tasks" — you are on the Tasks page, and the tag is the
   part that says WHICH task — and stop the crumbs box shrinking under its
   remaining content. */
@media (max-width: 560px) {
  .task-modal-crumb,
  .task-modal-crumb-sep {
    display: none;
  }
  .task-modal-crumbs {
    flex: 0 0 auto;
    min-width: auto;
  }
}
.task-modal-narrow-tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 5px 10px;
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}
.task-modal-narrow-tab.is-active {
  background: var(--bg-input);
  color: var(--text-primary);
}
.task-modal-narrow-count {
  margin-left: 4px;
  background: var(--border-subtle);
  border-radius: 999px;
  padding: 0 5px;
  font-size: 0.66rem;
  color: var(--text-soft);
}
.task-modal-topbar-actions { display: inline-flex; align-items: center; gap: 4px; }
.task-modal-divider { width: 1px; height: 16px; background: var(--border-subtle); margin: 0 2px; }
.task-modal-recurrence-warning {
  padding: 7px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--state-warning) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 10%, var(--bg-elevated));
  color: var(--text-primary);
  font-size: 0.75rem;
  line-height: 1.4;
  flex: 0 0 auto;
}
.task-modal-completed-edit-note {
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--state-success) 8%, var(--bg-elevated));
  color: var(--text-soft);
  font-size: 0.75rem;
  line-height: 1.4;
  flex: 0 0 auto;
}
.task-modal-completed-edit-note a {
  color: var(--accent-bright);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.task-modal-photo-quick-add {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  color: var(--text-primary);
  cursor: pointer;
  flex: 0 0 auto;
}
.task-modal-photo-quick-add:hover,
.task-modal-photo-quick-add:focus-within {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
}
.task-modal-photo-quick-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  flex: 0 0 auto;
}
.task-modal-photo-quick-add-copy { display: grid; gap: 1px; min-width: 0; }
.task-modal-photo-quick-add-copy strong { font-size: 0.82rem; }
.task-modal-photo-quick-add-copy span {
  color: var(--text-muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-modal-upload-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, 220px) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  color: var(--text-primary);
  font-size: 0.76rem;
}
.task-modal-upload-status.is-error {
  background: color-mix(in srgb, var(--state-danger) 9%, var(--bg-elevated));
  color: var(--state-danger);
}
.task-modal-upload-status.is-summary {
  grid-template-columns: minmax(0, 1fr) auto;
}
.task-modal-upload-status.is-warning {
  background: color-mix(in srgb, var(--state-warning) 12%, var(--bg-elevated));
  color: var(--text-primary);
}
.task-modal-warning-actions { display: inline-flex; justify-content: flex-end; gap: 8px; }
.task-modal-warning-actions button:last-child {
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--state-warning);
  color: var(--bg-deep);
}
.task-modal-upload-status > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-modal-upload-track {
  display: block;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-subtle);
}
.task-modal-upload-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}
.task-modal-upload-status button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
@container task-modal (max-width: 520px) {
  .task-modal-upload-status {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .task-modal-upload-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Mark Complete: when the topbar collapses below ~520px container
   width, ditch the label and let the tick speak for itself rather
   than wrap onto two lines (which looked broken in the right pane). */
.task-modal-complete-btn { white-space: nowrap; }
@container task-modal (max-width: 520px) {
  .task-modal-complete-btn .task-modal-complete-label { display: none; }
  .task-modal-complete-btn { padding-left: 8px; padding-right: 8px; }}

/* Topbar overflow (kebab) menu — replaces the previously unlabelled
   Duplicate icon with a clear "more actions" surface. Sits on top of
   any cluster popover via z-index 5. */
.task-modal-overflow {
  position: relative;
  display: inline-flex;
}
/* Force the kebab dots to use the foreground primary color so the
   button is visible regardless of the muted color used by the
   sibling icon-btns. */
.task-modal-overflow-btn { color: var(--text-primary); }
.task-modal-overflow-btn:hover { color: var(--text-primary); }
/* Delete-confirmation overlay. Sized to feel substantial without
   reaching corner-to-corner — destructive actions deserve a beat
   to read the body before clicking. Lives inside the topbar
   container as a portal-equivalent because the topbar is the only
   stacking-context-creator inside the task modal that we trust to
   be above everything else. */
.task-modal-confirm-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, #000 50%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: task-modal-confirm-overlay-in 100ms ease-out;
}
@keyframes task-modal-confirm-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.task-modal-confirm {
  width: min(420px, calc(100% - 32px));
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: task-modal-confirm-in 140ms ease-out;
}
@keyframes task-modal-confirm-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.task-modal-confirm-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.task-modal-confirm-body {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-soft);
}
.task-modal-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.task-modal-pill-btn--danger {
  background: #b91c1c !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}
.task-modal-pill-btn--danger:hover {
  background: #991b1b !important;
}
.task-modal-overflow-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
}
.task-modal-overflow-dot {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: var(--text-primary);
  display: inline-block;
}
.task-modal-overflow-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft, 0 8px 24px rgba(0, 0, 0, 0.32));
  animation: tasks-pop 120ms ease-out;
}
.task-modal-overflow-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.task-modal-overflow-item:hover {
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
}
.task-modal-overflow-item.is-danger { color: #ef4444; }
.task-modal-overflow-item.is-danger:hover {
  background: color-mix(in srgb, #ef4444 14%, transparent);
}
.task-modal-overflow-sep {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 2px;
}
.task-modal-icon-btn {
  width: 26px; height: 26px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.task-modal-icon-btn:hover {
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  color: var(--text-primary);
}
.task-modal-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 5px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
}
.task-modal-pill-btn:hover {
  background: color-mix(in srgb, var(--text-primary) 7%, var(--bg-input));
}
.task-modal-pill-btn.primary {
  background: var(--state-success);
  border-color: color-mix(in srgb, var(--state-success) 70%, transparent);
  color: #04130b;
  font-weight: 600;
}
.task-modal-pill-btn.primary:hover { filter: brightness(1.05); }
.task-modal-pill-btn.primary:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }
.task-modal-pill-btn.small { height: 22px; padding: 0 8px; font-size: 0.7rem; }

/* Two-column body ------------------------------------------------- */
.task-modal-cols {
  flex: 1;
  display: flex;
  min-height: 0;
}
/* Create (draft) mode — the inline validation line under the title. The
   activity rail simply unmounts in draft, and flex gives main the row. */
.task-modal-create-err { margin: 2px 0 0; font-size: 0.8rem; color: var(--state-danger, #dc2626); }
.task-modal-side {
  width: 360px;
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.task-modal-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  scrollbar-width: thin;
  background: var(--bg-deep);
}
.task-modal-main-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 22px 28px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 1180px) {
  .task-modal-side { width: 320px; flex-basis: 320px; }}
@media (max-width: 1024px) {
  .task-modal-main-inner { padding: 20px 22px 60px; }}
@media (max-width: 900px) {
  .task-modal-cols { flex-direction: row; }
  .task-modal-side {
    position: absolute;
    inset: 44px 0 0 0;
    width: 100%;
    flex: 0 0 auto;
    z-index: 4;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    border-right: 0;
  }
  .task-modal.is-showing-activity .task-modal-side { transform: translateX(0); }
  .task-modal-main { width: 100%; }}

/* Container-query mirror of the rule above. The drawer is also
   embedded in the resizable property right pane (mode="pane"), where
   the user can drag the column down to ~280px. Viewport-based @media
   queries don't fire in that case (the viewport is still 1920px) so
   we'd end up with 360px of side-rail eating the main column.
   Switching on container width fixes that: the side becomes a
   full-cover overlay any time the drawer itself is < 900px,
   regardless of viewport. */
@container task-modal (max-width: 900px) {
  .task-modal-cols { flex-direction: row; }
  .task-modal-side {
    position: absolute;
    inset: 44px 0 0 0;
    width: 100%;
    flex: 0 0 auto;
    z-index: 6;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    border-right: 0;
    background: var(--bg-elevated);
  }
  .task-modal.is-showing-activity .task-modal-side { transform: translateX(0); }
  .task-modal-main { width: 100%; }
}

/* Head: type pill + title --------------------------------------- */
.task-modal-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.task-modal-typestrip { position: relative; align-self: flex-start; }
.task-modal-typestrip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
}
.task-modal-typestrip-trigger:hover { color: var(--text-primary); }
.task-modal-typestrip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}
.task-modal-typestrip-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow: var(--shadow-soft);
  min-width: 180px;
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.task-modal-typestrip-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  border-radius: 4px;
}
.task-modal-typestrip-opt:hover { background: var(--bg-input); }

.task-modal-title {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  outline: none;
  padding: 2px 0;
  line-height: 1.25;
  /* It is a textarea now so a long title wraps instead of being cut off. The
     resize handle and scrollbar would both give away that it is not the plain
     heading it looks like; JS sets the height to fit the content. */
  resize: none;
  overflow: hidden;
  font-family: inherit;
  display: block;
  /* A long unbroken token (a URL, a reference) still has to go somewhere. */
  overflow-wrap: anywhere;
}
/* The heading is set in a big face, and 1.55rem eats 27 characters of a phone
   before it wraps. Two lines of a readable size beats four of a huge one. */
@media (max-width: 560px) {
  .task-modal-title {
    font-size: 1.25rem;
  }
}
.task-modal-title::placeholder { color: var(--text-muted); }
.task-modal-title:focus { color: var(--text-primary); }

/* Cluster (meta chip row) -------------------------------------- */
.task-modal-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin: -4px 0 0;
  /* Container query parent: lets us collapse secondary chips into the
     `.task-modal-cluster-more` button at narrow widths regardless of
     viewport size, which matters because the same TaskDrawer is also
     embedded in the resizable property right-pane. The SOP for any
     shrunken-form layout going forward is: tag the parent as a
     container with @container size queries → mark "primary" fields as
     always-visible → push "secondary" fields behind a + More menu. */
  container-type: inline-size;
  container-name: task-cluster;
}
fieldset.task-modal-cluster {
  min-inline-size: 0;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
}
.task-modal-cluster-secondary {
  display: contents;
}
/* The overflow More button mirrors the chip language — same height,
   same colour vocabulary — so it doesn't read as a separate UI
   surface when it appears. Hidden by default; the @container rule
   below reveals it once the cluster is too narrow for inline chips. */
.task-modal-cluster-more {
  position: relative;
  display: none;
}
.task-modal-cluster-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  background: transparent;
  border: 1px dashed var(--border-subtle);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.task-modal-cluster-more-btn:hover {
  background: var(--bg-input);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.task-modal-cluster-more-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 240px;
  padding: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-modal-cluster-more-row {
  display: flex;
  align-items: center;
  /* Inside the popover the chips have all the room they need — drop
     the inline-row right-margin so the value can use the full width
     instead of being truncated. */
  margin: 0;
}
.task-modal-cluster-more-row .task-modal-chip { margin-right: 0; }

/* Below 480px container width, hide the secondary chips inline and
   surface them through the More menu instead. This is the SOP for
   responsive forms: collapse, don't wrap. */
@container task-cluster (max-width: 480px) {
  .task-modal-cluster-secondary { display: none; }
  .task-modal-cluster-more { display: inline-flex; }
}
.task-modal-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 0;
  margin-right: 12px;
  min-height: 30px;
  font-size: 0.78rem;
}
.task-modal-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.74rem;
  white-space: nowrap;
}
.task-modal-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* 🔴 The field label is VISIBLE — icon AND word.
   This button used to be a 22px icon-only square with the name in a tooltip.
   Eight of them in a row gave Hakim (2026-07-27) "the fields are all over the
   place and ugly with shitty repetitive icons everywhere": a line of
   interchangeable 14px grey shapes, each needing a hover to identify. The
   glyphs are also now 16px, which is the project floor for an inline icon
   (memory/fb_ui_craft.md §3) — 14px was under it. */
.task-modal-chip-iconbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 5px 0 3px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.task-modal-chip-iconbtn:hover { background: var(--bg-input); color: var(--text-primary); }
.task-modal-chip-iconbtn:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 1px;
}
.task-modal-chip-iconbtn svg { width: 16px; height: 16px; }
/* The field's name. Separate from .task-modal-chip-label (which TaskBlocks
   uses as a whole labelled wrapper) because here the button IS the label. */
.task-modal-chip-labeltext { line-height: 1; }

/* The stack avatars overlap, so each face needs its own positioned wrapper —
   ContactAvatar draws the disc itself and must not also own the margin. */
.task-modal-stack-avatar-wrap {
  display: inline-flex;
  margin-left: -4px;
}
.task-modal-stack-avatar-wrap:first-child { margin-left: 0; }
.task-modal-stack-group {
  width: 22px;
  height: 22px;
  margin-left: -4px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  flex-shrink: 0;
}
.task-modal-stack-group:first-child { margin-left: 0; }
.task-group-assignment-list {
  display: grid;
  gap: 0.3rem;
  margin-top: 0.15rem;
}
.task-group-assignment {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.38rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.task-group-assignment-name {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 750;
}
.task-group-assignment-state {
  min-width: 0;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-group-assignment-action {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  padding: 0.22rem 0.42rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.task-group-assignment-action:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.task-group-assignment-action.is-primary {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.task-contractors {
  margin: 10px 0 18px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-muted);
}

.task-contractors-head,
.task-contractor-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-contractors-head {
  justify-content: space-between;
  margin-bottom: 8px;
}

.task-contractors-head > div:first-child {
  display: grid;
  gap: 2px;
}

.task-contractors-head strong { font-size: 13px; color: var(--text-primary); }
.task-contractors-head span { font-size: 11px; color: var(--text-secondary); }
.task-contractors-picker-wrap { position: relative; }
.task-contractors-picker-wrap .task-group-assignment-action { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

.task-contractors-picker {
  right: 0;
  left: auto;
  width: min(360px, calc(100vw - 32px));
  z-index: 80;
}
.task-contractors-picker.is-inline {
  position: static;
  width: 100%;
  max-height: none;
  margin-top: 10px;
  overflow: visible;
  box-shadow: none;
}
.task-contractors-picker.is-inline .properties-tag-picker-list {
  max-height: min(280px, 42dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.task-contractors-search { display: flex; align-items: center; gap: 7px; padding: 10px 10px 0; }
.task-contractors-search .filter-input { flex: 1; min-width: 0; }
.task-contractors-search-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  color: var(--danger);
  font-size: 12px;
}
.task-contractors-search-error button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border-subtle));
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.task-contractors-share-options { display: grid; gap: 5px; padding: 10px; border-bottom: 1px solid var(--border-subtle); }
.task-contractors-share-options label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-secondary); }
.task-contractors-option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; width: 100%; }
.task-contractors-option > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; text-align: left; }
.task-contractors-option small { font-size: 10px; color: var(--text-tertiary); }
.task-contractors-new { display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px; border: 0; border-top: 1px solid var(--border-subtle); background: transparent; color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }

.task-contractor-row { padding: 9px 0; border-top: 1px solid var(--border-subtle); }
.task-contractor-identity { display: grid; gap: 2px; min-width: 0; flex: 1; }
.task-contractor-identity strong { overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--text-primary); }
.task-contractor-identity small { display: flex; align-items: center; gap: 3px; font-size: 10px; color: var(--text-secondary); }
.task-contractor-actions { display: flex; align-items: center; gap: 3px; }
.task-contractor-actions button { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 5px 7px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 10px; cursor: pointer; }
.task-contractor-actions button:hover { color: var(--text-primary); border-color: var(--border-strong); }
.task-contractor-actions button:disabled { opacity: .45; cursor: default; }
.task-contractor-actions button.is-remove { color: var(--danger); }
.task-contractors-empty { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--text-tertiary); font-size: 12px; }
.task-contractors-notice { display: flex; align-items: center; gap: 5px; margin: 8px 0 0; color: var(--success); font-size: 11px; }
.task-contractors-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 11px;
}
.task-contractors-error button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border-subtle));
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.task-contractors-modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px; }
.task-contractors-modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(7, 10, 16, .62); }
.task-contractors-modal-card { position: relative; z-index: 1; width: min(720px, 100%); max-height: min(760px, calc(100dvh - 40px)); overflow: auto; }

/* Calendar assignment display + editor. The facepile is intentionally tiny on
   task bars: it answers "who?" without making the task title or date illegible.
   The same editor is portalled from desktop and phone, so assignment semantics
   never depend on which calendar the operator happened to open. */
.task-assignee-facepile {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}
.task-assignee-facepile > * {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 auto;
  margin-left: -5px;
  border: 1.5px solid var(--bg-elevated);
  border-radius: 50%;
  object-fit: cover;
}
.task-assignee-facepile > :first-child { margin-left: 0; }
.task-assignee-facepile-avatar { display: block; }
.task-assignee-facepile-group,
.task-assignee-facepile-initials,
.task-assignee-facepile-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 26%, var(--bg-elevated));
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1;
}
.task-assignee-facepile-group { border-radius: 4px; }
.task-assignee-facepile-initials {
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 32%, var(--bg-elevated));
}
.task-assignee-facepile-more {
  padding: 0 3px;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.task-assignment-modal {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: grid;
  place-items: center;
  padding: 20px;
}
.task-assignment-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(5, 8, 14, .7);
  backdrop-filter: blur(4px);
}
.task-assignment-modal-card {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(780px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
}
.task-assignment-modal-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.task-assignment-modal-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}
.task-assignment-modal-head > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.task-assignment-modal-head small {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.task-assignment-modal-head strong { color: var(--text-primary); font-size: 16px; }
.task-assignment-modal-head em {
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-assignment-modal-head > button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}
.task-assignment-modal-body {
  display: grid;
  gap: 14px;
  max-height: calc(min(780px, 100dvh - 40px) - 78px);
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.task-assignment-internal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-panel);
}
.task-assignment-internal > div:first-child { display: grid; gap: 3px; }
.task-assignment-internal strong { color: var(--text-primary); font-size: 13px; }
.task-assignment-internal span { color: var(--text-secondary); font-size: 11px; }
.task-assignment-picker { position: relative; min-width: 94px; }
.task-assignment-picker.is-saving { pointer-events: none; opacity: .72; }
.task-assignment-saving { position: absolute; right: -3px; top: -6px; color: var(--accent); }
.task-assignment-loading { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--text-tertiary); font-size: 12px; }
.task-assignment-error {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}
.task-assignment-error button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border-subtle));
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .task-assignment-modal {
    align-items: stretch;
    padding: env(safe-area-inset-top) 0 0;
  }
  .task-assignment-modal-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100dvh - env(safe-area-inset-top));
    max-height: none;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .task-assignment-modal-head { flex: 0 0 auto; }
  .task-assignment-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
  .task-assignment-internal { grid-template-columns: minmax(0, 1fr); }
  .task-assignment-picker { justify-self: stretch; }
  .task-assignment-picker .task-modal-picker-empty {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
  }
  .task-assignment-modal .task-contractors-head { align-items: flex-start; }
  .task-assignment-modal .task-contractors-picker-wrap { width: 100%; }
  .task-assignment-modal .task-group-assignment-action { width: 100%; justify-content: center; min-height: 42px; }
  .task-assignment-modal .task-contractors-picker.is-inline { width: 100%; }
}

@media (max-width: 720px) {
  .task-contractors-head { align-items: flex-start; }
  .task-contractor-row { align-items: flex-start; flex-wrap: wrap; }
  .task-contractor-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 40px;
  }
  .task-contractor-actions button { justify-content: center; }
  .task-contractors-modal { align-items: end; padding: 0; }
  .task-contractors-modal-card { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; }
}
.task-modal-chip-value {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.task-modal-chip-input,
.task-modal-chip-select {
  height: 24px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  width: auto;
  min-width: 70px;
  max-width: 200px;
  transition: background 100ms ease, border-color 100ms ease;
}
.task-modal-chip-input:hover,
.task-modal-chip-select:hover {
  background: var(--bg-input);
}
.task-modal-chip-input:focus,
.task-modal-chip-select:focus {
  outline: none;
  background: var(--bg-input);
  border-color: var(--border-strong);
}
.task-modal-chip-input::placeholder { color: var(--text-muted); }
.task-modal-chip-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 10 10' fill='%238a8a93'%3E%3Cpath d='M2 4l3 3 3-3z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 18px;
}
.task-modal-chip-select option { background: var(--bg-elevated); color: var(--text-primary); }

/* Date range popover ------------------------------------------ */
.task-date-pop { position: relative; }
.task-date-pop-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
.task-date-pop-trigger:hover {
  background: var(--bg-input);
}
.task-date-pop-trigger.is-empty { color: var(--text-muted); }
.task-date-pop-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 340px;
  max-width: calc(100vw - 24px);
  max-height: min(560px, calc(100vh - 32px));
  overflow-y: auto;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.task-row-dates .task-date-pop-panel {
  right: 0;
  left: auto;
}
.task-date-pop-fieldset {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  border: 0;
  padding: 0;
  margin: 0;
}
.task-date-pop-heading {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}
.task-date-pop-pair {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.task-date-pop-input {
  height: 36px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.84rem;
  font-family: inherit;
  width: 100%;
}
.task-date-pop-input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.task-date-pop-add-time {
  min-height: 36px;
  border-radius: 7px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.task-date-pop-add-time:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-input);
}
.task-date-pop-mode-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.task-date-pop-link {
  width: max-content;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.task-date-pop-link:hover { text-decoration: underline; }
.task-date-pop-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-soft);
  cursor: pointer;
}
.task-date-pop-checkbox input { margin: 0; }
.task-date-pop-divider { height: 1px; background: var(--border-subtle); margin: 2px 0; }
.task-date-pop-recur {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 18px;
}
.task-date-pop-recur-prefix { font-size: 0.78rem; color: var(--text-muted); }
.task-date-pop-recur-num { width: 50px; }
.task-date-pop-recur-help {
  margin: -4px 0 0 18px;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.4;
}
.task-date-pop-error {
  margin: 0;
  color: var(--state-error);
  font-size: 0.76rem;
}
.task-date-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.task-date-pop-clear,
.task-date-pop-done {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-soft);
  font-size: 0.76rem;
  cursor: pointer;
}
.task-date-pop-clear:disabled { opacity: 0.5; cursor: default; }
.task-date-pop-done {
  border-color: transparent;
  background: var(--text-primary);
  color: var(--bg-base);
  font-weight: 500;
}
.task-date-pop-done:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 700px) {
  .task-date-pop-panel,
  .task-row-dates .task-date-pop-panel {
    position: fixed;
    z-index: 120;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    top: auto;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  .task-date-pop-pair { align-items: stretch; }
  .task-date-pop-mode-links { align-items: flex-start; }
  .task-date-pop-link { min-height: 32px; text-align: left; }
}

/* Pickers in cluster ---------------------------------------- */
.task-modal-picker {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.task-modal-picker-tags { gap: 4px; }
.task-modal-picker-stack { display: inline-flex; align-items: center; }
.task-modal-picker-empty,
.task-modal-picker-add {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-weight: 500;
}
.task-modal-picker-empty:hover,
.task-modal-picker-add:hover {
  border-color: var(--border-subtle);
  color: var(--text-primary);
  background: var(--bg-input);
}
.task-modal-picker-add {
  width: 20px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  border-radius: 50%;
  border: 1px dashed var(--border-subtle);
  margin-left: 4px;
}
/* Carries BOTH the photo and the animal-silhouette placeholder that
   ContactAvatar renders, so it must own the round shape itself — it no longer
   sits inside a .task-avatar disc. The overlap lives on the wrapper above. */
.task-modal-stack-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.task-modal-picker-chiprow {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.task-modal-listing-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 4px 1px 7px;
  border-radius: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-soft);
  font-weight: 500;
  max-width: 180px;
}
.task-modal-listing-chip button {
  background: transparent; border: 0; color: inherit; cursor: pointer; padding: 0 4px;
  border-radius: 3px;
  line-height: 1;
}

/* Tag picker menu — opens directly when the user clicks the tag
   icon. Replaces the previous "Empty → text input" two-step that
   read like a separate dropdown. */
.task-modal-pick-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 50;
  min-width: 220px;
  max-width: 280px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: tasks-pop 120ms ease-out;
}
.task-modal-pick-anchor { display: none; }
.task-modal-pick-menu.is-viewport-portalled {
  inset: auto;
  max-width: min(280px, calc(100vw - 16px));
  overflow-y: auto;
}
.task-modal-pick-menu.is-inline {
  position: static;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin-top: 8px;
  box-shadow: none;
}
.task-modal-pick-menu.is-inline .task-modal-pick-search { min-height: 42px; }
.task-modal-pick-menu.is-inline .task-modal-pick-item { min-height: 42px; }
.properties-tag-picker.task-contractors-picker.is-viewport-portalled {
  inset: auto;
  max-width: calc(100vw - 16px);
  overflow-y: auto;
}
/* EVERY picker anchors its own menu, not just the tag one. This used to be
   .task-modal-picker-tags, back when the tag picker was the only one with a
   real popover and the rest opened a bare native <select>. */
.task-modal-picker { position: relative; }
.task-modal-pick-search {
  height: 26px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.78rem;
}
.task-modal-pick-search:focus { outline: none; border-color: var(--border-strong); }
.task-modal-pick-list {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
  gap: 1px;
  padding-right: 1px;
  scrollbar-width: thin;
}
.task-modal-pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.task-modal-pick-item:hover,
.task-modal-pick-item.is-selected {
  background: var(--bg-input);
}
.task-modal-pick-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.task-modal-pick-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.task-modal-pick-create {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2px;
  border-radius: 0;
  text-align: left;
  color: var(--accent, #6366f1);
  font-size: 0.78rem;
  cursor: pointer;
}
.task-modal-pick-create:hover { background: var(--bg-input); }
.task-modal-pick-none {
  padding: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
}

/* A menu row can carry a face and a second line (e.g. a person's email, a
   stream's folder). Without the second line every list in this menu was just
   a column of bare names, which is what made picking an assignee feel like a
   raw browser dropdown. */
.task-modal-pick-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.task-modal-pick-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.task-modal-pick-face,
.task-modal-pick-face-img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.task-modal-pick-groupface {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  font-weight: 800;
  flex-shrink: 0;
}
.task-modal-pick-tick { flex-shrink: 0; color: var(--accent, #6366f1); }

/* Single-choice trigger (status / priority / stream / repeat). Wears the same
   box as the input it replaced, so swapping the native <select> for a real
   menu changed the behaviour without changing the visual weight of the row. */
.task-modal-chip-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 7px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  max-width: 200px;
  transition: background 100ms ease, border-color 100ms ease;
}
.task-modal-chip-trigger:hover { background: var(--bg-input); border-color: var(--border-subtle); }
.task-modal-chip-trigger:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 1px;
}
.task-modal-chip-trigger-text {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.task-modal-chip-trigger.is-empty .task-modal-chip-trigger-text { color: var(--text-muted); }

/* One task, several Streams. Home is a radio-like operation because it moves
   status ownership; the square check only controls the additional views where
   the same relational task appears. */
.task-streams-picker-count {
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 750;
}
.task-streams-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 52;
  width: min(430px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.task-streams-picker-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 2px 4px;
}
.task-streams-picker-head strong { font-size: 0.82rem; }
.task-streams-picker-head span {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}
.task-streams-picker-list {
  display: flex;
  flex-direction: column;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.task-streams-picker-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 4px 5px;
  border-radius: 7px;
}
.task-streams-picker-row:hover,
.task-streams-picker-row.is-home {
  background: var(--bg-input);
}
.task-streams-picker-check {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
}
.task-streams-picker-check.is-checked {
  border-color: var(--accent);
  background: var(--accent);
}
.task-streams-picker-check.is-disabled { cursor: default; opacity: 0.75; }
.task-streams-picker-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.task-streams-picker-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
}
.task-streams-picker-copy small { color: var(--text-muted); font-size: 0.69rem; }
.task-streams-picker-home {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
}
.task-streams-picker-home.is-home {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}
.task-streams-picker-home:disabled { cursor: default; }

/* Standing work ----------------------------------------------
   The panel that makes a never-finishing task checkable. Shown only when
   tasks.standing_since is set. Every colour is a theme token, so light and
   dark come free (CLAUDE.md §5) — no hardcoded hex below.
   See components/tasks/TaskStandingPanel.tsx. */
.task-standing {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  margin-top: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
}
.task-standing-head h3 {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}
.task-standing-sub {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* The evidence line is the headline — it is what replaces the checkbox. */
.task-standing-evidence {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--bg-base);
}
.task-standing-evidence-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text-primary);
}
.task-standing-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
/* Green only when something actually landed since the last look. */
.task-standing-dot.is-fresh {
  background: var(--state-success);
}

.task-standing-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.task-standing-label {
  flex: 0 0 auto;
  min-width: 132px;
  font-size: 0.78rem;
  color: var(--text-soft);
}
.task-standing-input,
.task-standing-select {
  flex: 1 1 180px;
  min-width: 0;
  padding: 6px 9px;
  font: inherit;
  font-size: 0.83rem;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.task-standing-input:focus,
.task-standing-select:focus {
  outline: none;
  border-color: var(--accent);
}
.task-standing-btn {
  padding: 6px 11px;
  font-size: 0.81rem;
  color: var(--text-primary);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
}
.task-standing-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.task-standing-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.task-standing-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  color: var(--accent);
  text-decoration: none;
}
.task-standing-folder:hover {
  text-decoration: underline;
}
.task-standing-next {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
/* "Nothing will remind you to look at this" — the failure this feature
   exists to prevent, so it gets warning colour rather than muted grey. */
.task-standing-next.is-warn {
  color: var(--state-warning);
}
.task-standing-error {
  margin: 0;
  font-size: 0.78rem;
  color: var(--state-error);
}

/* Replaces "Mark complete" in the topbar — standing work has no done state. */
.task-modal-standing-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
}

/* Small screens are first class: the label stops reserving a column and the
   control takes the full width rather than squeezing to nothing. */
@media (max-width: 640px) {
  .task-standing-row {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }
  .task-standing-label {
    min-width: 0;
  }
}

/* Description editor ----------------------------------------- */
.task-modal-description {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}
.task-modal-description-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
}
.task-modal-description-head h3 {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}
.task-desc-field {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-elevated);
  transition: border-color 120ms ease;
}
.task-desc-field:focus-within {
  border-color: var(--border-strong);
}
.task-desc-editor {
  min-height: 180px;
  max-height: none;
  overflow: visible;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-primary);
}
.task-desc-editor .ProseMirror {
  outline: none;
  min-height: 100%;
}
.task-desc-editor .ProseMirror p { margin: 0 0 6px; }
.task-desc-editor .ProseMirror p:last-child { margin-bottom: 0; }
.task-desc-editor .ProseMirror h1 { font-size: 1.25rem; font-weight: 700; margin: 14px 0 6px; line-height: 1.25; }
.task-desc-editor .ProseMirror h2 { font-size: 1.08rem; font-weight: 700; margin: 12px 0 6px; line-height: 1.25; }
.task-desc-editor .ProseMirror h3 { font-size: 0.96rem; font-weight: 600; margin: 10px 0 4px; line-height: 1.3; }
.task-desc-editor .ProseMirror ul,
.task-desc-editor .ProseMirror ol {
  padding-left: 22px;
  margin: 0 0 6px;
}
.task-desc-editor .ProseMirror blockquote {
  border-left: 2px solid var(--border-strong);
  padding-left: 10px;
  margin: 4px 0;
  color: var(--text-soft);
  font-style: italic;
}
.task-desc-editor .ProseMirror code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.85em;
}
.task-desc-editor .ProseMirror pre {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.82rem;
  overflow-x: auto;
}
.task-desc-editor .ProseMirror hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 14px 0;
}
.task-desc-editor .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--text-muted);
  pointer-events: none;
  height: 0;
}
.task-desc-task-list {
  list-style: none;
  padding-left: 0;
}
.task-desc-task-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 2px 0;
}
.task-desc-task-item > label > input {
  margin-top: 5px;
}

.task-desc-slash-menu {
  position: fixed;
  /* Must sit above the task modal (z-index 90) and the task-quick-pane
     (z-index 30 inside the right pane) — otherwise the slash menu is
     rendered behind the modal/pane and clicks land on whatever is
     beneath. */
  z-index: 100;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
}
.task-desc-slash-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  font-size: 0.82rem;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  font-family: inherit;
}
.task-desc-slash-item.is-active,
.task-desc-slash-item:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* @-mentions menu — rich variant of the slash menu with avatar +
   secondary line. Lives in a body-portal alongside the slash menu
   (same z-index war) so it can never be clipped by the surrounding
   modal/pane. */
.task-desc-mention-menu,
.message-composer-mention-menu {
  position: fixed;
  z-index: 100;
  min-width: 240px;
  max-width: 320px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.message-composer-mention-menu.is-above,
.task-desc-mention-menu.is-above,
.task-desc-slash-menu.is-above {
  transform: translateY(-100%);
}
.message-composer-menu-empty {
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
/* Grouped @-menu (inbox composer) — ClickUp-style category headers so People /
   Guests / Listings / Tasks / Owners are each surfaced. Header sticks while the
   menu scrolls. Only the inbox editor emits groups; task-comment mentions stay
   flat and are unaffected. */
.message-composer-mention-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.message-composer-mention-group + .message-composer-mention-group {
  margin-top: 4px;
}
.message-composer-mention-group-label {
  position: sticky;
  top: -4px;
  padding: 5px 8px 2px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--bg-elevated);
}
/* Category tabs (inbox @-menu, ClickUp-style) — filter to one kind. Sticky at
   the top while the list scrolls; the per-group labels below un-stick so they
   don't collide with the tab row. */
.message-composer-mention-tabs {
  position: sticky;
  top: -4px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 2px 2px 5px;
  margin-bottom: 2px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
}
.message-composer-mention-tab {
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}
.message-composer-mention-tab:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.message-composer-mention-tab.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}
.inbox-mention-menu .message-composer-mention-group-label {
  position: static;
  top: auto;
}
.message-composer-mention-foot {
  position: sticky;
  bottom: -4px;
  margin-top: 2px;
  padding: 5px 8px 3px;
  font-size: 0.62rem;
  color: var(--text-soft);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
}
.task-desc-mention-item,
.message-composer-mention-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-radius: 5px;
  font-family: inherit;
  color: var(--text-soft);
}
.task-desc-mention-item.is-active,
.task-desc-mention-item:hover,
.message-composer-mention-item.is-active,
.message-composer-mention-item:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.task-desc-mention-avatar,
.message-composer-mention-avatar {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent, #6366f1), color-mix(in srgb, var(--accent, #6366f1) 50%, #000));
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-desc-mention-icon,
.message-composer-mention-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent, #6366f1) 16%, transparent);
  color: var(--accent, #6366f1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-desc-mention-body,
.message-composer-mention-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
}
.task-desc-mention-label,
.message-composer-mention-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-desc-mention-hint,
.message-composer-mention-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* @-mention chip rendered inline by TipTap's Mention extension. We
   want it to read as a discrete pill that's visually distinct from
   plain text without dominating the line. The chip is what
   MentionHoverHost listens for via event delegation; the cursor +
   data attributes ensure the popover knows what's being hovered. */
.mention-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent, #6366f1) 12%, transparent);
  color: var(--accent, #6366f1);
  font-weight: 500;
  font-size: 0.95em;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 100ms ease, color 100ms ease;
}
.mention-chip:hover {
  background: color-mix(in srgb, var(--accent, #6366f1) 22%, transparent);
}
.mention-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 2px;
}
.mention-chip[data-kind="user"][data-id="everyone"] {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  font-weight: 700;
}
.mention-chip[data-kind="task"] {
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: #b45309;
}
.mention-chip[data-kind="task"]:hover {
  background: color-mix(in srgb, #f59e0b 28%, transparent);
}
.mention-chip[data-kind="listing"] {
  background: color-mix(in srgb, #10b981 14%, transparent);
  color: #047857;
}
.mention-chip[data-kind="listing"]:hover {
  background: color-mix(in srgb, #10b981 26%, transparent);
}
.mention-chip[data-kind="reservation"] {
  background: color-mix(in srgb, #ec4899 14%, transparent);
  color: #be185d;
}
.mention-chip[data-kind="reservation"]:hover {
  background: color-mix(in srgb, #ec4899 26%, transparent);
}
.mention-chip[data-kind="document"] {
  background: color-mix(in srgb, #8b5cf6 14%, transparent);
  color: var(--mention-document-color, #a78bfa);
}
.mention-chip[data-kind="document"]:hover {
  background: color-mix(in srgb, #8b5cf6 26%, transparent);
}
/* Mention popover kind badge */
.message-composer-mention-kind {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ring) 12%, transparent);
}

/* Mention hover popover — fixed position, body-portaled by
   MentionHoverHost. Mirrors the chrome of the calendar reservation
   hover card so the two surfaces feel like the same component
   family. */
.mention-hover-card {
  z-index: 200;
  width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow-y: auto;
}
.mention-hover-card.is-above { transform: translateY(-100%); }
.mention-hover-card-loading {
  color: var(--text-muted);
  text-align: center;
  padding: 6px 0;
}
.mention-hover-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mention-hover-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mention-hover-card-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.75rem;
  object-fit: cover;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
img.mention-hover-card-avatar {
  padding: 0;
}
/* Listing thumbnail on the @-mention card — rounded rectangle (a property
   photo, not a person), theme-token border so light/dark both hold. */
.mention-hover-card-photo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.mention-hover-card-title {
  font-weight: 600;
  color: var(--text-primary);
}
.mention-hover-card-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mention-hover-card-type {
  text-transform: none;
  color: var(--text-soft);
  letter-spacing: 0;
}
.mention-hover-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.mention-hover-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mention-hover-card-status {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: var(--text-muted);
}
.mention-detail-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1600;
  background: rgba(8, 10, 18, 0.72);
  backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.mention-detail-modal {
  width: min(420px, 100%);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.55);
  position: relative;
  padding: 18px 16px 14px;
}
.mention-detail-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.mention-detail-modal-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.mention-detail-primary-action {
  width: 100%;
  margin-top: 14px;
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.mention-detail-primary-action:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
/* Per-entity activity log inside the reference detail modal — the read side of
   "@-referencing writes a footprint into the entity's log". */
.mention-activity {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.mention-activity-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.mention-activity-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.mention-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.mention-activity-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--bg-input);
}
.mention-activity-icon {
  flex: 0 0 auto;
  display: inline-flex;
  margin-top: 1px;
  color: var(--text-muted);
}
.mention-activity-icon[data-verb="edited"] {
  color: var(--accent);
}
.mention-activity-icon[data-verb="merged"] {
  color: var(--state-success, var(--accent));
}
.mention-activity-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mention-activity-summary {
  font-size: 0.8rem;
  color: var(--text-primary);
}
.mention-activity-detail {
  font-size: 0.76rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mention-activity-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}
/* Contact profile Activity card (staff feedback #29) — same rows as the mention
   modal above, but inside an inbox-crm-card: the show-all toggle replaces the
   modal's capped scroll box. */
.inbox-crm-activity .mention-activity-list {
  max-height: none;
  overflow-y: visible;
}
.inbox-crm-activity-more {
  margin-top: 8px;
  border: none;
  background: none;
  padding: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.inbox-crm-activity-more:hover {
  text-decoration: underline;
}

/* Sections ------------------------------------------------------ */
.task-modal-section {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
}
.task-modal-section-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.task-modal-section-head:hover .task-modal-section-title { color: var(--text-primary); }
.task-modal-section-caret {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 140ms ease;
}
.task-modal-section.is-open .task-modal-section-caret { transform: rotate(0deg); }
.task-modal-section:not(.is-open) .task-modal-section-caret { transform: rotate(-90deg); }
.task-modal-section-title {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 100ms ease;
}
.task-modal-section-count {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  min-width: 18px;
  text-align: center;
}
.task-modal-section-body {
  padding: 6px 0 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Generic block list ---------------------------------------- */
.task-modal-block-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-modal-block-add {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 2px 0;
}
.task-modal-block-add .task-modal-chip-input { max-width: none; flex: 1; height: 26px; }
.task-modal-block-remove {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 5px;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: 3px;
}
.task-modal-block-remove:hover { color: var(--state-error); background: color-mix(in srgb, var(--state-error) 10%, transparent); }

/* Custom checkbox ----------------------------------------- */
.task-modal-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1.4px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  flex: 0 0 16px;
  position: relative;
  transition: background 120ms ease, border-color 120ms ease;
  display: inline-block;
  padding: 0;
}
.task-modal-checkbox:hover { border-color: var(--text-primary); }
.task-modal-checkbox.is-checked {
  background: var(--text-primary);
  border-color: var(--text-primary);
}
.task-modal-checkbox.is-checked::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%230a0a0b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8l3.5 3.5L13 5'/%3E%3C/svg%3E") no-repeat center / 12px;
}

/* Generic relations (listings / reservations / contacts / tasks / …) */
.task-modal-related-primary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, #6366f1) 4%, var(--bg-deep));
}
.task-modal-related-primary .task-modal-description-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.task-modal-relations {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-modal-relations-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.task-modal-relations-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--state-error) 40%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, var(--state-error) 8%, transparent);
  color: var(--state-error);
  font-size: 0.78rem;
}
.task-modal-relations-error button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--state-error) 45%, var(--border-subtle));
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}
.task-modal-relations-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-modal-relation {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.task-modal-relation-open {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.task-modal-relation:hover,
.task-modal-relation:focus-within {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 45%, var(--border-subtle));
  background: var(--bg-input);
}
.task-modal-relation-open:focus-visible { outline: none; }
.task-modal-relation-kind { font-size: 1rem; }
.task-modal-relation-body { flex: 1; min-width: 0; }
.task-modal-relation-body strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.task-modal-relation-body small {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.task-modal-relation-remove {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
}
.task-modal-relation-remove:hover { color: var(--text-primary); background: var(--bg-input); }
.task-modal-relation-remove:disabled { cursor: wait; opacity: 0.45; }
.task-modal-relation-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px dashed var(--border-subtle);
  border-radius: 6px;
}
.task-modal-relation-question {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 650;
}
.task-modal-relation-guidance {
  margin: 0;
  padding: 9px 10px;
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.76rem;
}
.task-modal-relation-kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.task-modal-relation-kind-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.task-modal-relation-kind-pill:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent, #6366f1) 40%, var(--border-subtle));
}
.task-modal-relation-kind-pill.is-active {
  background: color-mix(in srgb, var(--accent, #6366f1) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent, #6366f1) 60%, transparent);
  color: var(--text-primary);
}
.task-modal-relation-search {
  flex: 1 1 auto;
}
/* Live results list. Capped height so even a busy workspace doesn't
   make the picker push the description out of view. The buttons
   inside are the actual interactive items — clicking links the
   relation immediately. */
.task-modal-relation-results {
  display: flex;
  flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-input);
}
.task-modal-relation-result-empty {
  padding: 10px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.task-modal-relation-result-empty button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.task-modal-relation-result {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-soft);
}
.task-modal-relation-result:last-child {
  border-bottom: 0;
}
.task-modal-relation-result:hover:not(:disabled),
.task-modal-relation-result:focus-visible {
  background: color-mix(in srgb, var(--accent, #6366f1) 10%, transparent);
  color: var(--text-primary);
  outline: none;
}
.task-modal-relation-result:disabled {
  opacity: 0.6;
  cursor: progress;
}
.task-modal-relation-result-kind {
  flex: 0 0 auto;
}
.task-modal-relation-result-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.task-modal-relation-result-body strong {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-modal-relation-result-body small {
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-modal-relation-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.task-modal-relation-form .task-modal-chip-input,
.task-modal-relation-form .task-modal-chip-select {
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  flex: 1;
  min-width: 100px;
}

/* Subtasks ------------------------------------------------- */
.task-modal-subtasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}
.task-modal-subtask {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background 100ms ease;
  font-size: 0.82rem;
}
.task-modal-subtask + .task-modal-subtask { border-top: 1px solid var(--border-subtle); }
.task-modal-subtask:hover { background: var(--bg-input); }
.task-modal-subtask.is-done .task-modal-subtask-title {
  text-decoration: line-through;
  color: var(--text-muted);
}
.task-modal-subtask-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
}
.task-modal-subtask-title {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Checklist ------------------------------------------------- */
.task-modal-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.task-modal-checklist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 4px;
  font-size: 0.84rem;
  transition: background 100ms ease;
}
.task-modal-checklist-row:hover { background: var(--bg-input); }
.task-modal-checklist-row > span { flex: 1; }
.task-modal-checklist-row.is-done > span:nth-child(2) {
  text-decoration: line-through;
  color: var(--text-muted);
}
.task-modal-checklist-photo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: -5px 0;
  border-radius: 5px;
  cursor: pointer;
  filter: grayscale(1);
  opacity: 0.7;
}
.task-modal-checklist-photo:hover,
.task-modal-checklist-photo:focus-within { background: var(--bg-elevated); opacity: 1; }

/* Checklist sections -----------------------------------------
   An imported changeover clean is eleven headings ("Kitchen",
   "Final Checks") of ~5 items, not one list of 52. Headings are
   quiet — uppercase micro-type, no fill — because the ITEMS are
   the thing being read; the heading only has to say where you
   are. Colours are tokens, so light and dark both work.        */
.task-modal-checklist-group + .task-modal-checklist-group {
  margin-top: 2px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 2px;
}
.task-modal-checklist-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 4px;
  border: 0;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 100ms ease, color 100ms ease;
}
.task-modal-checklist-group-head:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.task-modal-checklist-group-caret {
  font-size: 0.62rem;
  line-height: 1;
  transition: transform 120ms ease;
}
.task-modal-checklist-group:not(.is-open) .task-modal-checklist-group-caret {
  transform: rotate(-90deg);
}
.task-modal-checklist-group-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-modal-checklist-group-count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0;
}
/* A finished section stays visible but stops competing for attention. */
.task-modal-checklist-group.is-done .task-modal-checklist-group-name {
  text-decoration: line-through;
  opacity: 0.65;
}
/* Indent puts the items visibly under their heading. */
.task-modal-checklist-group .task-modal-checklist {
  padding-left: 12px;
}
.task-modal-checklist-section-picker {
  max-width: 42%;
  flex: 0 1 auto;
}

/* Attachments ----------------------------------------------- */
.task-modal-attachments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.task-modal-attachment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
}
.task-modal-attachment-icon { color: var(--text-muted); }
.task-modal-attachment-open {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-modal-attachment-open:hover { text-decoration: underline; }
.task-modal-attachment-size { font-size: 0.7rem; color: var(--text-muted); }

/* Image attachments — render as a tiled grid with inline previews
   so a picture is actually a picture, not a filename. */
.task-modal-upload-batch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  margin-bottom: 8px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.task-modal-upload-batch-copy { display: grid; min-width: 0; gap: 2px; }
.task-modal-upload-batch-copy strong { color: var(--text-primary); font-size: .84rem; }
.task-modal-upload-batch-copy small { color: var(--text-secondary); font-size: .72rem; }
.task-modal-upload-batch-track {
  grid-column: 1 / -1;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-primary) 12%, transparent);
}
.task-modal-upload-batch-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}
.task-modal-upload-batch-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.task-modal-upload-batch-actions button {
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.task-modal-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}
.task-modal-attachment-image {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
}
.task-modal-attachment-image-link {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.task-modal-attachment-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.task-modal-attachment-image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 6px;
  text-align: center;
}
.task-modal-attachment-image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 0;
  font-size: 0.85rem;
  line-height: 16px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.task-modal-attachment-image:hover .task-modal-attachment-image-remove {
  opacity: 1;
}
.task-modal-attachment-image.is-pending img {
  opacity: 0.72;
}
.task-modal-upload-tile {
  position: absolute;
  inset: auto 4px 4px;
  display: grid;
  gap: 4px;
  padding: 5px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--bg-deep) 86%, transparent);
  color: var(--text-primary);
  font-size: 0.66rem;
  backdrop-filter: blur(5px);
}
.task-modal-upload-tile.is-error {
  background: color-mix(in srgb, var(--state-danger) 22%, var(--bg-deep));
}
.task-modal-upload-tile-track {
  display: block;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-primary) 18%, transparent);
}
.task-modal-upload-tile-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}
.task-modal-upload-tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.task-modal-upload-tile button {
  min-height: 26px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--text-primary) 22%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.task-modal-attach-drop {
  display: grid;
  gap: 3px;
  padding: 14px 12px;
  text-align: center;
  border: 1.4px dashed var(--border-subtle);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.task-modal-attach-drop strong {
  color: var(--text-primary);
  font-size: 0.86rem;
}
.task-modal-attach-drop:hover {
  border-color: var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
}

@media (max-width: 720px) {
  .task-modal-upload-batch { grid-template-columns: minmax(0, 1fr); }
  .task-modal-upload-batch-actions { justify-content: stretch; }
  .task-modal-upload-batch-actions button { flex: 1; min-height: 44px; }
}

/* Time ----------------------------------------------------- */
.task-modal-time-total { margin: 0; font-size: 0.82rem; color: var(--text-soft); }
.task-modal-time-total strong { color: var(--text-primary); font-weight: 700; }
.task-modal-time-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.task-modal-time-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  font-size: 0.8rem;
}
.task-modal-time-amount { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--text-primary); }
.task-modal-time-note { color: var(--text-soft); }
.task-modal-time-note.muted { color: var(--text-muted); font-style: italic; }
.task-modal-time-when { color: var(--text-muted); font-size: 0.68rem; text-align: right; }
.task-modal-time-input { max-width: 100px; }

.task-modal-empty {
  list-style: none;
  text-align: center;
  padding: 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border: 1px dashed var(--border-subtle);
  border-radius: 6px;
}

/* Dependencies --------------------------------------------- */
.task-modal-deps-heading {
  margin: 4px 0 4px;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
}
.task-modal-deps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.task-modal-deps-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  font-size: 0.8rem;
}
.task-modal-deps-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  border-radius: 6px;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border-subtle);
}
.task-modal-deps-result {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 0.78rem;
  border-radius: 4px;
}
.task-modal-deps-result:hover { background: var(--bg-input); }
.task-modal-deps-result > span:first-child { flex: 1; }

/* Side pane: one combined Activity + Unified Inbox conversation */
.task-modal-side-tabs {
  display: flex;
  gap: 0;
  padding: 6px 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  flex: 0 0 auto;
}
.task-modal-side-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms ease, border-color 120ms ease;
}
.task-modal-side-tab:hover { color: var(--text-primary); }
.task-modal-side-tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}
.task-conversation-heading {
  align-items: center;
  justify-content: space-between;
  padding-right: 14px;
}
.task-conversation-heading .task-modal-side-tab { cursor: default; }
.task-conversation-inbox-label {
  color: var(--text-muted);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}
.task-conversation-pane--workspace {
  width: 100%;
  height: 100%;
  max-width: none;
  flex: 1 1 auto;
  border-right: 0;
}
.task-conversation-list .task-conversation-activity-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  position: relative;
}
.task-conversation-list .inbox-uos-body {
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.5;
}
.task-conversation-end { list-style: none; height: 1px; }
.task-conversation-error {
  margin-top: 10px;
  padding: 7px 9px;
  border: 1px solid color-mix(in srgb, var(--state-danger) 35%, transparent);
  border-radius: 6px;
  color: var(--state-danger);
  background: color-mix(in srgb, var(--state-danger) 7%, transparent);
  font-size: 0.74rem;
}
.task-related-quicklook { overflow-y: auto; }
.task-related-quicklook-topbar { margin: -2px 0 12px; }
.task-related-quicklook-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}
.task-related-quicklook-subtitle {
  margin: -3px 0 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.task-related-quicklook-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}
.task-modal-side-count {
  background: var(--bg-input);
  border-radius: 999px;
  padding: 0 5px;
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.task-modal-side-body {
  flex: 1;
  overflow: auto;
  padding: 12px 14px 10px;
  scrollbar-width: thin;
}
.task-modal-side-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
}
.task-modal-side-empty strong { display: block; color: var(--text-primary); margin-bottom: 4px; font-size: 0.86rem; }
.task-modal-side-empty p { margin: 0; font-size: 0.76rem; line-height: 1.5; }

/* Comments list ---------------------------------------- */
.task-modal-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.task-modal-comment {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
}
.task-modal-comment-avatar { width: 28px; height: 28px; margin: 0; border-width: 0; font-size: 0.72rem; }
.task-modal-comment-body {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.task-modal-comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
}
.task-modal-comment-meta strong { color: var(--text-primary); font-weight: 600; }
.task-modal-comment-time { color: var(--text-muted); font-size: 0.66rem; }
.task-modal-comment-edited { font-size: 0.64rem; color: var(--text-muted); font-style: italic; }
.task-modal-comment-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.task-modal-comment-text > :first-child { margin-top: 0; }
.task-modal-comment-text > :last-child { margin-bottom: 0; }
.task-modal-comment-text p { margin: 0.15rem 0; }
.task-modal-comment-text h1,
.task-modal-comment-text h2,
.task-modal-comment-text h3 { margin: 0.35rem 0 0.2rem; line-height: 1.25; color: var(--text-primary); }
.task-modal-comment-text h1 { font-size: 1.05rem; }
.task-modal-comment-text h2 { font-size: 0.96rem; }
.task-modal-comment-text h3 { font-size: 0.9rem; }
.task-modal-comment-text ul,
.task-modal-comment-text ol { margin: 0.25rem 0; padding-left: 1.25rem; }
.task-modal-comment-text blockquote { margin: 0.3rem 0; padding-left: 0.7rem; border-left: 2px solid var(--accent); }
.task-modal-comment-text pre { margin: 0.35rem 0; padding: 0.5rem; overflow-x: auto; border-radius: 6px; background: var(--bg-input); }
.task-modal-comment-text hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 0.5rem 0; }

/* Inline attachments inside a comment bubble — used when the user
   sends a comment with no text (image-only "post"). Mirrors the
   AttachmentsBlock layout but with smaller thumbnails so multiple
   images per "message" still fit nicely in the side pane. */
.task-modal-comment--attachments .task-modal-comment-body {
  background: color-mix(in srgb, var(--ring) 4%, var(--bg-deep));
}
.task-modal-comment-attachments {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.task-modal-comment-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}
.task-modal-comment-attachment-image {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--ring) 6%, var(--bg-deep));
}
.task-modal-comment-attachment-image-link,
.task-modal-comment-attachment-image-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.task-modal-comment-attachment-image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.66rem;
  color: var(--text-muted);
  padding: 4px;
  text-align: center;
  word-break: break-all;
}
.task-modal-comment-attachment-remove,
.task-modal-comment-attachment-remove-mini {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  padding: 0;
}
.task-modal-comment-attachment-remove:hover,
.task-modal-comment-attachment-remove-mini:hover {
  background: rgba(0, 0, 0, 0.75);
}
.task-modal-comment-attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.task-modal-comment-attachment-file {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-soft);
  padding: 4px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--ring) 6%, var(--bg-deep));
}
.task-modal-comment-attachment-file a {
  color: var(--text-primary);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-modal-comment-attachment-file a:hover {
  text-decoration: underline;
}
.task-modal-comment-attachment-file-icon {
  color: var(--text-muted);
}
.task-modal-comment-attachment-size {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.task-modal-comment-attachment-remove-mini {
  position: static;
  width: 16px;
  height: 16px;
  font-size: 12px;
}

/* Activity feed ---------------------------------------- */
.task-modal-activity {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}
.task-modal-activity::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--border-subtle);
}
.task-modal-activity-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  position: relative;
}
.task-modal-activity-avatar { width: 28px; height: 28px; margin: 0; font-size: 0.72rem; border: 2px solid var(--bg-elevated); }
.task-modal-activity-line { font-size: 0.8rem; color: var(--text-soft); line-height: 1.45; }
.task-modal-activity-line strong { color: var(--text-primary); font-weight: 600; }
.task-modal-activity-kind { color: var(--text-soft); }
.task-modal-activity-time { font-size: 0.66rem; color: var(--text-muted); }

/* Composer ---------------------------------------------- */
.task-modal-composer {
  flex: 0 0 auto;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
}

/* ================================================================
   Unified message composer (.message-composer)
   Used in task comments, eventually in the inbox + guest messaging.
   The shell stays identical across surfaces; per-context controls
   (channel switcher, signatures, …) plug in via `rightActions`.
   ================================================================ */
.message-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.message-composer:focus-within {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 70%, var(--border-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #6366f1) 18%, transparent);
}
.message-composer-editor {
  min-height: 56px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
}
.message-composer-editor .ProseMirror {
  outline: none;
  min-height: 36px;
}
.message-composer-editor .ProseMirror p { margin: 0 0 4px; }
.message-composer-editor .ProseMirror p:last-child { margin-bottom: 0; }
.message-composer-editor .ProseMirror p.is-editor-empty:first-child::before {
  color: var(--text-muted);
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
}
/* On the phone the composer starts one line tall, so a placeholder that wraps is
   sliced through the middle of a glyph (TestFlight #44's screenshot). The phone's
   own placeholders are short now; this keeps ANY future one on one line rather
   than half-drawn. Desktop is wide enough to wrap harmlessly, so it is untouched. */
.phone-app .message-composer-editor .ProseMirror p.is-editor-empty:first-child::before {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.message-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 4px;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-deep) 70%, var(--bg-elevated));
  min-height: 34px;
}
.message-composer-toolbar-left,
.message-composer-toolbar-right {
  display: flex;
  align-items: center;
  gap: 2px;
}
.message-composer-toolbar-right { gap: 4px; padding-right: 2px; }

.message-composer-icon-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  cursor: pointer;
  padding: 0;
  transition: background 100ms ease, color 100ms ease;
}
.message-composer-icon-btn:hover { background: var(--bg-input); color: var(--text-primary); }
.message-composer-icon-btn:active { background: color-mix(in srgb, var(--accent, #6366f1) 14%, var(--bg-input)); }
.message-composer-icon-letter {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.message-composer-context {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  height: 26px;
  padding: 0 6px 0 8px;
  background: var(--bg-input);
  border-radius: 4px;
  margin: 0 4px 0 2px;
  border: 1px solid var(--border-subtle);
}
/* This rule IS the chip's whole look, so it follows the control onto the trigger. */
.message-composer-context .selectmenu-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-primary);
  padding: 0 14px 0 0;
  cursor: pointer;
  outline: none;
  line-height: 1;
}
.message-composer-context-caret {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

.message-composer-send {
  height: 26px;
  min-width: 30px;
  padding: 0 8px;
  border-radius: 4px;
  border: 0;
  background: var(--accent, #6366f1);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 120ms ease, opacity 120ms ease, transform 80ms ease;
}
.message-composer-send:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent, #6366f1) 88%, #000000);
}
.message-composer-send:active:not(:disabled) { transform: scale(0.96); }
.message-composer-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--text-muted);
}

.message-composer-slash-menu {
  position: fixed;
  z-index: 12000;
  min-width: 160px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
/* When the caret sits near the bottom of the viewport (e.g. comments
   composer in a side panel), the popover flips above the caret. Anchor
   from the bottom edge so `top` is the bottom of the menu instead of
   its top. */
.message-composer-slash-menu.is-above {
  transform: translateY(-100%);
}
.message-composer-slash-menu.is-below {
  transform: none;
}
.message-composer-slash-item {
  display: flex;
  align-items: center;
  text-align: left;
  font-size: 0.78rem;
  background: transparent;
  border: 0;
  color: var(--text-primary);
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
}
.message-composer-slash-item:hover,
.message-composer-slash-item.is-active {
  background: color-mix(in srgb, var(--accent, #6366f1) 18%, transparent);
}

[data-theme="light"] .message-composer { background: var(--bg-elevated); }
[data-theme="light"] .message-composer-toolbar { background: var(--bg-deep); }
[data-theme="light"] .message-composer-context { background: #ffffff; }
[data-theme="light"] .message-composer-send { color: #ffffff; }

/* Pending-attachment chips: visible feedback after the paperclip is
   clicked. Image files render an inline thumbnail; everything else
   renders a generic file icon. The strip sits above the toolbar so
   the user can review what's attached without leaving the composer. */
.message-composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px 0 8px;
  border-top: 1px solid var(--border-subtle);
}
.message-composer-attachment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 3px 4px 3px 6px;
  font-size: 0.72rem;
  color: var(--text-primary);
}
.message-composer-attachment-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  flex: 0 0 28px;
}
.message-composer-attachment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--bg-deep);
  color: var(--text-muted);
  flex: 0 0 24px;
}
.message-composer-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.message-composer-attachment-remove {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  border-radius: 3px;
}
.message-composer-attachment-remove:hover {
  background: var(--bg-deep);
  color: var(--text-primary);
}

/* ================================================================
   Section block extras: clickable chip labels, visible Add buttons,
   and inline subtask assignee picker so subtasks aren't just labels.
   ================================================================ */

.task-modal-block-add--checklist,
.task-modal-block-add--subtask {
  gap: 6px;
  align-items: center;
}
.task-modal-block-add-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
}
.task-modal-block-add-btn:hover:not(:disabled) {
  background: var(--bg-input);
  border-color: var(--border-strong);
}
.task-modal-block-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.task-modal-block-template { max-width: 130px; }

.task-modal-subtask {
  /* Override the generic row → make it a flex shell with explicit
     interactive children so clicks land on the right element. */
  cursor: default;
}
.task-modal-subtask-open {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-width: 0;
}
.task-modal-subtask-open:hover .task-modal-subtask-title { color: var(--accent, #6366f1); }

.task-modal-subtask-assignees {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
}

.task-modal-checklist-text { flex: 1; min-width: 0; word-break: break-word; }

/* ================================================================
   Calendar toolbar: primary pill (used by + Reservation),
   so it stands out next to the secondary + Task button.
   ================================================================ */
.property-calendar-pill-btn--primary {
  background: var(--accent, #6366f1);
  border-color: color-mix(in srgb, var(--accent, #6366f1) 70%, var(--border-strong));
  color: #ffffff;
}
.property-calendar-pill-btn--primary:hover {
  background: color-mix(in srgb, var(--accent, #6366f1) 88%, #000000);
  color: #ffffff;
}

/* Task-draft mode banner. The Task pill flips to is-active and a banner
   floats below the top toolbar with the next-step prompt. Without this
   block the banner has no styles and looks like an unrendered DOM
   fragment, which is why the Task button felt like it did nothing. */
.property-calendar-task-draft-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 52px;
  bottom: auto;
  z-index: 14;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--accent, #6366f1) 18%, var(--cal-surface));
  border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 50%, var(--border-strong));
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.78rem;
  color: var(--text-primary);
  animation: property-calendar-task-draft-in 140ms ease-out;
}
@keyframes property-calendar-task-draft-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.property-calendar-task-draft-status {
  font-weight: 500;
}
.property-calendar-task-draft-status strong {
  color: var(--accent, #6366f1);
  margin-right: 4px;
}
.property-calendar-task-draft-title {
  flex: 1 1 200px;
  min-width: 200px;
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.82rem;
}
.property-calendar-task-draft-title:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}
.property-calendar-task-draft-error {
  font-size: 0.74rem;
  color: #f87171;
}
/* ----------------------------------------------------------------
   Date-pick mode (`.is-date-pick`) — a Task or Event draft is armed
   and the next calendar click picks a date.

   EVERY date must be pickable while armed, including days that
   already have a booking on them — a cleaning task on a check-out
   day or maintenance mid-stay is the NORMAL case, not an edge case.
   Two things block that in normal mode and both are undone here:

     1. the reservation/task/event/block chips sit in an overlay above
        the day cells and take the pointer themselves, so the click
        lands on the chip (which reports the booking's check-in date,
        not the day under the cursor) instead of the cell;
     2. every day cell a chip covers is `pointer-events: none`
        (`.property-calendar-day-cell.is-covered`, set so chip hover
        popovers aren't fought over by the cell underneath), so even
        with the chips out of the way the cell couldn't be clicked.

   Selector specificity (3–4 classes) beats the `pointer-events`
   declarations it overrides (1 class each), so no `!important`.
   Paired with `datePickActive` in PropertyCalendarTab — move both.
   ---------------------------------------------------------------- */
.property-calendar-tab.is-date-pick .property-calendar-res-layer,
.property-calendar-tab.is-date-pick .property-calendar-res-layer * {
  pointer-events: none;
}
.property-calendar-tab.is-date-pick .property-calendar-day-cell.is-covered {
  pointer-events: auto;
}
/* Cursor hint while draft mode is active so it's blindingly obvious
   that the next click on a calendar cell is the start date. Booked
   days get the same treatment as free ones — the whole point is that
   they no longer read as dead. */
.property-calendar-tab.is-date-pick .property-calendar-day-cell { cursor: copy; }
.property-calendar-tab.is-date-pick .property-calendar-day-cell:hover {
  background: color-mix(in srgb, var(--accent, #6366f1) 14%, transparent);
  outline: 1px dashed color-mix(in srgb, var(--accent, #6366f1) 50%, transparent);
}

/* ================================================================
   Manual-reservation draft pane — the task create flow now uses the
   canonical TaskDrawer in .task-quick-pane. This smaller shell remains
   only for the separate reservation placeholder.
   ================================================================ */
.calendar-draft-pane {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 14px 18px;
  background: var(--bg-elevated, #1a1a1d);
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  animation: support-pane-in 140ms ease-out;
}
@keyframes support-pane-in {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.calendar-draft-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.calendar-draft-pane-header h2 {
  margin: 3px 0 0;
  color: var(--text-primary);
  font-size: 0.94rem;
  line-height: 1.25;
}
.calendar-draft-pane-eyebrow {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #6366f1);
}
.calendar-draft-pane-close {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
}
.calendar-draft-pane-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.calendar-draft-pane-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calendar-draft-pane-label {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.calendar-draft-pane-dates {
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.82rem;
}
.calendar-draft-pane-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}
.calendar-draft-pane-empty {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px 4px;
  color: var(--text-muted);
}
.calendar-draft-pane-empty strong {
  color: var(--text-primary);
  font-size: 0.85rem;
}
.calendar-draft-pane-empty p {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
}
.calendar-draft-pane-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.calendar-draft-pane-submit,
.calendar-draft-pane-cancel {
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
}
.calendar-draft-pane-submit {
  padding: 8px 12px;
  border: 0;
  background: var(--accent, #6366f1);
  color: white;
  font-size: 0.82rem;
  font-weight: 500;
}
.calendar-draft-pane-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.calendar-draft-pane-cancel {
  padding: 6px 12px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.calendar-draft-pane-cancel:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* One direct-booking form powers desktop and phone. Keep its selectors free of
   pane-specific geometry so payment behaviour and fields stay identical. */
.direct-booking-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.direct-booking-field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
}
.direct-booking-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.direct-booking-field.is-wide { grid-column: 1 / -1; }
.direct-booking-field > span,
.direct-booking-policy-control-grid label > span,
.direct-booking-duration > label,
.direct-booking-policy-methods > legend {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}
.direct-booking-field em {
  font-style: normal;
  font-weight: 400;
}
.direct-booking-field input,
.direct-booking-field .selectmenu-trigger,
.direct-booking-policy-control-grid input:not([type="checkbox"]),
.direct-booking-policy-control-grid .selectmenu-trigger,
.direct-booking-link-row input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  padding: 7px 9px;
}
.direct-booking-field input:focus,
.direct-booking-field .selectmenu-trigger:focus-visible,
.direct-booking-policy-control-grid input:not([type="checkbox"]):focus,
.direct-booking-policy-control-grid .selectmenu-trigger:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border-subtle));
  outline: 2px solid color-mix(in srgb, var(--accent) 16%, transparent);
}
.direct-booking-field .selectmenu-trigger,
.direct-booking-policy-control-grid .selectmenu-trigger {
  justify-content: space-between;
  font-weight: 500;
}
.direct-booking-field input:read-only,
.direct-booking-field input:disabled {
  color: var(--text-soft);
  opacity: 0.82;
}
.direct-booking-contact {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.direct-booking-contact-label {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}
.direct-booking-contact-label em {
  font-style: normal;
  font-weight: 400;
}
.direct-booking-contact-trigger,
.direct-booking-contact-selected {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
}
.direct-booking-contact-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
}
.direct-booking-contact-selected {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
}
.direct-booking-contact-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  object-fit: cover;
}
.direct-booking-contact-selected > span,
.direct-booking-contact-results button > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}
.direct-booking-contact-selected strong,
.direct-booking-contact-results strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.direct-booking-contact-selected small,
.direct-booking-contact-results small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.direct-booking-contact-selected > button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.direct-booking-contact-popover {
  position: absolute;
  z-index: 90;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-deep);
  box-shadow: 0 14px 34px rgb(0 0 0 / 26%);
}
.direct-booking-contact-popover > label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 7px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-muted);
}
.direct-booking-contact-popover input {
  width: 100%;
  min-height: 34px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.74rem;
}
.direct-booking-contact-results {
  max-height: 220px;
  overflow-y: auto;
  padding: 0 5px 5px;
}
.direct-booking-contact-results button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.direct-booking-contact-results button:hover { background: var(--bg-input); }
.direct-booking-contact-results p,
.direct-booking-contact-error {
  margin: 0;
  padding: 9px;
  color: var(--text-muted);
  font-size: 0.68rem;
}
.direct-booking-contact-error { color: var(--state-error); }
.direct-booking-extension-context {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-input));
}
.direct-booking-extension-context strong { color: var(--text-primary); font-size: 0.8rem; }
.direct-booking-extension-context span,
.direct-booking-extension-context small { color: var(--text-muted); font-size: 0.68rem; line-height: 1.4; }
.direct-booking-extension-direction {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-input) 72%, transparent);
}
.direct-booking-extension-direction > div:first-child { display: grid; gap: 2px; }
.direct-booking-extension-direction strong { color: var(--text-primary); font-size: 0.76rem; }
.direct-booking-extension-direction span { color: var(--text-muted); font-size: 0.66rem; line-height: 1.4; }
.direct-booking-extension-direction .segmented-control { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.direct-booking-extension-direction .segmented-control-btn { min-width: 0; }
.direct-booking-extension-error { color: var(--text-muted); font-size: 0.74rem; }
.direct-booking-extension-error p { margin: 0 0 9px; }
.direct-booking-policy {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-input) 62%, transparent);
}
.direct-booking-policy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.direct-booking-policy-head > div:first-child { display: grid; gap: 3px; min-width: 0; }
.direct-booking-policy-head strong { color: var(--text-primary); font-size: 0.8rem; }
.direct-booking-policy-head > div:first-child > span {
  color: var(--text-muted);
  font-size: 0.67rem;
  line-height: 1.4;
}
.direct-booking-policy-origin {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--text-muted);
  font-size: 0.64rem;
  text-align: right;
}
.direct-booking-policy-origin button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-soft);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.direct-booking-policy-controls {
  display: grid;
  gap: 10px;
}
.direct-booking-policy > .direct-booking-policy-controls { padding: 10px 12px; }
.direct-booking-policy-control {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}
.direct-booking-policy-control > legend {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 5px;
  color: var(--text-primary);
}
.direct-booking-policy-control > legend > span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-muted));
  color: var(--accent);
  font-size: 0.63rem;
  font-weight: 800;
}
.direct-booking-policy-control > legend strong { font-size: 0.74rem; }
.direct-booking-policy-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  padding-top: 4px;
}
.direct-booking-policy-control-grid > label,
.direct-booking-duration {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}
.direct-booking-policy-control-grid label > small,
.direct-booking-duration > small {
  color: var(--text-muted);
  font-size: 0.64rem;
  font-weight: 400;
  line-height: 1.42;
}
.direct-booking-duration-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(94px, 0.55fr);
  gap: 6px;
}
.direct-booking-duration-input .selectmenu-trigger { width: 100%; justify-content: space-between; }
.direct-booking-policy-number {
  display: flex;
  align-items: center;
  gap: 7px;
}
.direct-booking-policy-number input { min-width: 0; }
.direct-booking-policy-number em { color: var(--text-muted); font-style: normal; font-size: 0.72rem; }
.direct-booking-policy-methods {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
  padding: 2px 0 0;
  border: 0;
}
.direct-booking-policy-methods > legend { width: 100%; margin-bottom: 1px; }
.direct-booking-policy-methods > label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 500;
}
.direct-booking-policy-methods input { width: 16px; min-height: 16px; }
.direct-booking-policy-methods > small { flex-basis: 100%; color: var(--text-muted); font-size: 0.64rem; line-height: 1.4; }
.direct-booking-policy-frozen {
  display: grid;
  gap: 3px;
  margin: 0 12px 10px;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-muted) 58%, transparent);
}
.direct-booking-policy-frozen strong { color: var(--text-primary); font-size: 0.7rem; }
.direct-booking-policy-frozen span { color: var(--text-soft); font-size: 0.68rem; }
.direct-booking-policy-frozen small { color: var(--text-muted); font-size: 0.62rem; line-height: 1.4; }
.direct-booking-policy-foot {
  margin: 0;
  padding: 0 12px 12px;
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.4;
}
.direct-booking-rule-warning {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, #f59e0b 42%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, #f59e0b 9%, var(--bg-input));
  color: #f59e0b;
}
.direct-booking-rule-warning.is-overridden {
  border-color: color-mix(in srgb, #22c55e 38%, var(--border-subtle));
  background: color-mix(in srgb, #22c55e 8%, var(--bg-input));
  color: #22c55e;
}
.direct-booking-rule-warning > svg { margin-top: 1px; }
.direct-booking-rule-warning > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.direct-booking-rule-warning strong { color: var(--text-primary); font-size: 0.74rem; }
.direct-booking-rule-warning span {
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.4;
}
.direct-booking-rule-warning label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}
.direct-booking-rule-warning input { width: 15px; height: 15px; margin: 0; }
.direct-booking-quote {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-input));
}
.direct-booking-state {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}
.direct-booking-quote-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-primary);
  font-size: 0.8rem;
}
.direct-booking-quote-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.direct-booking-quote-head span { color: var(--text-muted); font-size: 0.68rem; }
.direct-booking-quote-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.direct-booking-quote-total button,
.direct-booking-manual-price button,
.direct-booking-fee-editor-head button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}
.direct-booking-quote-total button {
  padding: 4px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-input));
  white-space: nowrap;
}
.direct-booking-quote-total button:hover,
.direct-booking-manual-price button:hover,
.direct-booking-fee-editor-head button:hover { color: var(--text-primary); }
.direct-booking-fee-editor-head button:disabled { opacity: 0.45; cursor: not-allowed; }
.direct-booking-manual-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding: 6px 7px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.direct-booking-manual-price > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-soft);
  font-size: 0.65rem;
  font-weight: 600;
}
.direct-booking-price-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.direct-booking-price-editor > label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.direct-booking-price-editor > label > span,
.direct-booking-fee-editor-head > span {
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
}
.direct-booking-price-editor input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  outline: 0;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.74rem;
}
.direct-booking-price-editor input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--border-subtle));
  outline: 2px solid color-mix(in srgb, var(--accent) 16%, transparent);
}
.direct-booking-fee-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.direct-booking-fee-editor-lines { display: flex; flex-direction: column; gap: 5px; }
.direct-booking-fee-editor-lines > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(74px, 0.36fr) 30px;
  align-items: center;
  gap: 5px;
}
.direct-booking-fee-editor-lines button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.direct-booking-fee-editor-lines button:hover { border-color: #ef4444; color: #ef4444; }
.direct-booking-price-editor-empty,
.direct-booking-price-editor-error {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.65rem;
}
.direct-booking-price-editor-error { color: #ef7d7d; }
.direct-booking-price-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}
.direct-booking-price-editor-actions .btn { min-height: 32px; padding: 6px 10px; font-size: 0.68rem; }
.direct-booking-quote dl,
.direct-booking-result-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 10px 0 0;
}
.direct-booking-quote dl div,
.direct-booking-result-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.7rem;
}
.direct-booking-quote dt,
.direct-booking-quote dd,
.direct-booking-result-summary dt,
.direct-booking-result-summary dd { margin: 0; }
.direct-booking-quote dl .is-discount { color: var(--accent); }
.direct-booking-quote dl .is-total {
  margin-top: 3px;
  padding-top: 7px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 700;
}
.direct-booking-alert {
  margin: 0;
  padding: 8px 9px;
  border-radius: 7px;
  font-size: 0.71rem;
  line-height: 1.45;
}
.direct-booking-alert.is-error {
  border: 1px solid color-mix(in srgb, #ef4444 36%, var(--border-subtle));
  background: color-mix(in srgb, #ef4444 9%, transparent);
  color: #ef7d7d;
}
.direct-booking-coupon-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--text-soft);
  font-size: 0.68rem;
  line-height: 1.4;
}
.direct-booking-coupon-choice button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.direct-booking-coupon-choice button:disabled { opacity: 0.5; cursor: not-allowed; }
.direct-booking-pending-explainer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-input));
  color: var(--accent);
}
.direct-booking-pending-explainer > svg { margin-top: 1px; }
.direct-booking-pending-explainer strong { color: var(--text-primary); font-size: 0.73rem; }
.direct-booking-pending-explainer ol {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 5px 0 0;
  padding-left: 16px;
  color: var(--text-muted);
  font-size: 0.65rem;
  line-height: 1.4;
}
.direct-booking-submit {
  width: 100%;
  justify-content: center;
}
.direct-booking-security-copy {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.67rem;
  line-height: 1.45;
}
.direct-booking-security-copy svg { flex: 0 0 auto; margin-top: 1px; }
.direct-booking-result {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 11px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, #22c55e 38%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, #22c55e 7%, var(--bg-input));
}
.direct-booking-result-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, #22c55e 18%, transparent);
  color: #22c55e;
}
.direct-booking-result.is-pending {
  border-color: color-mix(in srgb, #f59e0b 38%, var(--border-subtle));
  background: color-mix(in srgb, #f59e0b 7%, var(--bg-input));
}
.direct-booking-result.is-pending .direct-booking-result-icon {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #f59e0b;
}
.direct-booking-result strong { color: var(--text-primary); font-size: 0.84rem; }
.direct-booking-result p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.7rem; line-height: 1.45; }
.direct-booking-link-row { display: flex; gap: 6px; min-width: 0; }
.direct-booking-link-row input { flex: 1 1 auto; }
.direct-booking-open { justify-content: center; }
.direct-booking-result-summary { margin: 0; padding: 9px 0; border-block: 1px solid var(--border-subtle); }

.ph-direct-booking-sheet {
  max-height: calc(94dvh - env(safe-area-inset-top));
  overflow-y: auto;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
.ph-direct-booking-head {
  padding: 2px 34px 14px 2px;
}
.ph-direct-booking-head > span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ph-direct-booking-head h2 {
  margin: 4px 0;
  color: var(--text-primary);
  font-size: 1rem;
}
.ph-direct-booking-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.direct-balance-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.direct-balance-state,
.direct-balance-paid {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}
.direct-balance-paid { color: #22c55e; }
.direct-balance-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
}
.direct-balance-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.direct-balance-summary dt,
.direct-balance-summary dd { margin: 0; }
.direct-balance-summary .is-due {
  padding-top: 5px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-weight: 700;
}
.direct-balance-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.direct-balance-charge-picker {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.direct-balance-charge-picker > span,
.direct-balance-segment-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.69rem;
  font-weight: 600;
}
.direct-balance-charge-picker .selectmenu-trigger {
  width: 100%;
  justify-content: space-between;
}
.direct-balance-form label > span {
  color: var(--text-muted);
  font-size: 0.69rem;
  font-weight: 600;
}
.direct-balance-form label em { font-style: normal; font-weight: 400; }
.direct-balance-link {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, #22c55e 32%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, #22c55e 7%, transparent);
}
.direct-balance-link p,
.direct-balance-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.45;
}
.direct-balance-link > div { display: flex; gap: 6px; flex-wrap: wrap; }
.direct-balance-link a { text-decoration: none; }
.direct-balance-history {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
}
.direct-balance-history strong { color: var(--text-soft); font-size: 0.7rem; }
.direct-cancellation-loading,
.direct-cancellation-state {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.direct-cancellation-trigger {
  width: fit-content;
  align-self: flex-start;
}
.direct-cancellation-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, #f59e0b 32%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, #f59e0b 5%, var(--bg-input));
}
.direct-cancellation-panel.is-completed {
  border-color: color-mix(in srgb, #22c55e 34%, var(--border-subtle));
  background: color-mix(in srgb, #22c55e 5%, var(--bg-input));
}
.direct-cancellation-panel.is-failed {
  border-color: color-mix(in srgb, #ef4444 38%, var(--border-subtle));
}
.direct-cancellation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.direct-cancellation-header > span,
.direct-cancellation-email > span,
.direct-cancellation-sources > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.direct-cancellation-header > span { color: #f59e0b; font-size: 0.8rem; }
.direct-cancellation-panel.is-completed .direct-cancellation-header > span { color: #22c55e; }
.direct-cancellation-header time { color: var(--text-muted); font-size: 0.7rem; }
.direct-cancellation-copy,
.direct-cancellation-note,
.direct-cancellation-disclosure {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.45;
}
.direct-cancellation-note strong { color: var(--text-soft); }
.direct-cancellation-stay { display: grid; gap: 2px; }
.direct-cancellation-stay strong { color: var(--text-primary); font-size: 0.82rem; }
.direct-cancellation-stay span { color: var(--text-muted); font-size: 0.72rem; }
.direct-cancellation-summary,
.direct-cancellation-decision-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
}
.direct-cancellation-summary > div,
.direct-cancellation-decision-summary > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-deep);
}
.direct-cancellation-summary dt,
.direct-cancellation-decision-summary dt { color: var(--text-muted); font-size: 0.68rem; }
.direct-cancellation-summary dd,
.direct-cancellation-decision-summary dd { margin: 0; overflow-wrap: anywhere; color: var(--text-primary); font-size: 0.78rem; font-weight: 700; }
.direct-cancellation-sources { display: grid; gap: 4px; color: var(--text-muted); font-size: 0.72rem; }
.direct-cancellation-alert {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-deep);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}
.direct-cancellation-alert svg { margin-top: 1px; }
.direct-cancellation-alert strong { color: var(--text-primary); }
.direct-cancellation-alert.is-pending { border-color: color-mix(in srgb, #f59e0b 34%, var(--border-subtle)); }
.direct-cancellation-alert.is-complete { border-color: color-mix(in srgb, #22c55e 34%, var(--border-subtle)); }
.direct-cancellation-alert.is-error { border-color: color-mix(in srgb, #ef4444 38%, var(--border-subtle)); }
.direct-cancellation-form {
  display: grid;
  gap: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--border-subtle);
}
.direct-cancellation-form label,
.direct-cancellation-external label { display: grid; gap: 4px; min-width: 0; }
.direct-cancellation-form label > span,
.direct-cancellation-external label > span { color: var(--text-soft); font-size: 0.72rem; font-weight: 650; }
.direct-cancellation-form input,
.direct-cancellation-form select,
.direct-cancellation-form textarea,
.direct-cancellation-external input,
.direct-cancellation-external select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-deep);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.76rem;
}
.direct-cancellation-form input:disabled { opacity: 0.75; color: var(--text-muted); }
.direct-cancellation-form textarea { min-height: 56px; resize: vertical; }
.direct-cancellation-policy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-deep));
}
.direct-cancellation-policy span { color: var(--text-muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; }
.direct-cancellation-policy strong { color: var(--text-primary); font-size: 0.78rem; text-align: right; }
.direct-cancellation-policy p { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 0.72rem; line-height: 1.4; }
.direct-cancellation-policy b { grid-column: 1 / -1; color: var(--accent); font-size: 0.74rem; }
.direct-cancellation-money-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.direct-cancellation-external {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, #f59e0b 38%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, #f59e0b 6%, var(--bg-deep));
}
.direct-cancellation-external p { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 0.72rem; line-height: 1.4; }
.direct-cancellation-external p strong { color: var(--text-primary); }
.direct-cancellation-form-actions,
.direct-cancellation-email { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.direct-cancellation-email { padding-top: 8px; border-top: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 0.72rem; }
.direct-cancellation-email > span { flex: 1 1 220px; }
@media (max-width: 520px) {
  .ph-direct-booking-sheet .direct-booking-field-grid,
  .ph-direct-booking-sheet .direct-booking-policy-control-grid { grid-template-columns: minmax(0, 1fr); }
  .direct-booking-policy-head { align-items: flex-start; flex-direction: column; }
  .direct-booking-policy-origin { width: 100%; justify-content: space-between; text-align: left; }
  .direct-booking-duration-input { grid-template-columns: minmax(0, 1fr) 104px; }
  .direct-cancellation-summary,
  .direct-cancellation-decision-summary,
  .direct-cancellation-money-grid,
  .direct-cancellation-external { grid-template-columns: minmax(0, 1fr); }
  .direct-cancellation-external p { grid-column: 1; }
  .direct-cancellation-form-actions > button { flex: 1 1 100%; }
}
/* When the draft pane (or task quick view) is portaled into the
   right pane, hide the default content underneath (pricing /
   inbox) so it doesn't bleed through behind the pane. The pane
   itself has a solid background but the underlying scroll
   container can still flash if a re-render runs. */
.workspace-property-nav-pane:has(.calendar-draft-pane) .workspace-pane-head,
.workspace-property-nav-pane:has(.calendar-draft-pane)
  .workspace-right-pane-scroll,
.workspace-property-nav-pane:has(.task-quick-pane) .workspace-pane-head,
.workspace-property-nav-pane:has(.task-quick-pane) .workspace-right-pane-scroll,
.workspace-property-nav-pane:has(.contact-quick-pane) .workspace-pane-head,
.workspace-property-nav-pane:has(.contact-quick-pane) .workspace-right-pane-scroll {
  visibility: hidden;
}

/* Contact quick view portaled into the property right pane — the SAME shell
   treatment as .task-quick-pane, hosting the inbox's ContactQuickView. */
.contact-quick-pane {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-deep);
  border-left: 1px solid var(--border-subtle);
  animation: support-pane-in 140ms ease-out;
}
.contact-quick-pane > .inbox-support {
  flex: 1;
  min-height: 0;
  padding: 0.75rem 0.85rem 1.25rem;
}

/* ================================================================
   Pane-4 unified-inbox embed — the reservation conversation is the
   REAL /inbox conversation component (InboxClient surface="reservation-rail",
   mounted by PropertiesReservationPane). The inbox manages its own
   internal scrolling (.inbox-bubbles) and drawer overlays, so the
   host pane must become a fixed-height flex cell instead of a padded
   scroll container — otherwise the whole conversation scrolls as one
   block and the composer drifts off-screen.
   ================================================================ */
.properties-pane4-inbox {
  /* container-type/name come from the co-applied .inbox-workspace-page class —
     the same container the inbox's own ≤800px narrow-pane layout keys off. */
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative; /* containing block for the inbox detail overlay drawer */
}
.workspace-property-nav-pane:has(.properties-pane4-inbox) .workspace-right-pane-scroll,
.ws-overlay-drawer--support:has(.properties-pane4-inbox) .workspace-right-pane-scroll {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* ================================================================
   Calendar inline toast — surfaces "task added" / similar
   transient confirmations near the bottom of the calendar without
   stealing focus or interrupting the operator. Auto-dismisses; the
   "Open" button switches the right pane into the new task.
   ================================================================ */
.property-calendar-toast {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  background: var(--bg-elevated, #1a1a1d);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  max-width: 460px;
  animation: property-calendar-toast-in 180ms ease-out;
}
@keyframes property-calendar-toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.property-calendar-toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 22%, transparent);
}
.property-calendar-toast-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.property-calendar-toast-body strong {
  font-size: 0.78rem;
  color: var(--text-primary);
}
.property-calendar-toast-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.property-calendar-toast-action {
  background: var(--accent, #6366f1);
  color: white;
  border: 0;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}
.property-calendar-toast-action:hover { filter: brightness(1.08); }
.property-calendar-toast-close {
  width: 22px;
  height: 22px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
}
.property-calendar-toast-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* ================================================================
   Task quick pane — TaskDrawer (pane mode) embedded inside the
   properties right pane. Wrapper provides the close button and
   stretches the embedded modal across the full pane.
   ================================================================ */
.task-quick-pane {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
  border-left: 1px solid var(--border-subtle);
  animation: support-pane-in 140ms ease-out;
}
.task-quick-pane > .task-modal--pane {
  flex: 1;
  min-height: 0;
}
.task-quick-pane-close {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 40;
  width: 34px;
  height: 34px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.task-quick-pane-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* The inbox rail variant — the same task pane, but IN FLOW as the rail's sole
   child (the rail's supportEntity switcher replaces the tab content), not an
   absolute overlay over a positioned shell aside. Keeps its own relative
   context so the × anchors; drops the shell-pane border/background so it
   sits flush inside .inbox-detail. */
.task-quick-pane.inbox-task-pane {
  position: relative;
  inset: auto;
  flex: 1;
  min-height: 0;
  border-left: none;
  background: transparent;
}
.inbox-task-pane-loading {
  padding: 1rem 0.5rem;
}

/* ================================================================
   Per-listing task/event chips — share the same compact primary-bar
   geometry as reservations. A resource row may remain tall enough to align
   with its list card, but its one event must not expand to fill that space.
   Tasks that overlap a confirmed
   reservation collapse into a separate task notification bubble on
   the cluster (handled below — see .property-calendar-res-stack-bubble[data-status="task"]).
   ================================================================ */
.property-calendar-task-chip {
  position: absolute;
  z-index: 4;
  box-sizing: border-box;
  /* The parent .property-calendar-res-layer disables pointer events
     so empty cells beneath remain clickable; chips have to opt back
     in or they're entirely inert. Reservation chips do the same — see
     .property-calendar-res-chip below. */
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  background: color-mix(in srgb, var(--task-color, var(--accent, #6366f1)) 8%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--task-color, var(--accent, #6366f1)) 24%, var(--border-subtle));
  border-left: 2px solid color-mix(in srgb, var(--task-color, var(--accent, #6366f1)) 58%, transparent);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.74rem;
  cursor: pointer;
  /* IMPORTANT: do NOT clip overflow on the chip itself — the hover
     popover lives inside this button and `overflow: hidden` would
     trap it inside the chip's bounds (the popover is positioned at
     `top: calc(100% + 6px)` which is outside the chip). Text
     ellipsis is handled by the inner `.property-calendar-task-chip-title`
     span instead. */
  white-space: nowrap;
  line-height: 1.1;
  /* Container query parent: drops the T-id and (eventually) the
     title when the chip shrinks below readable widths. */
  container-type: inline-size;
  container-name: task-chip;
  transition: transform 90ms ease-out, background 90ms ease-out, box-shadow 90ms ease-out;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.property-calendar-task-chip:hover {
  background: color-mix(in srgb, var(--task-color, var(--accent, #6366f1)) 7%, var(--bg-elevated));
  box-shadow: none;
}
.property-calendar-task-chip[draggable="true"] { cursor: grab; }
.property-calendar-task-chip[data-dragging="true"] {
  cursor: grabbing;
  opacity: .45;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--task-color, var(--accent)) 58%, transparent);
}
.property-calendar-row-days.is-task-drop-target .property-calendar-day-cell:hover {
  background: color-mix(in srgb, var(--accent, #6366f1) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #6366f1) 50%, transparent);
}
/* 🔴 LIFT THE WHOLE CHIP WHILE ITS HOVER CARD IS OPEN. The card cannot do
   this for itself, and raising the CARD's z-index will never fix it.

   `.property-calendar-task-chip` is a stacking context because it sets
   `z-index: 4` on a positioned element. The card lives INSIDE the chip, so the
   card's own z-index only ranks it against the chip's
   other children. Seen from outside, chip + card together are worth exactly
   4 — and every other task/event chip on the grid is also 4. Equal z-index
   means the tie breaks on DOM order, so any chip painted later (the next lane
   in the same row, or any row below) lands straight on top of an open card.
   Hakim, 2026-08-06, on a card from one row buried under the next row's
   chips: "tasks are appearing behind shit".

   Ducking out of the tie is the only fix, and the file already had the
   answer: `.property-calendar-res-chip:hover` does exactly this. Same number
   for the same reasons — 35 clears sibling chips (4), the sticky row label
   (28), the unassigned strip (29) and the sticky day header (30).

   🔴 The lift must NEVER use bare `:focus-within`. The chip is a <button>, so
   a mouse click focuses it and `:focus-within` then HOLDS until focus moves
   somewhere else entirely — the clicked chip floated at 35 indefinitely, over
   the sticky header, over the unassigned strip, and (tied at 35 with a
   genuinely hovered chip, later in DOM) over that chip's OPEN card
   (2026-08-07, "why is the 1 appearing above everything?" — the floating "1"
   was a clicked chip's avatar disc). The card only ever SHOWS for :hover /
   :focus-visible / focus inside the card itself (the display rules further up
   this file), so the lift matches exactly those states: `:focus-visible` is
   the chip's own keyboard focus, `:has(:focus-visible)` keeps the lift while
   tabbing through controls inside the open card, and a mouse click sets
   neither.

   Do NOT "simplify" this away by bumping `.property-calendar-task-chip-hover`
   instead — that number is trapped inside the chip's own stacking context and
   changing it does nothing at all. */
.property-calendar-task-chip:hover,
.property-calendar-task-chip:focus-visible {
  z-index: 35;
}
/* Separate rule ON PURPOSE. A browser without :has() support drops an
   entire selector LIST containing it — folding this into the rule above
   would silently kill the hover lift there too. Kept apart, an old
   browser only loses this keyboard-inside-the-card refinement. */
.property-calendar-task-chip:has(:focus-visible) {
  z-index: 35;
}
.property-calendar-task-chip.is-done {
  opacity: 0.55;
  text-decoration: line-through;
}
.property-calendar-task-chip-flag {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--task-color, currentColor);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--task-color, currentColor) 28%, transparent);
}
/* Task-type icon — same visual slot as the platform logo on a
   reservation chip. The icon stroke is the type color (set on the
   parent via --task-color); the background is a soft tint of that
   color so the glyph reads cleanly even when the chip is dense. */
.property-calendar-task-chip-typeicon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--task-color, currentColor) 10%, transparent);
  color: var(--task-color, currentColor);
}
.property-calendar-res-stack-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  color: var(--task-color, currentColor);
}
.property-calendar-res-hover-typeicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 4px;
  background: color-mix(in srgb, currentColor 18%, transparent);
}
.property-calendar-task-chip-num {
  /* 🔴 `0 0 auto`, NOT `0 1 auto`. The chip is `white-space: nowrap` with no
     overflow clip (the hover popover lives inside it — see the chip rule), so
     a SHRINKABLE number box shrinks below its own text width and the text
     keeps its size: the digits spill out of the box and the title, laid out
     immediately after that too-small box, paints straight over them. Hakim,
     2026-07-27, on a chip reading "T-108" with "BF, 151 CR Chec…" printed
     across the 8: "why are there tasks overlapping tasks? its impossible to
     read". The number is short and fixed; the TITLE is the elastic one and
     already ellipses (`flex: 1 1 auto` + overflow below). Never make this
     shrinkable again — hide it instead, which is what the `@container` rule
     below already does for chips under 110px. */
  flex: 0 0 auto;
  overflow: hidden;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--text-muted);
  font-feature-settings: "tnum";
}
.property-calendar-task-chip-time {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--text-primary) 76%, var(--text-muted));
  font-size: 0.62rem;
  font-weight: 700;
  font-feature-settings: "tnum";
}
.property-calendar-event-marker-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--task-color, var(--accent, #6366f1));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--task-color, var(--accent, #6366f1)) 22%, transparent);
}
.property-calendar-grid-shell[data-content-filter="overview"]
  .property-calendar-task-chip-num {
  display: none;
}
.property-calendar-task-chip-title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.74rem;
  font-weight: 500;
}
.property-calendar-task-assignees {
  flex: 0 0 auto;
  margin-left: auto;
}
.property-calendar-task-flip {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-warning) 14%, var(--bg-elevated));
  color: var(--state-warning);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1;
  white-space: nowrap;
}
.property-calendar-task-flip.is-detail { display: inline-flex; font-size: 10px; }
.property-calendar-task-chip .property-calendar-task-assignees > *,
.property-calendar-unassigned-chip .property-calendar-task-assignees > * {
  border-color: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
}
.property-calendar-res-hover-inner > p > span:last-child .task-assignee-facepile {
  margin-right: 6px;
  vertical-align: middle;
}
/* Hover preview — anchored under the chip near the cursor. Inherits
   the same panel chrome as the reservation hover card via
   .property-calendar-res-hover. */
.property-calendar-task-chip-hover {
  min-width: min(220px, var(--res-hover-width, 220px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}
.property-calendar-task-chip:hover .property-calendar-task-chip-hover,
.property-calendar-task-chip:focus-visible .property-calendar-task-chip-hover,
.property-calendar-task-chip .property-calendar-task-chip-hover:hover,
.property-calendar-task-chip .property-calendar-task-chip-hover:focus-within {
  opacity: 1;
  pointer-events: auto;
}
.property-calendar-task-chip:has(:focus-visible)
  .property-calendar-task-chip-hover {
  opacity: 1;
  pointer-events: auto;
}
/* Lane-chip hover card. Positioned by an inline `left` matching its chip
   (it sits in the track's coordinate space, not the chip's) and hangs
   below the lane over the rows, like the lane badge's own popover. */
.property-calendar-unassigned-hover {
  top: 100%;
  z-index: 41;
}
/* Status dot in a hover card's Status row — the chip's colour, restated
   next to the status name so the card and the chip read as the same thing. */
.property-calendar-res-hover-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: middle;
}

/* Container-query collapse for narrow chips. Order:
     - < 110px: drop the T-id (title + icon stay)
     - < 70px:  drop a Task title because its type icon still identifies it
                but KEEP an event title: source-calendar events do not have a
                type icon, so hiding the title turned them into blank blocks
   This stops the chip from rendering the T-id half-clipped or
   shoving the icon out of frame on a tiny chip (which is what
   "renders weird when too narrow" was about). */
@container task-chip (max-width: 110px) {
  .property-calendar-task-chip-num { display: none; }
  .property-calendar-task-flip { width: 7px; height: 7px; padding: 0; border-radius: 50%; overflow: hidden; color: transparent; }
}
@container task-chip (max-width: 70px) {
  .property-calendar-task-chip:not([data-calendar-object="event"]):not([data-calendar-task-card="true"]) .property-calendar-task-chip-title {
    display: none;
  }
  .property-calendar-task-chip[data-calendar-object="event"] .property-calendar-task-chip-title {
    display: block;
    min-width: 0;
  }
}
/* Exact time spans can be physically narrow. Their box must not grow merely
   to fit text — that would turn interaction chrome back into fake duration.
   Compact spans retain one type/source mark; sub-20px slivers become a clean
   coloured interval while the full accessible label and hover card remain. */
.property-calendar-task-chip[data-time-compact="true"] {
  justify-content: center;
  gap: 0;
  padding-inline: 3px;
}
.property-calendar-task-chip[data-time-compact="true"] > .property-calendar-task-chip-time,
.property-calendar-task-chip[data-time-compact="true"] > .property-calendar-task-chip-num,
.property-calendar-task-chip[data-time-compact="true"] > .property-calendar-task-chip-title,
.property-calendar-task-chip[data-time-compact="true"] > .property-calendar-task-flip,
.property-calendar-task-chip[data-time-compact="true"] > .property-calendar-task-assignees {
  display: none;
}
.property-calendar-task-chip[data-time-sliver="true"] {
  padding-inline: 0;
  border-left-width: 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--task-color, var(--accent, #6366f1)) 42%, var(--bg-elevated));
}
.property-calendar-task-chip[data-time-sliver="true"] > .property-calendar-task-chip-typeicon,
.property-calendar-task-chip[data-time-sliver="true"] > .property-calendar-task-chip-flag,
.property-calendar-task-chip[data-time-sliver="true"] > .property-calendar-event-marker-dot {
  display: none;
}

/* Task entries inside a reservation cluster's overflow stack list.
   Mirrors .property-calendar-res-stack-item but with task accent
   colouring keyed off --task-color. */
.property-calendar-res-stack-item--task {
  --status-color: var(--task-color, var(--accent, #6366f1));
}
.property-calendar-res-stack-item--task::before {
  background: var(--task-color, var(--accent, #6366f1));
}
/* Task notification bubble on a reservation cluster — same quiet amber
   attention treatment as the linked-task badge on the stay itself. */
.property-calendar-res-stack-bubble[data-status="task"] {
  border-color: color-mix(in srgb, var(--state-warning) 36%, var(--cal-line));
  background: color-mix(in srgb, var(--state-warning) 14%, var(--cal-surface));
  color: var(--state-warning);
}

/* ================================================================
   Workspace calendar lanes — sticky rows below the date header for
   source calendars and Tasks not linked to a listing. Their names and
   full-list controls live on the aligned resource rail, not in this grid.
   ================================================================ */
.property-calendar-unassigned-lane {
  position: sticky;
  /* Sit just below the sticky month and day bands. */
  top: calc(var(--month-h, 28px) + var(--day-h, 40px));
  /* 29 by RELATION, not taste. The rows render AFTER this sticky strip, so a
     chip that merely TIES the strip's z-index paints over it as its row
     scrolls beneath (later DOM order wins a tie). At the old value of 4 every
     task chip (resting z 4) slid straight across the strip while the then
     unlayered reservation chips ducked under — 2026-08-07, "tasks appearing on top
     of the task bar thing at the top". 29 clears resting chips (4), block
     strips (2) and the sticky row label (28, which rides its row up under
     the strip), and stays below the sticky day header (30) and the one chip
     the user is interacting with (35). Relations pinned by
     PropertyMultiCalendarGrid.task-hover-stacking.test.ts — never tie this
     with the chips again. */
  z-index: 29;
  /* Each source / Tasks resource contributes one fixed 34px row. Crowding is
     an in-row count, never another vertical lane, so horizontal range settling
     cannot grow and shrink the sticky area or move every listing underneath. */
  height: var(--cal-unassigned-lane-h, 34px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--cal-surface-3, var(--bg-base));
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  pointer-events: auto;
}
/* Match the resource rail while its expanded Staff rows scroll away. */
.property-calendar-grid-shell[data-staff-expanded="true"] .property-calendar-header,
.property-calendar-grid-shell[data-staff-expanded="true"] .property-calendar-unassigned-lane {
  position: relative;
  top: auto;
}
.property-calendar-workspace-lane-row {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: 0 0 var(--cal-workspace-lane-h, 34px);
  height: var(--cal-workspace-lane-h, 34px);
  min-height: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--cal-surface-3, var(--bg-base));
}
.property-calendar-workspace-lane-row:last-child {
  border-bottom: 0;
}
.property-calendar-staff-summary-row {
  background: color-mix(in srgb, #14b8a6 6%, var(--cal-surface-3, var(--bg-base)));
}
.property-calendar-staff-summary-track {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
}
.property-calendar-staff-summary-track > .property-calendar-past-overlay {
  z-index: 4;
}
.property-calendar-staff-summary-track > .property-calendar-now-line {
  z-index: 5;
}
.property-calendar-staff-summary-day {
  position: absolute;
  inset-block: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 0 4px;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--cal-line) 78%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--cal-text);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
}
.property-calendar-staff-summary-day:hover,
.property-calendar-staff-summary-day:focus-visible {
  z-index: 2;
  background: color-mix(in srgb, #14b8a6 15%, var(--cal-surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #14b8a6 56%, transparent);
  outline: 0;
}
.property-calendar-staff-summary-day:disabled {
  cursor: default;
}
.property-calendar-staff-summary-day[data-uncovered="true"] {
  background: color-mix(in srgb, #f59e0b 8%, transparent);
}
.property-calendar-staff-summary-primary {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  color: var(--cal-text);
  font-size: 0.61rem;
  font-weight: 760;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-staff-summary-primary i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: #14b8a6;
}
.property-calendar-staff-summary-day[data-state="away"]
  .property-calendar-staff-summary-primary i {
  background: #a855f7;
}
.property-calendar-staff-summary-day[data-state="assigned"]
  .property-calendar-staff-summary-primary i {
  background: #2563eb;
}
.property-calendar-staff-summary-day[data-state="event"]
  .property-calendar-staff-summary-primary i {
  background: #2563eb;
}
.property-calendar-staff-summary-day[data-state="uncovered"]
  .property-calendar-staff-summary-primary i {
  background: #f59e0b;
}
.property-calendar-staff-summary-empty {
  color: color-mix(in srgb, var(--cal-muted) 52%, transparent);
  font-size: 0.72rem;
}
.property-calendar-grid-shell[data-zoom-stage="compact"]
  .property-calendar-staff-summary-day {
  padding-inline: 2px;
}
.property-calendar-grid-shell[data-zoom-stage="compact"]
  .property-calendar-staff-summary-primary {
  gap: 2px;
  font-size: 0.55rem;
}
.property-calendar-staff-person-row {
  background: color-mix(in srgb, #14b8a6 3%, var(--cal-surface-3, var(--bg-base)));
}
.property-calendar-staff-person-track {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
}
.property-calendar-staff-person-track > .property-calendar-past-overlay {
  z-index: 4;
}
.property-calendar-staff-person-track > .property-calendar-now-line {
  z-index: 5;
}
.property-calendar-staff-person-day {
  position: absolute;
  inset-block: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 3px;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--cal-line) 78%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--cal-text);
  font: inherit;
  cursor: pointer;
}
.property-calendar-staff-person-day:hover,
.property-calendar-staff-person-day:focus-visible {
  z-index: 6;
  background: color-mix(in srgb, var(--staff-status-accent) 10%, var(--cal-surface-2));
  outline: 0;
}
.property-calendar-staff-person-status,
.property-calendar-staff-person-activity {
  width: 100%;
  height: 18px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  padding: 0 5px;
  border-radius: 4px;
  color: var(--cal-text);
  font-size: 0.58rem;
  line-height: 1;
  white-space: nowrap;
}
.property-calendar-staff-person-status {
  border: 1px solid color-mix(in srgb, var(--staff-status-accent) 68%, var(--cal-line));
  border-left: 3px solid var(--staff-status-accent);
  background: color-mix(in srgb, var(--staff-status-accent) 12%, var(--cal-surface-3));
  font-weight: 730;
}
.property-calendar-staff-person-activity {
  border: 1px solid color-mix(in srgb, var(--staff-activity-accent) 60%, var(--cal-line));
  border-left: 3px solid var(--staff-activity-accent);
  background: color-mix(in srgb, var(--staff-activity-accent) 9%, var(--cal-surface-3));
  font-weight: 650;
}
.property-calendar-staff-person-day[data-status="leave"]
  .property-calendar-staff-person-status {
  background: color-mix(in srgb, var(--staff-status-accent) 16%, var(--cal-surface-3));
}
.property-calendar-staff-person-day[data-status="off"]
  .property-calendar-staff-person-status,
.property-calendar-staff-person-day[data-status="unconfigured"]
  .property-calendar-staff-person-status {
  border-color: color-mix(in srgb, var(--cal-line) 82%, transparent);
  border-left-color: color-mix(in srgb, var(--cal-muted) 58%, transparent);
  background: color-mix(in srgb, var(--cal-muted) 4%, transparent);
  color: var(--cal-muted);
  font-weight: 620;
}
.property-calendar-staff-person-day[data-status="unconfigured"]
  .property-calendar-staff-person-status {
  border-style: dashed;
  color: color-mix(in srgb, #14b8a6 72%, var(--cal-text));
}
.property-calendar-staff-person-activity[data-empty="true"] {
  border-color: transparent;
  border-left-color: transparent;
  background: transparent;
  color: color-mix(in srgb, var(--cal-muted) 66%, transparent);
  font-weight: 560;
}
.property-calendar-staff-person-day[data-off-day-activity="true"]
  .property-calendar-staff-person-activity {
  border-color: color-mix(in srgb, #f59e0b 65%, var(--cal-line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #f59e0b 14%, transparent);
}
.property-calendar-staff-person-status > span:last-child,
.property-calendar-staff-person-activity > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-calendar-staff-person-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.property-calendar-staff-person-event-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--staff-activity-accent);
}
.property-calendar-staff-status-band {
  position: absolute;
  z-index: 3;
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--staff-status-accent) 66%, var(--cal-line));
  border-left: 3px solid var(--staff-status-accent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--staff-status-accent) 12%, var(--cal-surface-3));
  color: var(--cal-text);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 730;
  line-height: 1;
  cursor: pointer;
}
.property-calendar-staff-status-band > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.property-calendar-staff-status-band:hover,
.property-calendar-staff-status-band:focus-visible {
  z-index: 6;
  background: color-mix(in srgb, var(--staff-status-accent) 20%, var(--cal-surface-3));
  outline: 1px solid color-mix(in srgb, var(--staff-status-accent) 75%, transparent);
}
.property-calendar-staff-status-band[data-status="off"],
.property-calendar-staff-status-band[data-status="unconfigured"] {
  border-color: color-mix(in srgb, var(--cal-line) 82%, transparent);
  border-left-color: color-mix(in srgb, var(--cal-muted) 58%, transparent);
  background: color-mix(in srgb, var(--cal-muted) 4%, var(--cal-surface-3));
  color: var(--cal-muted);
  font-weight: 620;
}
.property-calendar-staff-status-band[data-status="unconfigured"] {
  border-style: dashed;
  color: color-mix(in srgb, #14b8a6 72%, var(--cal-text));
}
.property-calendar-staff-status-band[data-off-day-activity="true"] {
  border-right-color: color-mix(in srgb, #f59e0b 58%, var(--cal-line));
  box-shadow: inset -2px 0 color-mix(in srgb, #f59e0b 72%, transparent);
}
.property-calendar-unassigned-track {
  position: relative;
  flex: 1 1 auto;
  height: 100%;
}
.property-calendar-unassigned-track > .property-calendar-past-overlay {
  z-index: 4;
}
.property-calendar-unassigned-track > .property-calendar-now-line {
  z-index: 5;
}
.property-calendar-workspace-day-target {
  position: absolute;
  inset-block: 0;
  z-index: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
  border-radius: 0;
  background: transparent;
  cursor: crosshair;
}
.property-calendar-workspace-day-target:hover,
.property-calendar-workspace-day-target:focus-visible {
  background: color-mix(in srgb, var(--cal-workspace-lane-color) 11%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cal-workspace-lane-color) 48%, transparent);
  outline: none;
}
.property-calendar-unassigned-chip {
  position: absolute;
  z-index: 1;
  /* 🔴 `top` and `height` are set INLINE from the chip's packed lane. They
     used to be `top: 5px; bottom: 5px` here, which is precisely why every
     chip on a crowded day drew in the same place and read as one. */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  box-sizing: border-box;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent, #6366f1) 16%, transparent);
  border: 1px solid var(--accent, #6366f1);
  border-left-width: 3px;
  color: var(--text-primary);
  font-size: 0.7rem;
  cursor: pointer;
  /* Keeps clipping its own text — a one-day chip is ~20px wide and the
     "T-18" has to be cut, not shrunk away. That's why this chip's hover
     card is a SIBLING in the track (.property-calendar-unassigned-hover)
     rather than a child like .property-calendar-task-chip's: a child would
     be trapped by this `overflow: hidden`. */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: transform 90ms ease-out, background 90ms ease-out;
}
.property-calendar-unassigned-chip:hover {
  background: color-mix(in srgb, var(--accent, #6366f1) 24%, transparent);
  z-index: 6;
}
.property-calendar-unassigned-chip:focus-visible {
  z-index: 6;
}
.property-calendar-unassigned-chip.is-done {
  opacity: 0.55;
  text-decoration: line-through;
}
.property-calendar-unassigned-chip-num {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: 0.62rem;
  color: var(--text-muted);
  font-feature-settings: "tnum";
}
.property-calendar-unassigned-chip-title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-calendar-unassigned-chip[data-time-compact="true"] {
  justify-content: center;
  gap: 0;
  padding-inline: 3px;
}
.property-calendar-unassigned-chip[data-time-compact="true"] > .property-calendar-unassigned-chip-num,
.property-calendar-unassigned-chip[data-time-compact="true"] > .property-calendar-unassigned-chip-title {
  display: none;
}
.property-calendar-unassigned-chip[data-time-compact="true"]
  > .property-calendar-task-assignees {
  display: none;
}
.property-calendar-unassigned-chip[data-time-compact="true"][data-has-assignee="true"] {
  padding-inline: 1px;
}
.property-calendar-unassigned-chip[data-time-compact="true"][data-has-assignee="true"]
  > .property-calendar-task-assignees {
  display: inline-flex;
}
.property-calendar-unassigned-chip[data-time-compact="true"][data-has-assignee="true"]
  > .property-calendar-task-chip-typeicon,
.property-calendar-unassigned-chip[data-time-compact="true"][data-has-assignee="true"]
  > .property-calendar-task-chip-flag {
  display: none;
}
/* A date-only item owns a date, not a fake clock duration. In the workspace
   lane it uses that one column as a labelled pill so it cannot collapse into
   an unexplained square. Exact-time points remain narrow markers. */
.property-calendar-unassigned-chip[data-time-geometry="date"] {
  justify-content: flex-start;
  gap: 4px;
  padding-inline: 6px;
}
.property-calendar-unassigned-chip[data-time-geometry="date"]
  > .property-calendar-unassigned-chip-num {
  display: none;
}
.property-calendar-unassigned-chip[data-time-geometry="date"]
  > .property-calendar-task-assignees {
  display: inline-flex;
  order: 1;
}
.property-calendar-unassigned-chip[data-time-geometry="date"]
  > .property-calendar-unassigned-chip-title {
  display: block;
  min-width: 0;
  order: 2;
}
.property-calendar-unassigned-chip[data-time-geometry="date"][data-has-assignee="true"]
  > .property-calendar-task-chip-typeicon,
.property-calendar-unassigned-chip[data-time-geometry="date"][data-has-assignee="true"]
  > .property-calendar-task-chip-flag {
  display: none;
}
.property-calendar-unassigned-chip[data-time-geometry="date"]
  > .property-calendar-task-chip-flag {
  background: var(--accent, currentColor);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, currentColor) 28%, transparent);
}
.property-calendar-unassigned-chip[data-time-geometry="date"][data-time-compact="true"] {
  justify-content: center;
  gap: 0;
  padding-inline: 5px;
}
.property-calendar-unassigned-chip[data-time-geometry="date"][data-time-compact="true"]
  > .property-calendar-unassigned-chip-title {
  display: none;
}
.property-calendar-unassigned-chip[data-time-geometry="date"][data-time-compact="true"]
  > .property-calendar-task-assignees {
  display: inline-flex;
}
.property-calendar-unassigned-chip[data-time-sliver="true"] {
  padding-inline: 0;
  border-left-width: 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent, #6366f1) 42%, var(--cal-surface-3));
}
.property-calendar-unassigned-chip[data-time-sliver="true"] > .property-calendar-task-chip-typeicon,
.property-calendar-unassigned-chip[data-time-sliver="true"] > .property-calendar-event-marker-dot {
  display: none;
}

/* A Clean's start/due pair is an availability window, not twelve hours of
   labour. The broad grid therefore renders it as a dashed task card inside its
   due-date cell; the hover card and Task detail retain both exact edges. */
.property-calendar-task-chip[data-time-geometry="window"],
.property-calendar-unassigned-chip[data-time-geometry="window"] {
  --calendar-window-edge: color-mix(
    in srgb,
    var(--task-color, var(--accent, #6366f1)) 72%,
    var(--text-primary)
  );
  justify-content: center;
  gap: 0;
  padding-inline: 2px;
  border: 1px dashed var(--calendar-window-edge);
  border-left: 3px solid var(--calendar-window-edge);
  border-radius: 4px;
  background: color-mix(
    in srgb,
    var(--task-color, var(--accent, #6366f1)) 14%,
    var(--cal-surface-3, var(--bg-elevated))
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--calendar-window-edge) 14%, transparent);
}
.property-calendar-task-chip[data-time-geometry="window"]:hover,
.property-calendar-task-chip[data-time-geometry="window"]:focus-visible,
.property-calendar-unassigned-chip[data-time-geometry="window"]:hover,
.property-calendar-unassigned-chip[data-time-geometry="window"]:focus-visible {
  --calendar-window-edge: color-mix(
    in srgb,
    var(--task-color, var(--accent, #6366f1)) 88%,
    white
  );
}

/* In-row "+N" doorway — one per day column that still has more work. It is
   intentionally opaque and compact: the count replaces the trailing part of
   the one visible chip rather than adding a row and moving the whole grid. */
.property-calendar-unassigned-more {
  position: absolute;
  z-index: 3;
  box-sizing: border-box;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: color-mix(
    in srgb,
    var(--accent, #6366f1) 22%,
    var(--cal-surface-3)
  );
  color: var(--text-primary);
  font-size: 0.6rem;
  font-weight: 700;
  font-feature-settings: "tnum";
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  transition: background 90ms ease-out, color 90ms ease-out;
}
.property-calendar-unassigned-more:hover,
.property-calendar-unassigned-more:focus-visible {
  background: color-mix(in srgb, var(--accent, #6366f1) 22%, transparent);
  border-color: var(--accent, #6366f1);
  color: var(--text-primary);
}
/* A property row that cannot fit every overlapping job replaces the collided
   portion of its final lane with ONE opaque group bar. This is intentionally
   not the workspace strip's tiny `+N`: painting that pill over a task title
   made both labels unreadable and repeated it in every day column. */
.property-calendar-rowwork-stack {
  position: absolute;
  pointer-events: auto;
  z-index: 6;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 34px;
  padding: 0 7px;
  border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 62%, var(--border-subtle));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent, #6366f1) 18%, var(--bg-elevated));
  color: var(--text-primary);
  box-shadow:
    0 0 0 1px var(--bg-elevated),
    0 3px 10px color-mix(in srgb, #000 28%, transparent);
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}
.property-calendar-rowwork-stack:hover,
.property-calendar-rowwork-stack:focus-visible {
  border-color: var(--accent, #6366f1);
  background: color-mix(in srgb, var(--accent, #6366f1) 28%, var(--bg-elevated));
}
.property-calendar-rowwork-stack-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent, #6366f1);
  color: #fff;
  font-feature-settings: "tnum";
}
.property-calendar-rowwork-stack-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-calendar-rowwork-stack-action {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.property-calendar-grid-shell[data-zoom-stage="compact"]
  .property-calendar-rowwork-stack-action {
  display: none;
}

/* Drill-in opened by the strip's badge or a day's "+N" pill. Wears the cell
   menu's chrome (see .property-calendar-cell-menu) and only widens it and
   adds a scrolling body — a second popover look for the same calendar would
   be a regression, not a feature. */
/* Both classes on purpose: .property-calendar-cell-menu sets max-width: 280px
   and lives LATER in this file, so a single-class selector here would lose the
   tie and the list would render at menu width. */
.property-calendar-cell-menu.property-calendar-unassigned-drill {
  min-width: 320px;
  max-width: 380px;
}
.property-calendar-unassigned-drill-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Long enough to scan, short enough to stay a popover. 44 items on the
     busiest day scroll rather than running off the screen. */
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.property-calendar-unassigned-drill-empty {
  margin: 0;
  padding: 10px 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
}
.property-calendar-unassigned-drill-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  background: transparent;
  border: 0;
  /* Priority tint, restated from the chip the row stands for. */
  border-left: 3px solid var(--border-subtle);
  border-radius: 4px;
  font: inherit;
  color: var(--text-primary);
  cursor: pointer;
}
.property-calendar-unassigned-drill-row:hover,
.property-calendar-unassigned-drill-row:focus-visible {
  background: color-mix(in srgb, var(--border-subtle) 55%, transparent);
}
.property-calendar-unassigned-drill-badge {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-subtle) 85%, transparent);
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  font-feature-settings: "tnum";
}
.property-calendar-unassigned-drill-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.property-calendar-unassigned-drill-title {
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-calendar-unassigned-drill-meta {
  display: flex;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-calendar-unassigned-drill-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* ================================================================
   Cell action popover — opens on empty / reservation cell click and
   gives the user explicit choices instead of teleporting them to
   the settlement-waterfall pane / inbox.
   ================================================================ */
.property-calendar-cell-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13500;
  background: transparent;
  cursor: default;
}
.property-calendar-cell-menu {
  position: fixed;
  z-index: 14000;
  min-width: 220px;
  max-width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.36);
  padding: 4px;
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  animation: property-calendar-cell-menu-in 110ms ease-out;
}
@keyframes property-calendar-cell-menu-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}
.property-calendar-cell-menu-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 4px 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}
.property-calendar-cell-menu-headline {
  flex: 1 1 auto;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.property-calendar-cell-menu-close {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 16px;
  cursor: pointer;
  border-radius: 4px;
}
.property-calendar-cell-menu-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}
.property-calendar-cell-menu-list {
  display: flex;
  flex-direction: column;
}
.property-calendar-cell-menu-task-flag {
  margin: 1px 6px 5px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, var(--state-warning) 9%, transparent);
  color: var(--state-warning);
  font-size: .69rem;
  font-weight: 750;
}
.property-calendar-cell-menu-event-detail {
  display: grid;
  gap: 6px;
  margin: 1px 5px 5px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg-input) 66%, transparent);
}
.property-calendar-cell-menu-event-detail p {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.69rem;
  line-height: 1.35;
}
.property-calendar-cell-menu-event-detail p > svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent, #6366f1);
}
.property-calendar-cell-menu-event-detail p > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.property-calendar-cell-menu-event-detail strong {
  color: var(--text-primary);
  font-size: 0.72rem;
}
.property-calendar-cell-menu-event-detail .is-notes,
.property-calendar-cell-menu-event-detail .is-related {
  padding-top: 5px;
  border-top: 1px solid var(--border-subtle);
}
.property-calendar-cell-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
}
.property-calendar-cell-menu-item:hover {
  background: color-mix(in srgb, var(--accent, #6366f1) 14%, transparent);
}
.property-calendar-cell-menu-item:disabled {
  cursor: wait;
  opacity: 0.48;
}
.property-calendar-cell-menu-item:disabled:hover {
  background: transparent;
}
.property-calendar-cell-menu-move {
  display: grid;
  gap: 6px;
  margin: 3px 6px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg-input) 66%, transparent);
}
.property-calendar-cell-menu-move > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
  font-size: .72rem;
  font-weight: 650;
}
.property-calendar-cell-menu-move > span svg { color: var(--accent, #6366f1); }
.property-calendar-cell-menu-move > div { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.property-calendar-cell-menu-move input,
.property-calendar-cell-menu-move button {
  min-height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 4px 7px;
  font: inherit;
  font-size: .7rem;
}
.property-calendar-cell-menu-move button {
  border-color: color-mix(in srgb, var(--accent, #6366f1) 45%, var(--border-subtle));
  color: var(--accent, #6366f1);
  cursor: pointer;
  font-weight: 700;
}
.property-calendar-cell-menu-move button:disabled { cursor: default; opacity: .45; }
.property-calendar-cell-menu-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--bg-input);
  color: var(--accent, #6366f1);
  flex: 0 0 24px;
}
.property-calendar-cell-menu-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.property-calendar-cell-menu-item-label {
  font-size: 0.78rem;
  font-weight: 500;
}
.property-calendar-cell-menu-item-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.property-calendar-cell-menu-error {
  margin: 4px 8px 6px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--danger, #ef4444) 36%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--danger, #ef4444) 9%, transparent);
  color: var(--danger, #ef4444);
  font-size: 0.68rem;
  line-height: 1.35;
}

/* Light theme overrides ---------------------------------- */
[data-theme="light"] .task-modal-overlay { background: rgba(15, 23, 42, 0.28); }
[data-theme="light"] .task-modal-frame {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
}
[data-theme="light"] .task-modal-topbar { background: var(--bg-deep); }
[data-theme="light"] .task-modal-main { background: var(--bg-elevated); }
[data-theme="light"] .task-modal-side { background: var(--bg-deep); }
[data-theme="light"] .task-modal-comment-body,
[data-theme="light"] .task-modal-time-row,
[data-theme="light"] .task-modal-deps-row,
[data-theme="light"] .task-modal-attachment,
[data-theme="light"] .task-modal-subtask {
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
}
[data-theme="light"] .task-modal-pill-btn.primary { color: #ffffff; }
[data-theme="light"] .task-modal-checkbox.is-checked::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8l3.5 3.5L13 5'/%3E%3C/svg%3E");
}
[data-theme="light"] .task-modal-checkbox.is-checked {
  background: #18181b;
  border-color: #18181b;
}
[data-theme="light"] .task-date-pop-done {
  background: #18181b;
  color: #ffffff;
}

/* —— Smart Pricing / Pricing tab —— */

/* ── Save bar: sp-tab-outer / sp-scroll-area layout so sticky bar sticks ── */
.sp-tab-outer { display:flex; flex-direction:column; height:calc(100dvh - 10rem); }
.sp-scroll-area { flex:1; overflow-y:auto; min-height:0; display:flex; flex-direction:column; }

/* ── Root layout ── */
.sp-root {
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:16px;
}
.sp-root .properties-section-card { padding:18px !important; margin:0; }

/* Visual order is the DOM order. The previous CSS `order: N` pass was
   silently breaking when LazyMount wrappers (which contain Strategy /
   Date overrides / Competition area) became direct flex children — they
   had no order rule and defaulted to order: 0, rendering ABOVE the
   hero. That's why hosts ended up scrolling past everything to find the
   sub-tab nav. The JSX is now ordered the way the host should see it
   (hero → sub-tab nav → foundations → strategy → competition → insights).
   If a future refactor wants to shuffle order without moving JSX, set
   explicit orders on EVERY direct flex child — no implicit defaults. */
.sp-root > .sp-city-row                    { order:10; }

/* Auto-configure status line — slides under the hero header */
.sp-auto-status {
  display:flex; align-items:center; gap:0.5rem;
  padding:10px 12px;
  border-radius:9px;
  font-size:13px; font-weight:600;
  background:var(--surface-muted);
  border:1px solid var(--border-subtle);
  color:var(--text-primary);
}
.sp-auto-status--err {
  color:var(--state-error);
  border-color:color-mix(in srgb,var(--state-error) 35%,var(--border-subtle));
}
.sp-auto-spinner {
  width:11px; height:11px; border-radius:50%;
  border:2px solid color-mix(in srgb,var(--ring) 30%,transparent);
  border-top-color:var(--ring);
  animation:sp-spin 0.8s linear infinite;
  flex-shrink:0;
}
@keyframes sp-spin { to { transform:rotate(360deg); } }

.sp-auto-undo {
  margin-left:auto;
  min-height:36px;
  padding:7px 10px;
  font-size:13px;
}
.sp-auto-undo:disabled { opacity:0.6; cursor:wait; }

/* Auto-configure preview modal */
.sp-autocfg-overlay {
  position:fixed; inset:0; z-index:200;
  background:rgba(0,0,0,0.78);
  backdrop-filter:blur(3px);
  display:flex; align-items:center; justify-content:center;
  padding:2rem 1rem;
  overflow-y:auto;
  animation:sp-fade 0.15s ease-out;
}
@keyframes sp-fade { from { opacity:0; } to { opacity:1; } }
.sp-autocfg-modal {
  background:var(--surface);
  border:1px solid var(--border-subtle);
  border-radius:14px;
  width:min(640px, 100%);
  max-height:90vh;
  display:flex; flex-direction:column;
  box-shadow:0 20px 60px -10px rgba(0,0,0,0.45), 0 6px 16px -6px rgba(0,0,0,0.25);
  overflow:hidden;
}
.sp-autocfg-head {
  display:flex; align-items:flex-start; justify-content:space-between; gap:0.75rem;
  padding:1rem 1.1rem 0.75rem;
  border-bottom:1px solid var(--border-subtle);
}
.sp-autocfg-title { margin:0 0 0.25rem; font-size:1.05rem; font-weight:800; letter-spacing:-0.01em; color:var(--text-primary); }
.sp-autocfg-sub { margin:0; font-size:0.82rem; color:var(--text-muted); line-height:1.5; }
.sp-autocfg-sub strong { color:var(--text-primary); font-weight:800; }
.sp-autocfg-close {
  background:transparent; border:none; cursor:pointer;
  width:30px; height:30px; border-radius:8px;
  font-size:1.4rem; line-height:1; color:var(--text-muted);
  flex-shrink:0;
}
.sp-autocfg-close:hover { background:var(--surface-muted); color:var(--text-primary); }
.sp-autocfg-close:disabled { opacity:0.4; cursor:not-allowed; }

.sp-autocfg-body {
  padding:0.85rem 1.1rem;
  overflow-y:auto;
  flex:1;
  display:flex; flex-direction:column; gap:0.85rem;
}
.sp-autocfg-empty { font-size:0.85rem; color:var(--text-muted); margin:0; padding:1rem 0; text-align:center; }
.sp-autocfg-group {
  border:1px solid var(--border-subtle);
  border-radius:10px;
  overflow:hidden;
}
.sp-autocfg-group-h {
  margin:0; padding:0.55rem 0.85rem;
  font-size:0.62rem; font-weight:800; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--text-muted);
  background:color-mix(in srgb,var(--bg-deep) 40%,var(--surface-muted));
  border-bottom:1px solid var(--border-subtle);
}
.sp-autocfg-rows { display:flex; flex-direction:column; }
.sp-autocfg-row {
  display:grid;
  grid-template-columns:1.3fr 1fr 18px 1fr;
  gap:0.55rem;
  align-items:center;
  padding:0.5rem 0.85rem;
  border-bottom:1px solid var(--border-subtle);
  font-size:0.82rem;
}
.sp-autocfg-row:last-child { border-bottom:none; }
.sp-autocfg-key { font-weight:700; color:var(--text-primary); }
.sp-autocfg-before {
  color:var(--text-muted);
  text-align:right;
  font-variant-numeric:tabular-nums;
}
.sp-autocfg-arrow { color:var(--text-soft); font-size:0.75rem; text-align:center; }
.sp-autocfg-after {
  color:var(--text-primary);
  font-weight:700;
  font-variant-numeric:tabular-nums;
}

.sp-autocfg-actions {
  display:flex; justify-content:flex-end; gap:0.55rem;
  padding:0.85rem 1.1rem;
  border-top:1px solid var(--border-subtle);
  background:color-mix(in srgb,var(--bg-deep) 25%,var(--surface));
}
.sp-status-dot { width:6px; height:6px; border-radius:50%; background:var(--border-subtle); flex-shrink:0; transition:background 0.2s; }
.sp-status-dot--on { background:var(--state-success); }
.sp-fetch-btn { display:inline-flex; align-items:center; gap:0.3rem; padding:0.22rem 0.6rem; border-radius:6px; font-size:0.72rem; font-weight:700; border:1px solid var(--border-subtle); background:var(--surface-muted); color:var(--text-muted); cursor:pointer; transition:all 0.15s; }
.sp-fetch-btn:hover { border-color:color-mix(in srgb,var(--ring) 50%,var(--border-subtle)); color:var(--text-primary); }
.sp-city-row { margin-top:0.75rem; }
.sp-city-sel { font-size:0.8rem !important; }

/* ── Foundations ── */
.sp-found-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(165px,1fr)); gap:0.7rem; margin-top:0.6rem; align-items:end; }
.sp-found-subhead { font-size:0.68rem; font-weight:800; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-muted); margin:1.1rem 0 0.1rem; padding-bottom:0.3rem; border-bottom:1px solid var(--border-subtle); }
.sp-found-subhead-desc { font-size:0.78rem; color:var(--text-muted); margin:0.35rem 0 0.55rem; line-height:1.45; }
.sp-found-subhead-desc em { font-style:normal; font-weight:700; color:var(--text-primary); }
/* "Minimum nights" while the smart stay engine owns it: a calm managed state in
   place of a second editable input (one editable minimum at a time, 2026-07-09).
   Neutral tokens — this is information, not a warning. */
.sp-found-managed {
  display:inline-flex; align-items:center; gap:0.4rem;
  padding:0.45rem 0.7rem;
  font-size:0.78rem; line-height:1.3; color:var(--text-muted);
  background:var(--bg-elevated);
  border:1px dashed var(--border-subtle);
  border-radius:8px;
}

/* Foundations → Fees subsection. Wider min-column than the rest of sp-found-grid
   so currency-prefixed inputs don't get cramped. Inputs use .properties-currency-input
   to share the same affordance as the rest of the app. */
.sp-fees-grid { grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); }

/* ── Channel overrides ── per-channel fee + discount overrides surfaced under
   Foundations. Each card represents one connected child channel. */
.sp-channel-overrides-grid {
  display:grid;
  grid-template-columns:1fr;
  gap:0.75rem;
  margin-top:0.65rem;
}
.sp-channel-override-card {
  border:1px solid var(--border-subtle);
  border-radius:14px;
  padding:0.95rem 1.1rem;
  background:var(--surface-muted);
  transition:border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  position:relative;
  overflow:hidden;
}
/* Subtle brand-color accent bar on the left edge — matches the colour
   coding in the Configuration tab's channel containers. Each platform
   has a distinct visible identity at a glance. */
.sp-channel-override-card::before {
  content:"";
  position:absolute;
  top:0; left:0; bottom:0;
  width:3px;
  background:var(--sp-channel-accent, var(--border-strong));
  opacity:0.55;
}
.sp-channel-override-card--airbnb  { --sp-channel-accent:#ff5a5f; }
.sp-channel-override-card--booking { --sp-channel-accent:#003580; }
.sp-channel-override-card--vrbo    { --sp-channel-accent:#fdb924; }
.sp-channel-override-card--stays   { --sp-channel-accent:var(--accent); }
.sp-channel-override-card.has-overrides {
  border-color:color-mix(in srgb,var(--sp-channel-accent, var(--accent)) 45%,var(--border-strong));
  background:color-mix(in srgb,var(--sp-channel-accent, var(--accent)) 4%,var(--surface-muted));
  box-shadow:0 1px 6px color-mix(in srgb,var(--sp-channel-accent, var(--accent)) 8%,transparent);
}
.sp-channel-override-card.has-overrides::before { opacity:1; width:4px; }
.sp-channel-override-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  margin-bottom:0.85rem;
  flex-wrap:wrap;
}
.sp-channel-override-head-identity {
  display:flex;
  align-items:center;
  gap:0.7rem;
  flex:1;
  min-width:0;
}
.sp-channel-override-logo {
  flex-shrink:0;
  width:32px;
  height:32px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--bg-input);
  border:1px solid var(--border-subtle);
}
.sp-channel-override-logo-img {
  width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.sp-channel-override-logo-img img { width:22px; height:22px; object-fit:contain; }
.sp-channel-override-head-copy { display:flex; flex-direction:column; gap:0.18rem; min-width:0; }
.sp-channel-override-head-copy strong { font-size:0.95rem; font-weight:700; color:var(--text-primary); }
.sp-channel-override-head-copy small { font-size:0.74rem; }
.sp-channel-override-count-pill {
  display:inline-flex;
  align-items:center;
  padding:0.12rem 0.5rem;
  border-radius:999px;
  font-size:0.66rem;
  font-weight:700;
  letter-spacing:0.04em;
  text-transform:uppercase;
  background:color-mix(in srgb,var(--sp-channel-accent, var(--accent)) 14%,var(--surface-muted));
  border:1px solid color-mix(in srgb,var(--sp-channel-accent, var(--accent)) 30%,var(--border-subtle));
  color:color-mix(in srgb,var(--sp-channel-accent, var(--accent)) 80%,var(--text-primary));
  align-self:flex-start;
  font-style:normal !important;
}

/*
  Commission + payout-status pills on Foundations channel cards.
  Always-visible per-card chips that surface what the protection card
  would show below the fold. See PricingChannelOverridesSubsection
  ChannelOverrideCard for the source data + tooltip text.

  Light + dark mode parity (per CLAUDE.md rule #5): uses theme tokens
  only, no hard-coded colours. Pass/fail variants for payout use the
  app's success / danger tokens with mix() for muted backgrounds —
  matches the existing tone of the count-pill above so the row reads
  as one visual unit.
*/
.sp-channel-override-pills {
  display:flex;
  flex-wrap:wrap;
  gap:0.35rem;
  margin-left:auto;
  align-items:center;
}
.sp-channel-override-pill {
  display:inline-flex;
  align-items:center;
  gap:0.25rem;
  padding:0.18rem 0.55rem;
  border-radius:999px;
  font-size:0.7rem;
  font-weight:600;
  letter-spacing:0.015em;
  border:1px solid var(--border-subtle);
  background:var(--surface-muted);
  color:var(--text-soft);
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.sp-channel-override-pill--commission {
  /* Neutral — informational only, no value judgement. */
  background:color-mix(in srgb, var(--accent) 10%, var(--surface-muted));
  border-color:color-mix(in srgb, var(--accent) 25%, var(--border-subtle));
  color:color-mix(in srgb, var(--accent) 75%, var(--text-primary));
}
.sp-channel-override-pill--payout.is-ok {
  background:color-mix(in srgb, var(--state-success) 12%, var(--surface-muted));
  border-color:color-mix(in srgb, var(--state-success) 32%, var(--border-subtle));
  color:color-mix(in srgb, var(--state-success) 75%, var(--text-primary));
}
.sp-channel-override-pill--payout.is-fail {
  background:color-mix(in srgb, var(--state-error) 14%, var(--surface-muted));
  border-color:color-mix(in srgb, var(--state-error) 38%, var(--border-subtle));
  color:color-mix(in srgb, var(--state-error) 80%, var(--text-primary));
}
.sp-channel-override-link {
  background:transparent;
  border:none;
  padding:0;
  font:inherit;
  font-size:0.78rem;
  font-weight:500;
  color:var(--text-muted);
  cursor:pointer;
  text-decoration:underline;
  text-underline-offset:2px;
}
.sp-channel-override-link:hover:not(:disabled) { color:var(--text-primary); }
.sp-channel-override-link:disabled { opacity:0.5; cursor:not-allowed; }
.sp-channel-override-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(155px,1fr));
  gap:0.55rem;
}
.sp-channel-airbnb-offers {
  margin-top:0.85rem;
  padding:0.75rem 0.85rem;
  border-radius:9px;
  background:color-mix(in srgb,#ff5a5f 6%,var(--surface));
  border:1px solid color-mix(in srgb,#ff5a5f 20%,var(--border-subtle));
  display:flex;
  flex-direction:column;
  gap:0.5rem;
}
.sp-channel-airbnb-offers-head {
  font-size:0.78rem;
  font-weight:700;
  margin:0;
  color:var(--text-primary);
}
.sp-channel-airbnb-offers-lead {
  font-size:0.72rem;
  margin:0 0 0.25rem;
}
.sp-channel-override-airbnb-pair {
  grid-template-columns:1fr 1fr;
}
/* Inline validation message under the early-bird / last-minute pair when
   the host's days values would conflict (early-bird ≤ last-minute). */
.sp-channel-airbnb-validation {
  display:flex;
  align-items:flex-start;
  gap:0.5rem;
  margin-top:0.55rem;
  padding:0.5rem 0.7rem;
  border-radius:7px;
  border:1px solid color-mix(in srgb,#ef4444 40%,var(--border-subtle));
  background:color-mix(in srgb,#ef4444 7%,var(--surface));
  color:#fca5a5;
  font-size:0.74rem;
  line-height:1.45;
}
.sp-channel-airbnb-validation svg { color:var(--state-error); flex:0 0 auto; margin-top:0.1rem; }
.sp-channel-override-input {
  display:flex;
  align-items:stretch;
  border:1px solid var(--border-strong);
  border-radius:8px;
  background:var(--bg-input);
  overflow:hidden;
  transition:border-color 0.15s;
}
.sp-channel-override-input.is-overridden {
  border-color:color-mix(in srgb,var(--accent) 55%,var(--border-strong));
  background:color-mix(in srgb,var(--accent) 4%,var(--bg-input));
}
.sp-channel-override-input:focus-within {
  border-color:color-mix(in srgb,var(--ring) 60%,var(--border-strong));
  box-shadow:0 0 0 2px color-mix(in srgb,var(--ring) 14%,transparent);
}
.sp-channel-override-prefix,
.sp-channel-override-suffix {
  padding:0 0.55rem;
  font-size:0.72rem;
  font-weight:700;
  color:var(--text-muted);
  display:flex;
  align-items:center;
  flex-shrink:0;
  background:color-mix(in srgb,var(--bg-deep) 50%,var(--surface-muted));
}
.sp-channel-override-prefix { border-right:1px solid var(--border-subtle); }
.sp-channel-override-suffix { border-left:1px solid var(--border-subtle); }
.sp-channel-override-num {
  border:none !important;
  background:transparent !important;
  box-shadow:none !important;
  padding:0.42rem 0.55rem !important;
  font:inherit;
  font-size:0.84rem;
  color:var(--text-primary);
  flex:1;
  min-width:0;
  width:100%;
}
.sp-channel-override-num::placeholder {
  color:color-mix(in srgb,var(--text-muted) 70%,transparent);
  font-style:italic;
}
/* Legacy connector rule replaced by the new .sp-channel-override-fields
   wrapper. The Airbnb-offers grids inside the same card no longer pick up
   override-style borders; they sit naturally in their own coloured panel. */
.sp-channel-override-revert-inline {
  display:inline-block;
  margin-top:0.55rem;
  margin-left:0.8rem;
}

/* ── Channel override switch (replaces the old collapsible toggle) ─── */
.sp-channel-override-switch {
  display:flex;
  align-items:center;
  gap:0.7rem;
  margin:0.6rem 0 0;
  padding:0.55rem 0.75rem;
  border:1px solid var(--border-subtle);
  border-radius:8px;
  background:var(--surface-muted);
  cursor:pointer;
  transition:background-color 0.15s, border-color 0.15s;
}
.sp-channel-override-switch:hover {
  background:color-mix(in srgb,var(--accent) 4%,var(--surface-muted));
  border-color:color-mix(in srgb,var(--accent) 35%,var(--border-subtle));
}
.sp-channel-override-switch.is-on {
  background:color-mix(in srgb,var(--accent) 6%,var(--surface-muted));
  border-color:color-mix(in srgb,var(--accent) 45%,var(--border-subtle));
}
.sp-channel-override-switch-input {
  position:absolute;
  opacity:0;
  pointer-events:none;
  width:0;
  height:0;
}
.sp-channel-override-switch-track {
  position:relative;
  width:34px;
  height:20px;
  border-radius:999px;
  background:color-mix(in srgb,var(--border-strong) 60%,transparent);
  flex:0 0 auto;
  transition:background-color 0.15s;
}
.sp-channel-override-switch.is-on .sp-channel-override-switch-track {
  background:var(--accent);
}
.sp-channel-override-switch-thumb {
  position:absolute;
  top:2px;
  left:2px;
  width:16px;
  height:16px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,0.22);
  transition:transform 0.16s ease;
}
.sp-channel-override-switch.is-on .sp-channel-override-switch-thumb {
  transform:translateX(14px);
}
.sp-channel-override-switch-input:focus-visible + .sp-channel-override-switch-track {
  outline:2px solid var(--ring);
  outline-offset:2px;
}
.sp-channel-override-switch-copy {
  display:flex;
  flex-direction:column;
  gap:0.05rem;
}
.sp-channel-override-switch-title {
  font-size:0.82rem;
  font-weight:600;
  color:var(--text-primary);
}
.sp-channel-override-switch-sub {
  font-size:0.7rem;
  color:var(--text-muted);
}
.sp-channel-override-fields {
  margin-top:0.55rem;
  padding:0.7rem 0.8rem 0.85rem;
  border:1px solid color-mix(in srgb,var(--accent) 28%,var(--border-subtle));
  border-radius:8px;
  background:color-mix(in srgb,var(--accent) 2%,var(--bg-input));
}
.sp-channel-override-input.is-disabled,
.sp-channel-override-input.is-disabled input {
  background:color-mix(in srgb,var(--border-subtle) 30%,var(--surface));
  color:var(--text-muted);
  cursor:not-allowed;
}
/* ── Non-refundable row geometry ───────────────────────────────────────
   The row sits as a 2-col grid (matching the early-bird / last-minute pair
   grids below). Column 1 = disabled input; column 2 = compact tri-state
   affordance, bottom-aligned with the input. When the user opens the
   confirm dialog, it expands below at full width. */
.sp-channel-airbnb-nrr-row { align-items:end; }
.sp-channel-airbnb-nrr-side {
  display:flex;
  align-items:flex-end;
  min-height:34px;       /* match the input height so the cell isn't shorter */
}
.sp-channel-nrr-enable {
  font-size:0.74rem;
  color:var(--text-muted);
  padding:0.3rem 0.1rem;
}
.sp-channel-nrr-enable:hover {
  color:var(--accent);
}
.sp-channel-nrr-confirm {
  margin-top:0.55rem;
  padding:0.55rem 0.7rem;
  border-radius:7px;
  border:1px solid var(--border-subtle);
  background:var(--surface-muted);
  display:flex;
  flex-direction:column;
  gap:0.4rem;
}
.sp-channel-nrr-confirm-body {
  font-size:0.74rem;
  margin:0;
  line-height:1.45;
}
.sp-channel-nrr-confirm-actions {
  display:flex;
  gap:0.85rem;
  align-items:center;
}
.sp-channel-nrr-confirm-yes {
  color:var(--accent);
  font-weight:600;
}
.sp-channel-nrr-line {
  display:flex;
  align-items:center;
  gap:0.4rem;
  padding:0.35rem 0.5rem;
  border-radius:6px;
  background:color-mix(in srgb,#10b981 6%,var(--surface-muted));
  font-size:0.74rem;
  color:var(--text-primary);
  width:100%;
}
.sp-channel-nrr-line-text {
  flex:1 1 auto;
  min-width:0;
  /* Tight phrasing; the from→to can overflow on tiny widths, so let it
     ellipsize rather than blow up the row geometry. */
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sp-channel-nrr-line--done .sp-channel-nrr-icon {
  color:var(--state-success);
  flex:0 0 auto;
}
.sp-channel-nrr-undo {
  font-size:0.72rem;
  flex:0 0 auto;
}

/* ── Pet-fee enable prompt — same 3-state idiom as the non-refundable
   affordance: default link, confirming panel, ✓ staged line with Undo.
   Lives below the fees / override grid to keep row geometry clean. ───── */
.sp-pets-prompt {
  margin:0.6rem 0 0;
  font-size:0.74rem;
}
.sp-pets-prompt-cta {
  font-weight:600;
  color:var(--text-muted);
  margin-left:0.2rem;
}
.sp-pets-prompt-cta:hover { color:var(--accent); }
.sp-pets-confirm {
  margin-top:0.55rem;
  padding:0.55rem 0.7rem;
  border-radius:7px;
  border:1px solid var(--border-subtle);
  background:var(--surface-muted);
  display:flex;
  flex-direction:column;
  gap:0.4rem;
}
.sp-pets-confirm-body {
  font-size:0.74rem;
  margin:0;
  line-height:1.45;
}
.sp-pets-confirm-actions {
  display:flex;
  gap:0.85rem;
  align-items:center;
}
.sp-pets-confirm-yes {
  color:var(--accent);
  font-weight:600;
}
.sp-pets-line {
  display:flex;
  align-items:center;
  gap:0.4rem;
  margin-top:0.55rem;
  padding:0.35rem 0.55rem;
  border-radius:6px;
  background:color-mix(in srgb,#10b981 6%,var(--surface-muted));
  font-size:0.74rem;
  color:var(--text-primary);
}
.sp-pets-line--done .sp-pets-line-icon { color:var(--state-success); flex:0 0 auto; }
.sp-pets-line-text { flex:1 1 auto; min-width:0; }
.sp-pets-line-undo { font-size:0.72rem; flex:0 0 auto; }

/* Markup row sits at the top of each override card — always editable, saves
   with the main save bar (unlike fee/discount overrides which save inline). */
.sp-channel-override-markup { margin-bottom:0.6rem; max-width:11rem; }
.sp-channel-override-input--markup {
  border-color:color-mix(in srgb,var(--accent) 35%,var(--border-strong));
  background:color-mix(in srgb,var(--accent) 4%,var(--bg-input));
}
.sp-channel-override-input--markup .sp-channel-override-num { font-weight:600; }
.sp-channel-override-input--markup .sp-channel-override-suffix {
  font-weight:700;
  color:color-mix(in srgb,var(--accent) 70%,var(--text-muted));
}

/* Persistent sync summary in the debug API preview — surfaces last save's
   per-child outcomes so failures don't disappear after the success toast. */
.properties-api-preview-sync-summary {
  margin:0 0 1rem;
  padding:0.75rem 0.9rem;
  border-radius:10px;
  border:1px solid var(--border-subtle);
  background:var(--surface-muted);
}
.properties-api-preview-sync-summary.is-ok {
  border-color:color-mix(in srgb,#16a34a 25%,var(--border-subtle));
  background:color-mix(in srgb,#16a34a 5%,var(--surface-muted));
}
.properties-api-preview-sync-summary.is-failed {
  border-color:color-mix(in srgb,#dc2626 28%,var(--border-subtle));
  background:color-mix(in srgb,#dc2626 6%,var(--surface-muted));
}
.properties-api-preview-sync-head {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:0.85rem;
  font-size:0.82rem;
  color:var(--text-primary);
}
.properties-api-preview-sync-head .muted { font-size:0.72rem; }
.properties-api-preview-sync-failures {
  list-style:none;
  margin:0.6rem 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:0.45rem;
}
.properties-api-preview-sync-failures li {
  font-size:0.76rem;
  display:flex;
  flex-direction:column;
  gap:0.18rem;
}
.properties-api-preview-sync-failures strong { color:#dc2626; font-weight:700; }
.properties-api-preview-sync-failures code {
  font-size:0.72rem;
  color:var(--text-primary);
  background:color-mix(in srgb,#dc2626 4%,var(--bg-input));
  padding:0.25rem 0.5rem;
  border-radius:6px;
  border:1px solid color-mix(in srgb,#dc2626 12%,var(--border-subtle));
  font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
}
.properties-api-preview-sync-ok-line {
  margin:0.45rem 0 0;
  font-size:0.74rem;
  font-family:ui-monospace, SFMono-Regular, Menlo, monospace;
  color:var(--text-muted);
}

/* Inline validation under length-of-stay discount input when monthly < weekly.
   Channels reject anything below — surface it visibly without blocking. */
.sp-discount-warn {
  margin:0.35rem 0 0;
  font-size:0.72rem;
  line-height:1.4;
  color:var(--state-error);
  font-weight:500;
}

/* Per-child sync state dot on the channel card header. Appears only when
   the last parent→children fan-out failed for that row. Hover for the error
   detail captured in last_sync_error. */
.properties-child-sync-state-dot {
  display:inline-block;
  width:0.55rem;
  height:0.55rem;
  border-radius:50%;
  margin-right:0.45rem;
  flex-shrink:0;
}
.properties-child-sync-state-dot.is-failed {
  background:#dc2626;
  box-shadow:0 0 0 3px color-mix(in srgb,#dc2626 18%,transparent);
  animation:properties-sync-pulse 2.4s ease-in-out infinite;
}
@keyframes properties-sync-pulse {
  0%, 100% { box-shadow:0 0 0 3px color-mix(in srgb,#dc2626 18%,transparent); }
  50%      { box-shadow:0 0 0 5px color-mix(in srgb,#dc2626 8%,transparent); }
}

.sp-base-wrap { grid-column:1/-1; }

/* ── Shared field ── */
.sp-f { display:flex; flex-direction:column; gap:0.28rem; }
.sp-label { font-size:0.69rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; display:flex; align-items:center; gap:0.35rem; min-height:1.35em; }
/* sp3 input: hairline-bordered field on the input surface. Tabular nums so
   numeric entries (most sp-inputs are amounts/percentages) hold a fixed
   advance width. Hover firms the border; focus-visible gets the accent ring
   + accent border. Radius/transition via sp3 tokens. */
.sp-input { border:1px solid var(--border-strong); border-radius:var(--sp3-radius-sm); background:var(--bg-input); color:var(--text-primary); padding:0.5rem 0.7rem; font:inherit; font-size:0.84rem; width:100%; font-variant-numeric:tabular-nums; transition:border-color var(--sp3-dur-1) var(--sp3-ease), box-shadow var(--sp3-dur-1) var(--sp3-ease); }
.sp-input:hover:not(:focus) { border-color:color-mix(in srgb,var(--text-primary) 28%,var(--border-strong)); }
.sp-input:focus { outline:none; border-color:var(--accent); box-shadow:var(--sp3-ring); }
.sp-input--narrow { max-width:80px; }
/* Custom-chevron <select> wrapper (the Sel atom). We suppress the OS arrow
   (which crowds long option text — the "clipping" bug) and draw our own
   chevron in a theme token so it reads the same in light + dark. */
.sp-sel { position:relative; display:block; width:100%; }
.sp-sel-select { appearance:none; -webkit-appearance:none; -moz-appearance:none; padding-right:1.9rem; cursor:pointer; }
.sp-sel-select::-ms-expand { display:none; }
.sp-sel::after {
  content:""; position:absolute; right:0.72rem; top:50%; width:0.46rem; height:0.46rem;
  border-right:1.6px solid var(--text-muted); border-bottom:1.6px solid var(--text-muted);
  transform:translateY(-70%) rotate(45deg); pointer-events:none;
}
/* This wrapper drew its own chevron because a native select's arrow varies per
   browser and crowded long option text. A SelectMenu trigger draws one inline,
   so the wrapper's would be a SECOND arrow — drop it, and give back the 1.9rem
   that was reserved for it. */
.sp-sel:has(.selectmenu-trigger)::after { content:none; }
.selectmenu-trigger.sp-sel-select { padding-right:0.6rem; }

/* ── Rate inputs ── */
.sp-rate-input-wrap,.sp-base-input-row { display:flex; align-items:stretch; border:1px solid var(--border-strong); border-radius:var(--sp3-radius-sm); background:var(--bg-input); overflow:hidden; transition:border-color var(--sp3-dur-1) var(--sp3-ease), box-shadow var(--sp3-dur-1) var(--sp3-ease); }
.sp-rate-input-wrap:focus-within,.sp-base-input-row:focus-within { border-color:var(--accent); box-shadow:var(--sp3-ring); }
.sp-currency-sel { border:none !important; background:transparent !important; padding:0.42rem 0.3rem 0.42rem 0.6rem !important; font-size:0.78rem !important; font-weight:700 !important; color:var(--text-muted) !important; width:auto !important; flex-shrink:0; cursor:pointer; border-radius:0 !important; box-shadow:none !important; border-right:1px solid var(--border-subtle) !important; }
.sp-rate-num,.sp-base-num { border:none !important; background:transparent !important; outline:none !important; box-shadow:none !important; border-radius:0 !important; width:100%; }
.sp-rate-num { padding:0.42rem 0.6rem 0.42rem 0.4rem !important; font-size:1rem !important; font-weight:700 !important; color:var(--text-primary) !important; }
/* Base price = the confident hero figure of "Your price". sp3 "precision
   instrument" treatment: larger, heavier, tabular numerals so digits hold a
   fixed advance width (no jitter as a suggested value drops in), tight
   negative tracking like a meter readout. Still a live <input> — only the
   type is dressed up, the onChange is untouched. */
.sp-base-num { padding:0.5rem 0.6rem 0.5rem 0.45rem !important; font-size:1.85rem !important; font-weight:800 !important; color:var(--text-primary) !important; font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1; letter-spacing:-0.02em; line-height:1.1; }
/* The base row's currency prefix reads as the unit on that hero figure —
   nudge it to align to the larger numeral's baseline weight without competing. */
.sp-base-input-row .sp-currency-sel { font-size:0.8rem !important; font-weight:700 !important; align-self:center; }

/* ── Suffix / pct wrappers ── */
.sp-sfx-wrap { display:flex; align-items:center; gap:0.35rem; }
.sp-sfx { font-size:0.74rem; color:var(--text-muted); white-space:nowrap; flex-shrink:0; }

/* ── Tooltip ──────────────────────────────────────────────────────────
   The icon is still inline; the popover that appears on hover is now
   rendered by React with `position:fixed`, so it escapes any
   `overflow:hidden` ancestor (the hero, the market & sync card, etc.).
   The old `::after` pseudo-popover lived inside the same DOM tree as
   the icon and was clipped any time the icon was near a card edge —
   recurring bug. Don't reintroduce the pseudo. */
.sp-tip { display:inline-flex; align-items:center; justify-content:center; width:15px; height:15px; border-radius:50%; font-size:0.62rem; font-weight:800; background:color-mix(in srgb,var(--ring) 16%,var(--surface-muted)); color:color-mix(in srgb,var(--ring) 80%,var(--text-muted)); border:1px solid color-mix(in srgb,var(--ring) 22%,var(--border-subtle)); cursor:help; flex-shrink:0; line-height:1; outline:none; }
.sp-tip:focus-visible { box-shadow:0 0 0 2px var(--ring); }
.sp-tip-pop {
  position:fixed;
  z-index:9999;
  background:var(--bg-elevated);
  color:var(--text-primary);
  font-size:0.76rem;
  font-weight:400;
  line-height:1.5;
  text-transform:none;
  letter-spacing:0;
  white-space:normal;
  width:220px;
  max-width:calc(100vw - 16px);
  text-align:left;
  padding:0.55rem 0.7rem;
  border-radius:10px;
  border:1px solid var(--border-subtle);
  /* Theme-token shadow so the popover doesn't look washed-out in light
     mode (`rgba(0,0,0,0.3)` reads as a heavy ink-drop in light, near
     invisible in dark). The `--shadow-soft` token has per-theme tuned
     values. */
  box-shadow:var(--shadow-soft);
  pointer-events:none;
}
.sp-tip-pop--up {
  /* Anchor is the icon's top edge; translate UP by full height + gap. */
  transform:translateY(calc(-100% - 12px));
}

/* ── Direction toggle ── */
.sp-dir-row { display:flex; flex-direction:column; gap:0.3rem; }
.sp-dir-toggle { display:flex; }
/* sp3: connected Discount/Premium pair. Inactive sides read as a calm
   neutral slot; the active side firms with an accent tint + accent hairline
   + primary ink, lifting it out of the pair. Transition via sp3 tokens. */
.sp-dir-btn { flex:1; padding:0.4rem 0.4rem; font-size:0.71rem; font-weight:700; border:1px solid var(--border-strong); background:var(--bg-input); color:var(--text-muted); cursor:pointer; transition:background-color var(--sp3-dur-1) var(--sp3-ease), border-color var(--sp3-dur-1) var(--sp3-ease), color var(--sp3-dur-1) var(--sp3-ease); }
.sp-dir-btn:first-child { border-radius:var(--sp3-radius-sm) 0 0 var(--sp3-radius-sm); border-right-width:0.5px; }
.sp-dir-btn:last-child  { border-radius:0 var(--sp3-radius-sm) var(--sp3-radius-sm) 0; border-left-width:0.5px; }
.sp-dir-btn:hover:not(.is-on) { color:var(--text-primary); }
.sp-dir-btn.is-on { background:color-mix(in srgb,var(--accent) 14%,var(--bg-input)); border-color:color-mix(in srgb,var(--accent) 55%,var(--border-strong)); color:var(--text-primary); }
.sp-dir-btn:focus-visible { outline:none; box-shadow:var(--sp3-ring); position:relative; z-index:1; }
.sp-dir-amount { display:flex; align-items:center; border:1px solid var(--border-strong); border-radius:var(--sp3-radius-sm); background:var(--bg-input); overflow:hidden; }
.sp-dir-amount .sp-input { border:none !important; background:transparent !important; box-shadow:none !important; }
.sp-dir-unit { padding:0 0.5rem; font-size:0.8rem; font-weight:700; color:var(--text-muted); white-space:nowrap; border-left:1px solid var(--border-subtle); flex-shrink:0; }

/* ── Adjustment sections ──
   W2: each AdjSection is a progressive-disclosure "instrument" card living
   INSIDE a FactorGroup inside an elevated .sp2-section. No nested heavy card
   shadow (cards-in-cards) — premium here = rhythm, the header, the tactile
   controls, and the Advanced disclosure. The on-state cue is a QUIET accent
   left-edge + faint bg tint (color-mix on --accent), token-only so it tracks
   light/dark automatically. */
.sp-adj {
  position:relative;
  /* relative + left-edge accent (drawn via box-shadow inset on --on) needs the
     factor to sit slightly inset so the cue doesn't collide with content. */
  transition:background-color var(--sp3-dur-2) var(--sp3-ease),
    border-color var(--sp3-dur-2) var(--sp3-ease),
    box-shadow var(--sp3-dur-2) var(--sp3-ease);
}
.sp-adj--on {
  border-color:color-mix(in srgb,var(--accent) 26%,var(--border-subtle));
  /* faint accent wash + a 2px accent left rail (inset box-shadow, so it hugs
     the rounded corner and never overflows the card). Both quiet by design. */
  background:color-mix(in srgb,var(--accent) 4%,var(--surface-muted));
  box-shadow:
    inset 2px 0 0 color-mix(in srgb,var(--accent) 55%,transparent),
    inset 0 1px 0 color-mix(in srgb,var(--text-muted) 8%,transparent),
    0 1px 0 rgb(var(--sp3-shadow-color) / 0.18);
}
.sp-adj-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
.sp-adj-meta { flex:1; min-width:0; }
.sp-adj-meta .properties-section-h3 { margin-bottom:0.12rem; }
/* W2: confident-but-calm title — weight ~650, slightly tighter than the base
   700 so the live-impact chip beside it reads as the loud element. */
.sp-adj-title-row .properties-section-h3 { font-weight:650; }
.sp-adj-desc { font-size:0.81rem; color:var(--text-muted); margin:0; line-height:1.45; }
.sp-adj-body { margin-top:0.85rem; padding-top:0.85rem; border-top:1px solid var(--border-subtle); display:flex; flex-direction:column; gap:0.75rem; }

/* Header must wrap gracefully on narrow widths — title row + desc drop above
   the TogglePill rather than crushing it. */
@media (max-width:480px) {
  .sp-adj-head { flex-direction:column; align-items:stretch; gap:0.6rem; }
  .sp-adj-head .sp-tpill { align-self:flex-start; }
}

/* ── Advanced disclosure (W2) ──
   Unobtrusive toggle + a grid-rows 0fr↔1fr reveal so the deep knobs slide in
   smoothly with NO JS height measuring. The revealed panel is fenced off from
   the headline by a hairline top border and reuses the existing .sp-adj-grid
   layout the deep controls already use. */
.sp-adj-adv { margin-top:0.1rem; }
/* Real button affordance (host 2026-06-11: expanders were invisible) — same family as
   .sp2-disclosure so every expander on the tab reads as clickable. */
.sp-adj-adv-toggle {
  display:inline-flex; align-items:center; gap:0.4rem;
  padding:0.32rem 0.7rem;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border:1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  cursor:pointer;
  font:inherit; font-size:0.74rem; font-weight:600; letter-spacing:0.04em;
  color:var(--accent);
  border-radius:var(--sp3-radius-sm);
  transition:background var(--sp3-dur-1) var(--sp3-ease), border-color var(--sp3-dur-1) var(--sp3-ease);
}
.sp-adj-adv-toggle:hover {
  color:var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
}
.sp-adj-adv-toggle:focus-visible { outline:none; box-shadow:var(--sp3-ring); }
.sp-adj-adv-chev {
  font-size:0.82rem; line-height:1; color:currentColor;
  transition:transform var(--sp3-dur-2) var(--sp3-ease);
}
.sp-adj-adv-toggle.is-open .sp-adj-adv-chev { transform:rotate(180deg); }
/* The reveal: animate the grid row track from 0fr (collapsed) to 1fr (full
   content height) plus opacity. The inner wrapper clips overflow + holds
   min-height:0 so the 0fr track can fully collapse. */
.sp-adj-adv-reveal {
  display:grid;
  grid-template-rows:0fr;
  opacity:0;
  transition:grid-template-rows var(--sp3-dur-2) var(--sp3-ease),
    opacity var(--sp3-dur-2) var(--sp3-ease);
}
.sp-adj-adv-reveal.is-open { grid-template-rows:1fr; opacity:1; }
.sp-adj-adv-reveal-inner { min-height:0; overflow:hidden; }
.sp-adj-adv-panel {
  margin-top:0.7rem; padding-top:0.7rem;
  border-top:1px solid var(--border-subtle);
  display:flex; flex-direction:column; gap:0.75rem;
}
@media (prefers-reduced-motion: reduce) {
  .sp-adj { transition:none; }
  .sp-adj-adv-reveal { transition:none; }
  .sp-adj-adv-chev { transition:none; }
}
.sp-adj-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:0.6rem; align-items:end; }
.sp-adj-grid--gap { margin-top:0.35rem; }
/* Asymmetric Booking Pace toggle row: a labelled switch that swaps the single
   Strength field for independent Busy premium / Quiet discount inputs. Tokens
   only (light/dark safe). Label + pill sit on one line and wrap the pill below
   the label on narrow widths so it never crushes. */
.sp-asym-row { display:flex; align-items:center; justify-content:space-between; gap:0.6rem; flex-wrap:wrap; }
.sp-asym-label { font-size:0.74rem; font-weight:600; color:var(--text-primary); letter-spacing:0.01em; }
/* 7-column grid for day-of-week min-stay (Mon..Sun). On narrow widths the
   browser wraps naturally; on wide widths we get one clean row. */
.sp-adj-grid--dow { grid-template-columns:repeat(7,minmax(64px,1fr)); gap:0.4rem; }
@media (max-width:640px) { .sp-adj-grid--dow { grid-template-columns:repeat(4,minmax(0,1fr)); }}
/* Inline toggle pill (smaller than the engine toggle). Used in the
   day-of-week section header to flip ms_dow_mode. */
.sp-adj-toggle {
  display:inline-flex;
  align-items:center;
  gap:0.4rem;
  font-size:0.74rem;
  color:var(--text-muted);
  cursor:pointer;
  user-select:none;
}
.sp-adj-toggle input { position:absolute; opacity:0; pointer-events:none; }
.sp-toggle-pill-mini {
  position:relative;
  width:30px;
  height:18px;
  border-radius:999px;
  /* OFF track grey — a theme-adaptive mid-grey (color-mix on --text-primary) so
     the white knob reads in both themes (the old border-strong tint was too faint
     in light mode). */
  background:color-mix(in srgb,var(--text-primary) 20%,var(--bg-input));
  transition:background-color var(--sp3-dur-2) var(--sp3-ease);
}
.sp-toggle-pill-mini-knob {
  position:absolute;
  top:2px;
  left:2px;
  width:14px;
  height:14px;
  border-radius:50%;
  /* sp3: white thumb token (bright in both themes) + token shadow,
     replacing the hardcoded #fff / rgba(0,0,0,.22). */
  background:var(--sp3-knob);
  box-shadow:var(--sp3-shadow-sm);
  transition:transform var(--sp3-dur-2) var(--sp3-ease);
}
.sp-adj-toggle input:checked + .sp-toggle-pill-mini { background:var(--accent); }
.sp-adj-toggle input:checked + .sp-toggle-pill-mini .sp-toggle-pill-mini-knob { transform:translateX(12px); }
.sp-adj-sub { padding:0.65rem 0.75rem; border-radius:8px; background:color-mix(in srgb,var(--bg-deep) 55%,var(--bg-input)); border:1px solid var(--border-subtle); }
.sp-tpill { white-space:nowrap; flex-shrink:0; }
/* sp3 keyboard ring — the shared .properties-toggle-pill base has no
   focus-visible style; scope the ring to the pricing-tab variant (factor
   on/off pills + the asymmetric toggle all carry .sp-tpill) so keyboard
   users get the same affordance as the strategy cards / disclosures. */
.sp-tpill:focus-visible { outline:none; box-shadow:var(--sp3-ring); }

/* Factor "active right now" pill — sits next to each factor's title */
.sp-adj-title-row { display:flex; align-items:center; gap:0.55rem; flex-wrap:wrap; margin-bottom:0.12rem; }
.sp-adj-title-row .properties-section-h3 { margin-bottom:0; }
.sp-factor-pill {
  display:inline-flex; align-items:center; gap:0.32rem;
  /* W2: nudged up a touch + tnum feature so the figure reads as a confident
     live-impact instrument chip beside the title (matches .sp3-num recipe). */
  font-size:0.68rem; font-weight:700; letter-spacing:0.01em;
  padding:2px 8px; border-radius:999px; line-height:1.3;
  font-variant-numeric:tabular-nums; font-feature-settings:"tnum" 1;
  border:1px solid var(--border-subtle);
  background:color-mix(in srgb,var(--bg-deep) 40%,var(--surface-muted));
  color:var(--text-muted);
  user-select:none;
}
.sp-factor-pill-dot { width:5px; height:5px; border-radius:50%; background:currentColor; opacity:0.85; }
.sp-factor-pill-sep { opacity:0.45; margin:0 1px; }
.sp-factor-pill--up {
  color:color-mix(in srgb,var(--state-success) 85%,var(--text-primary));
  background:color-mix(in srgb,var(--state-success) 12%,var(--surface-muted));
  border-color:color-mix(in srgb,var(--state-success) 32%,var(--border-subtle));
}
.sp-factor-pill--down {
  color:color-mix(in srgb,var(--state-warning) 90%,var(--text-primary));
  background:color-mix(in srgb,var(--state-warning) 12%,var(--surface-muted));
  border-color:color-mix(in srgb,var(--state-warning) 32%,var(--border-subtle));
}
.sp-factor-pill--idle {
  color:var(--text-soft);
  background:color-mix(in srgb,var(--text-muted) 6%,var(--surface-muted));
  border-color:var(--border-subtle);
}
.sp-factor-pill--idle .sp-factor-pill-dot { opacity:0.55; }
.sp-factor-pill-reason { font-weight:600; opacity:0.85; }

/* Pricing Health card — appears in the hero, single 0-100 score + checklist */
.sp-health {
  margin-top:0.9rem;
  border-radius:10px;
  border:1px solid var(--border-subtle);
  background:color-mix(in srgb,var(--bg-deep) 35%,var(--surface-muted));
  overflow:hidden;
  transition:border-color 0.15s, box-shadow 0.15s;
}
.sp-health--good { border-color:color-mix(in srgb,#22c55e 35%,var(--border-subtle)); }
.sp-health--ok   { border-color:color-mix(in srgb,#22c55e 22%,var(--border-subtle)); }
.sp-health--warn { border-color:color-mix(in srgb,#f59e0b 35%,var(--border-subtle)); }
.sp-health--bad  { border-color:color-mix(in srgb,#ef4444 38%,var(--border-subtle)); }

.sp-health-head {
  display:flex; align-items:center; gap:0.85rem;
  width:100%; padding:0.7rem 0.95rem;
  background:transparent; border:none; cursor:pointer;
  text-align:left; color:var(--text-primary);
  transition:background 0.12s;
}
.sp-health-head:hover { background:color-mix(in srgb,var(--ring) 5%,transparent); }
.sp-health-head:focus-visible { outline:2px solid var(--ring); outline-offset:-2px; }

.sp-health-score {
  display:flex; align-items:baseline; gap:0.18rem;
  flex-shrink:0;
  padding:0.3rem 0.7rem;
  border-radius:8px;
  background:color-mix(in srgb,var(--bg-deep) 60%,var(--surface-muted));
  border:1px solid var(--border-subtle);
  font-variant-numeric:tabular-nums;
}
.sp-health--good .sp-health-score { background:color-mix(in srgb,#22c55e 14%,var(--surface-muted)); border-color:color-mix(in srgb,#22c55e 38%,var(--border-subtle)); }
.sp-health--ok   .sp-health-score { background:color-mix(in srgb,#22c55e 8%,var(--surface-muted)); border-color:color-mix(in srgb,#22c55e 24%,var(--border-subtle)); }
.sp-health--warn .sp-health-score { background:color-mix(in srgb,#f59e0b 12%,var(--surface-muted)); border-color:color-mix(in srgb,#f59e0b 35%,var(--border-subtle)); }
.sp-health--bad  .sp-health-score { background:color-mix(in srgb,#ef4444 12%,var(--surface-muted)); border-color:color-mix(in srgb,#ef4444 38%,var(--border-subtle)); }

.sp-health-num { font-size:1.3rem; font-weight:800; letter-spacing:-0.02em; color:var(--text-primary); line-height:1; }
.sp-health--good .sp-health-num { color:color-mix(in srgb,#22c55e 85%,var(--text-primary)); }
.sp-health--warn .sp-health-num { color:color-mix(in srgb,#f59e0b 90%,var(--text-primary)); }
.sp-health--bad  .sp-health-num { color:color-mix(in srgb,#ef4444 90%,var(--text-primary)); }
.sp-health-of { font-size:0.7rem; font-weight:700; color:var(--text-muted); }

.sp-health-meta { display:flex; flex-direction:column; gap:0.08rem; flex:1; min-width:0; }
.sp-health-lbl { font-size:0.7rem; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--text-muted); display:inline-flex; align-items:center; gap:0.4rem; }
.sp-health-lbl .sp-tip { width:13px; height:13px; font-size:0.55rem; text-transform:none; letter-spacing:0; }
.sp-health-sub { font-size:0.82rem; font-weight:600; color:var(--text-primary); }

.sp-health-chev { font-size:0.85rem; color:var(--text-muted); transition:transform 0.15s; flex-shrink:0; }
.sp-health-chev.is-on { transform:rotate(180deg); }

.sp-health-list {
  list-style:none; margin:0; padding:0 0.7rem 0.75rem;
  display:flex; flex-direction:column; gap:0.32rem;
  border-top:1px solid var(--border-subtle);
  padding-top:0.7rem;
}
.sp-health-item {
  display:grid;
  grid-template-columns:18px 1fr auto;
  gap:0.6rem;
  align-items:baseline;
  padding:0.32rem 0.5rem;
  border-radius:6px;
  font-size:0.78rem;
}
.sp-health-item--ok   { color:var(--text-primary); }
.sp-health-item--warn { color:var(--text-primary); background:color-mix(in srgb,#f59e0b 7%,transparent); }
.sp-health-item--fail { color:var(--text-primary); background:color-mix(in srgb,#ef4444 7%,transparent); }
.sp-health-glyph {
  width:18px; height:18px; border-radius:50%; line-height:18px; text-align:center;
  font-size:0.7rem; font-weight:800;
  color:#fff;
}
.sp-health-item--ok   .sp-health-glyph { background:color-mix(in srgb,#22c55e 80%,var(--bg-deep)); }
.sp-health-item--warn .sp-health-glyph { background:color-mix(in srgb,#f59e0b 85%,var(--bg-deep)); }
.sp-health-item--fail .sp-health-glyph { background:color-mix(in srgb,#ef4444 85%,var(--bg-deep)); }
.sp-health-item-lbl { font-weight:700; }
.sp-health-item-detail { font-size:0.74rem; color:var(--text-muted); text-align:right; }

/* Data coverage strip — sits next to / after the health card */
.sp-coverage {
  margin-top:0.55rem;
  padding:0.65rem 0.85rem;
  border-radius:10px;
  border:1px solid var(--border-subtle);
  background:color-mix(in srgb,var(--bg-deep) 30%,var(--surface-muted));
}
.sp-coverage-head { margin-bottom:0.45rem; }
.sp-coverage-lbl { font-size:0.62rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--text-muted); display:inline-flex; align-items:center; gap:0.35rem; }
.sp-coverage-lbl .sp-tip { width:12px; height:12px; font-size:0.5rem; text-transform:none; letter-spacing:0; }
.sp-coverage-items { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:0.55rem; }
.sp-coverage-item {
  display:flex; align-items:center; gap:0.55rem;
  padding:0.4rem 0.55rem;
  border-radius:7px;
  border:1px solid var(--border-subtle);
  background:var(--surface-muted);
  cursor:default;
}
.sp-coverage-item--ok   { border-color:color-mix(in srgb,#22c55e 28%,var(--border-subtle)); background:color-mix(in srgb,#22c55e 5%,var(--surface-muted)); }
.sp-coverage-item--warn { border-color:color-mix(in srgb,#f59e0b 32%,var(--border-subtle)); background:color-mix(in srgb,#f59e0b 6%,var(--surface-muted)); }
.sp-coverage-item--fail { border-color:color-mix(in srgb,#ef4444 35%,var(--border-subtle)); background:color-mix(in srgb,#ef4444 6%,var(--surface-muted)); }
.sp-coverage-dot {
  width:9px; height:9px; border-radius:50%; flex-shrink:0;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--surface) 90%,transparent);
}
.sp-coverage-item--ok   .sp-coverage-dot { background:var(--state-success); }
.sp-coverage-item--warn .sp-coverage-dot { background:var(--state-warning); }
.sp-coverage-item--fail .sp-coverage-dot { background:var(--state-error); }
.sp-coverage-text { display:flex; flex-direction:column; gap:0.06rem; min-width:0; flex:1; }
.sp-coverage-item-lbl { font-size:0.66rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--text-muted); line-height:1.1; }
.sp-coverage-item-val { font-size:0.85rem; font-weight:800; color:var(--text-primary); font-variant-numeric:tabular-nums; line-height:1.15; letter-spacing:-0.01em; }

/* ── Day of week ── */
.sp-dow-grid { display:flex; flex-direction:column; gap:0.5rem; margin-top:0.75rem; }
.sp-dow-cell { display:grid; grid-template-columns:minmax(150px,1fr) minmax(110px,0.7fr) minmax(130px,0.8fr); align-items:center; gap:0.75rem; padding:0.65rem 0.75rem; border-radius:9px; border:1px solid var(--border-subtle); background:var(--surface-muted); }
.sp-dow-cell--wknd { border-color:color-mix(in srgb,var(--ring) 38%,var(--border-subtle)); background:color-mix(in srgb,var(--ring) 7%,var(--surface-muted)); }
.sp-dow-top { display:flex; align-items:center; justify-content:space-between; gap:0.75rem; min-width:0; }
.sp-dow-name { font-size:0.875rem; font-weight:700; color:var(--text-primary); }
.sp-dow-kind { display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:0.4rem 0.65rem; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-input); color:var(--text-muted); font:inherit; font-size:0.8rem; font-weight:650; cursor:pointer; }
.sp-dow-kind.is-on { border-color:color-mix(in srgb,var(--ring) 50%,var(--border-subtle)); color:var(--text-primary); background:color-mix(in srgb,var(--ring) 10%,var(--bg-input)); }
.sp-dow-value { display:flex; align-items:center; min-width:0; }
.sp-dow-input { width:100%; min-width:0; text-align:right; border:1px solid var(--border-strong); border-radius:7px 0 0 7px; background:var(--bg-input); color:var(--text-primary); padding:0.55rem 0.65rem; font:inherit; font-size:0.875rem; font-weight:700; }
.sp-dow-unit { align-self:stretch; display:inline-flex; align-items:center; padding:0 0.65rem; border:1px solid var(--border-strong); border-left:0; border-radius:0 7px 7px 0; background:var(--surface-muted); font-size:0.875rem; color:var(--text-muted); }
.sp-dow-effect { font-size:0.875rem; color:var(--text-secondary); font-weight:650; }
@media (max-width: 620px) {
  .sp-dow-cell { grid-template-columns:1fr; }
  .sp-dow-effect { text-align:left; }
}

/* ── Date overrides ── */
.sp-ov-wrap { display:flex; flex-direction:column; gap:0.65rem; margin-top:0.85rem; }
/* overflow-x:auto (NOT hidden): the fixed grid columns total ~500px+, and the
   main pane in the 5-pane layout can be narrower — overflow:hidden silently
   AMPUTATED the Mode/Amount/Label columns (and the workspace-scope chip) with
   no scrollbar. Narrow pane now pans sideways; min-width keeps the columns at
   their designed widths. Small screens are first-class. */
.sp-ov-table { display:flex; flex-direction:column; border:1px solid var(--border-subtle); border-radius:10px; overflow-x:auto; overflow-y:hidden; }
.sp-ov-head { display:grid; grid-template-columns:130px 130px 90px 80px 1fr 30px; gap:0.4rem; padding:0.42rem 0.6rem; min-width:560px; background:color-mix(in srgb,var(--bg-deep) 55%,var(--surface-muted)); border-bottom:1px solid var(--border-subtle); font-size:0.65rem; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--text-muted); align-items:center; }
.sp-ov-row { display:grid; grid-template-columns:130px 130px 90px 80px 1fr 30px; gap:0.4rem; padding:0.38rem 0.6rem; min-width:560px; align-items:center; border-bottom:1px solid var(--border-subtle); }
.sp-ov-row:last-child { border-bottom:none; }
/* Overlapping-dates conflict (only the FIRST matching override prices a date — the rest are silently
   ignored by the engine). Amber inset bar + tint make the ambiguity visible; the note below explains. */
.sp-ov-row.is-conflict { box-shadow: inset 3px 0 0 var(--state-warning); background: color-mix(in srgb, var(--state-warning) 7%, transparent); }
/* Workspace-wide override scope chip ("All properties" / "Tagged: x") — same dashed-neutral
   language as .sp-found-managed. These rows price EVERY matching property, so scope must read
   at a glance next to the label. */
.sp-ov-label-cell { display:flex; flex-direction:column; gap:2px; min-width:0; }
.sp-ov-scope { align-self:flex-start; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:0.75rem; font-weight:600; line-height:1.3; color:var(--text-muted); background:var(--bg-elevated); border:1px dashed var(--border-subtle); border-radius:999px; padding:1px 8px; cursor:help; }
.sp-ov-conflict-note { margin:0.4rem 0 0; font-size:0.78rem; line-height:1.45; color: color-mix(in srgb, var(--state-warning) 75%, var(--text-primary)); }
.sp-rm { display:flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:7px; border:1px solid color-mix(in srgb,var(--state-error) 28%,var(--border-subtle)); background:color-mix(in srgb,var(--state-error) 8%,var(--bg-input)); color:var(--state-error); cursor:pointer; transition:background var(--sp3-dur-1) var(--sp3-ease); }
.sp-rm:hover { background:color-mix(in srgb,var(--state-error) 18%,var(--bg-input)); }
.sp-add-ov { align-self:flex-start; font-size:0.8rem; }
.sp-save-err { font-size:0.78rem; color:var(--state-error); }
.sp-save-ok  { font-size:0.78rem; color:var(--state-success); font-weight:500; }

/* ── Goal selector inside Strategy card ──────────────────────────────────
   The "Optimise for" preset is the high-level "what are we optimising
   for?" question the rules below answer. It used to sit in a nested
   pill container with its own padding, which pushed it horizontally
   off the card's left edge (looked indented compared to siblings).
   Flat-stacked now: label → full-width segmented control → description,
   each at the same horizontal edge as everything else in the card. */
.sp-strategy-goal {
  display:flex;
  flex-direction:column;
  gap:0.45rem;
  margin:0.5rem 0 0.6rem;
  padding:0;
  background:transparent;
  border:none;
}
.sp-strategy-goal-label {
  font-size:0.72rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--text-muted);
}
/* (Removed: .sp-strategy-goal-seg / .sp-strategy-goal-toggle / .sp-strategy-goal-desc
   — the "Optimise for" SegmentedControl they styled was replaced by
   PricingStrategyPicker, below. .sp-strategy-goal + .sp-strategy-goal-label
   above are still used as the section wrapper + label.) */

/* ── Guardrail range-viz band (PricingGuardrailBand.tsx) ──────────────────
   The "where the engine can move" picture under the Your-price inputs. A
   horizontal track with Floor / Base / Ceiling stops; the filled band spans
   floor→ceiling, the emphasised Base knob sits proportionally within. When no
   ceiling is set the track fades open-ended to the right (the runaway-risk
   nudge). Tokens only; stops stack vertically < 480px. */
.sp-guard {
  margin-top:1.1rem;
  padding-top:0.2rem;
}
.sp-guard-track {
  position:relative;
  height:6px;
  margin:2.4rem 0.5rem 0;
  border-radius:999px;
  /* The empty rail behind the fill. */
  background:color-mix(in srgb, var(--text-primary) 10%, var(--bg-input));
}
.sp-guard-fill {
  position:absolute;
  inset:0;
  border-radius:999px;
  background:color-mix(in srgb, var(--accent) 30%, transparent);
}
/* Open-right: no ceiling → the fill dissolves toward the right edge to read as
   "unbounded", and the rail dashes off past the last stop. */
.sp-guard-track.is-open-right .sp-guard-fill {
  background:linear-gradient(
    to right,
    color-mix(in srgb, var(--accent) 30%, transparent) 35%,
    transparent 100%
  );
}
.sp-guard-track.is-open-right::after {
  content:"";
  position:absolute;
  top:50%;
  right:-0.5rem;
  transform:translateY(-50%);
  width:1.2rem;
  height:2px;
  background:repeating-linear-gradient(
    to right,
    color-mix(in srgb, var(--text-primary) 26%, transparent) 0 4px,
    transparent 4px 8px
  );
}
.sp-guard-stop {
  position:absolute;
  top:50%;
  transform:translate(-50%, -50%);
}
.sp-guard-tick {
  display:block;
  width:2px;
  height:14px;
  border-radius:1px;
  margin:0 auto;
  background:color-mix(in srgb, var(--text-primary) 38%, transparent);
}
/* Base = the anchor: an emphasised ringed knob that pops off the track. */
.sp-guard-knob {
  display:block;
  width:16px;
  height:16px;
  border-radius:50%;
  margin:0 auto;
  background:var(--accent);
  border:2.5px solid var(--bg-elevated);
  box-shadow:var(--sp3-shadow-sm), 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent);
}
.sp-guard-stop--base.is-bad .sp-guard-knob {
  background:var(--state-warning);
  box-shadow:var(--sp3-shadow-sm), 0 0 0 1px color-mix(in srgb, var(--state-warning) 60%, transparent);
}
.sp-guard-stop-lbl {
  position:absolute;
  bottom:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1px;
  white-space:nowrap;
  line-height:1.2;
}
/* Edge labels hug the inside so they don't run off the card edge. */
.sp-guard-stop--floor .sp-guard-stop-lbl { left:0; transform:none; align-items:flex-start; }
.sp-guard-stop-lbl--right { left:auto; right:0; transform:none; align-items:flex-end; }
.sp-guard-stop-cap {
  font-size:0.62rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.07em;
  color:var(--text-muted);
}
.sp-guard-stop-val {
  font-size:0.82rem;
  font-weight:700;
  color:var(--text-primary);
}
.sp-guard-stop-lbl--base .sp-guard-stop-cap { color:var(--accent); }
.sp-guard-stop--base.is-bad .sp-guard-stop-lbl--base .sp-guard-stop-cap { color:var(--state-warning); }
.sp-guard-note {
  margin:1.6rem 0 0;
  font-size:0.78rem;
  color:var(--text-muted);
  line-height:1.45;
}
/* Caution (no ceiling) — calm, not alarming: a soft warning-tinted line with a
   left accent rule. Warning (misconfig) — firmer, same family, stronger tint. */
.sp-guard-note--caution,
.sp-guard-note--warn {
  padding:0.55rem 0.7rem;
  border-radius:var(--sp3-radius-sm);
  border-left:3px solid var(--state-warning);
}
.sp-guard-note--caution {
  color:var(--text-soft);
  background:color-mix(in srgb, var(--state-warning) 7%, var(--bg-input));
}
.sp-guard-note--warn {
  color:var(--text-primary);
  font-weight:500;
  background:color-mix(in srgb, var(--state-warning) 12%, var(--bg-input));
}
/* < 480px: the three stop-labels would collide on a short track. Drop the
   absolute floating labels and render a stacked legend below the rail instead.
   The track + knob stay; only the labels reflow. */
@media (max-width: 480px) {
  .sp-guard-track { margin-top:1.4rem; }
  .sp-guard-stop-lbl,
  .sp-guard-stop-lbl--right {
    position:static;
    transform:none;
    flex-direction:row;
    gap:0.3rem;
    align-items:baseline;
  }
  .sp-guard-stop {
    position:static;
    transform:none;
    display:flex;
    align-items:center;
    gap:0.4rem;
  }
  .sp-guard-stop--floor .sp-guard-stop-lbl { align-items:baseline; }
  /* Stack the stops as a small legend beneath the rail. */
  .sp-guard-track {
    display:flex;
    flex-direction:column;
    gap:0.4rem;
    height:auto;
    background:none;
    margin-left:0;
    margin-right:0;
  }
  .sp-guard-fill,
  .sp-guard-track.is-open-right::after { display:none; }
  .sp-guard-tick,
  .sp-guard-knob { display:none; }
}

/* ── Live preview widget ─────────────────────────────────────────────────
   Sits at the top of Foundations. Shows the engine's price for three
   canonical future dates, and (when there are pending edits) the delta
   from the last-saved baseline. The "Pending" badge + the green/red
   colour shift makes the impact of an edit immediately visible — turning
   abstract knob-tweaks into "what will this cost a guest tomorrow."

   Two visual states:
   - is-dirty:   pending changes, prices shift, badge in brand-accent
   - default:    steady-state, single price per row, muted badge
*/
.sp-live-preview {
  /* No outer chip border / background. A nested chip with its own padding
     caused the inner labels (Live preview, Tomorrow, Next Friday, 30 days
     out) to read as narrower than the foundation grid below. Now the
     section is flat — header and rows sit at the same horizontal edge as
     siblings inside the parent card. The dirty-state hint moves onto the
     date rows themselves (border accents). */
  margin:0.55rem 0 0.9rem;
  padding:0;
  background:transparent;
  border:none;
  border-radius:0;
}
.sp-live-preview.is-dirty {
  background:transparent;
  border:none;
}
/* Dirty-state row border used to inherit the accent color, which made
   the preview look "selected" — the same visual treatment we use for
   the active sub-tab nav button. The strikethrough price + delta pill
   already telegraph "this would change" cleanly, so the border accent
   is redundant noise. Hold rows at the same subtle border in either
   state. */
.sp-live-preview-head { margin-bottom:0.6rem; }
.sp-live-preview-title-wrap {
  display:flex;
  align-items:center;
  gap:0.5rem;
}
.sp-live-preview-dot {
  width:0.5rem;
  height:0.5rem;
  border-radius:50%;
  background:var(--accent);
  flex-shrink:0;
  box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent);
  animation:sp-live-preview-pulse 2.8s ease-in-out infinite;
}
.sp-live-preview.is-dirty .sp-live-preview-dot {
  animation-duration:1.6s;
}
@keyframes sp-live-preview-pulse {
  0%, 100% { box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent); }
  50%      { box-shadow:0 0 0 6px color-mix(in srgb,var(--accent) 4%,transparent); }
}
.sp-live-preview-title {
  margin:0;
  font-size:0.85rem;
  font-weight:700;
  color:var(--text-primary);
}
.sp-live-preview-badge {
  /* Pending state — was using the accent color, which created a "this
     is selected" reading because the active sub-tab nav button uses
     the same hue. Switched to an amber tone (universal "draft / unsaved")
     so the badge reads as a status pill, not a selectable chip. */
  display:inline-flex;
  align-items:center;
  padding:0.15rem 0.5rem;
  border-radius:999px;
  font-size:0.66rem;
  font-weight:700;
  letter-spacing:0.06em;
  text-transform:uppercase;
  background:color-mix(in srgb, #f59e0b 14%, var(--surface-muted));
  border:1px solid color-mix(in srgb, #f59e0b 30%, var(--border-subtle));
  color:color-mix(in srgb, #b45309 60%, var(--text-primary));
}
.sp-live-preview-badge.is-muted {
  background:var(--surface-muted);
  border-color:var(--border-subtle);
  color:var(--text-muted);
}
.sp-live-preview-sub {
  margin:0.25rem 0 0;
  font-size:0.76rem;
  line-height:1.4;
}
.sp-live-preview-rows {
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:0.4rem;
}
.sp-live-preview-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0.85rem;
  padding:0.45rem 0.6rem;
  border-radius:8px;
  background:var(--bg-input);
  border:1px solid var(--border-subtle);
}
.sp-live-preview-row-label {
  display:flex;
  flex-direction:column;
  gap:0.1rem;
  flex:1;
  min-width:0;
}
.sp-live-preview-row-label strong {
  font-size:0.82rem;
  font-weight:600;
  color:var(--text-primary);
}
.sp-live-preview-row-label small { font-size:0.7rem; }
.sp-live-preview-row-prices {
  display:flex;
  align-items:baseline;
  gap:0.55rem;
  flex-shrink:0;
}
.sp-live-preview-prev {
  font-size:0.78rem;
  color:var(--text-muted);
  text-decoration:line-through;
  font-variant-numeric:tabular-nums;
}
.sp-live-preview-price {
  font-size:1.1rem;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  color:var(--text-primary);
  transition:color 0.2s;
}
.sp-live-preview-price--up { color:var(--state-success); }
.sp-live-preview-price--down { color:var(--state-error); }
.sp-live-preview-delta {
  font-size:0.72rem;
  font-weight:600;
  padding:0.12rem 0.4rem;
  border-radius:6px;
  font-variant-numeric:tabular-nums;
}
.sp-live-preview-delta--up {
  background:color-mix(in srgb,var(--state-success) 14%,var(--surface-muted));
  color:var(--state-success);
}
.sp-live-preview-delta--down {
  background:color-mix(in srgb,var(--state-error) 14%,var(--surface-muted));
  color:var(--state-error);
}
.sp-live-preview-delta--flat,
.sp-live-preview-delta--neutral {
  background:var(--surface-muted);
  color:var(--text-muted);
}

/* ── Pricing suggestions ─────────────────────────────────────────────────
   A plain checklist inside Price and limits. Severity lives in the words;
   the surface stays neutral unless an actual error needs attention. */
.sp-suggestions {
  margin:0 0 16px;
  padding:12px 0;
  border-top:1px solid var(--border-subtle);
  border-bottom:1px solid var(--border-subtle);
}
.sp-suggestions-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.sp-suggestions-title {
  margin:0;
  font-size:14px;
  font-weight:700;
  color:var(--text-primary);
}
.sp-suggestions-count {
  color:var(--text-muted);
  font-size:13px;
  font-weight:650;
}
.sp-suggestions-list {
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:0;
}
.sp-suggestion {
  padding:10px 0;
  border-top:1px solid var(--border-subtle);
}
.sp-suggestion--fail {
  color:var(--state-error);
}
.sp-suggestion-body { display:flex; flex-direction:column; gap:4px; }
.sp-suggestion-body strong {
  font-size:14px;
  font-weight:700;
  color:var(--text-primary);
}
.sp-suggestion--fail .sp-suggestion-body strong { color:var(--state-error); }
.sp-suggestion-body p {
  margin:0;
  font-size:13px;
  line-height:1.5;
  color:var(--text-secondary);
}
.sp-suggestion-actions {
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:5px;
}
.sp-suggestion-action {
  min-height:36px;
  padding:7px 12px;
  font-size:13px;
}
.sp-suggestion-dismiss {
  min-height:36px;
  padding:7px 4px;
  font-size:13px;
}

/* Custom seasonal profiles editor — sits inside the Seasonality factor card
   when Custom mode is selected. Per-city date-range rows. */
.sp-seasons {
  margin-top:0.85rem;
  padding:0.85rem 0.95rem;
  border-radius:10px;
  background:color-mix(in srgb,var(--bg-deep) 35%,var(--surface-muted));
  border:1px solid var(--border-subtle);
}
.sp-seasons-head { display:flex; align-items:flex-start; justify-content:space-between; gap:0.75rem; margin-bottom:0.65rem; }
.sp-seasons-title { margin:0 0 0.18rem; font-size:0.92rem; font-weight:800; color:var(--text-primary); }
.sp-seasons-sub { margin:0; font-size:0.75rem; line-height:1.45; color:var(--text-muted); max-width:42ch; }
.sp-seasons-sub strong { color:var(--text-primary); font-weight:700; }
.sp-seasons-empty { font-size:0.82rem; color:var(--text-muted); margin:0.4rem 0 0; }
/* Non-blocking overlap hint — overlaps are ALLOWED; the engine applies the
   narrowest (most-specific) covering range on shared dates. Token-based so it
   works in light + dark. */
.sp-seasons-hint {
  display:flex; align-items:flex-start; gap:0.45rem;
  margin:0.55rem 0 0; padding:0.5rem 0.65rem;
  font-size:0.76rem; line-height:1.45;
  color:color-mix(in srgb, var(--state-warning) 88%, var(--text-primary));
  background:color-mix(in srgb, var(--state-warning) 12%, var(--bg-elevated));
  border:1px solid color-mix(in srgb, var(--state-warning) 30%, var(--border-subtle));
  border-radius:8px;
}
.sp-seasons-hint svg { flex:none; margin-top:0.06rem; color:color-mix(in srgb, var(--state-warning) 80%, var(--text-primary)); }
.sp-seasons-hint strong { font-weight:700; }
.sp-seasons-table {
  display:flex; flex-direction:column;
  border:1px solid var(--border-subtle);
  border-radius:9px;
  overflow:hidden;
}
.sp-seasons-head-row,
.sp-seasons-row {
  display:grid;
  grid-template-columns:1.4fr 130px 130px 180px 30px;
  gap:0.4rem;
  padding:0.42rem 0.6rem;
  align-items:center;
}

/* Adjustment cell — direction toggle + signed % input.
   Makes "is this a discount or a premium?" obvious at a glance via
   highlighted toggle + colour-coded border on the active state. */
.sp-seasons-adj {
  display:flex; align-items:stretch; gap:0.35rem;
}
.sp-seasons-dir {
  display:inline-flex;
  border:1px solid var(--border-subtle);
  border-radius:7px;
  overflow:hidden;
  flex-shrink:0;
}
.sp-seasons-dir-btn {
  width:24px;
  font-size:0.8rem; font-weight:800;
  background:var(--surface-muted);
  color:var(--text-muted);
  border:none; cursor:pointer; padding:0;
  transition:all 0.12s;
}
.sp-seasons-dir-btn:not(:last-child) { border-right:1px solid var(--border-subtle); }
.sp-seasons-dir-btn:hover { color:var(--text-primary); }
.sp-seasons-dir-btn.is-on {
  background:color-mix(in srgb,currentColor 18%,var(--surface-muted));
}
.sp-seasons-adj--premium .sp-seasons-dir-btn.is-on {
  background:color-mix(in srgb,#22c55e 14%,var(--surface-muted));
  color:color-mix(in srgb,#22c55e 80%,var(--text-primary));
}
.sp-seasons-adj--discount .sp-seasons-dir-btn.is-on {
  background:color-mix(in srgb,#f59e0b 14%,var(--surface-muted));
  color:color-mix(in srgb,#f59e0b 85%,var(--text-primary));
}
.sp-seasons-adj .sp-sfx-wrap { flex:1; }
.sp-seasons-head-row {
  background:color-mix(in srgb,var(--bg-deep) 55%,var(--surface-muted));
  border-bottom:1px solid var(--border-subtle);
  font-size:0.62rem; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--text-muted);
}
.sp-seasons-row { border-bottom:1px solid var(--border-subtle); }
.sp-seasons-row:last-child { border-bottom:none; }
/* Inline delete confirm strip (replaces the native window.confirm popup).
   Appears beneath the armed row; styled, token-only, light/dark. */
.sp-seasons-confirm-bar {
  display:flex; align-items:center; flex-wrap:wrap; gap:0.5rem;
  padding:0.5rem 0.6rem;
  background:color-mix(in srgb, var(--state-error) 8%, var(--bg-input));
  border-bottom:1px solid var(--border-subtle);
}
.sp-seasons-confirm-txt { font-size:0.8rem; color:var(--text-primary); margin-right:auto; }
.sp-seasons-confirm-remove,
.sp-seasons-confirm-cancel {
  font:inherit; font-size:0.76rem; font-weight:600; cursor:pointer;
  padding:0.3rem 0.7rem; border-radius:var(--sp3-radius-sm);
  transition:background var(--sp3-dur-1) var(--sp3-ease), border-color var(--sp3-dur-1) var(--sp3-ease);
}
.sp-seasons-confirm-remove {
  border:1px solid color-mix(in srgb, var(--state-error) 45%, var(--border-subtle));
  background:color-mix(in srgb, var(--state-error) 16%, var(--bg-input));
  color:var(--state-error);
}
.sp-seasons-confirm-remove:hover { background:color-mix(in srgb, var(--state-error) 26%, var(--bg-input)); }
.sp-seasons-confirm-cancel {
  border:1px solid var(--border-subtle); background:transparent; color:var(--text-muted);
}
.sp-seasons-confirm-cancel:hover { color:var(--text-primary); border-color:var(--border-strong); }
.sp-seasons-confirm-remove:focus-visible,
.sp-seasons-confirm-cancel:focus-visible { outline:none; box-shadow:var(--sp3-ring); }

/* ── Loading ── */
.sp-loading { display:flex; align-items:center; justify-content:center; gap:0.4rem; min-height:60vh; }
.sp-loading span { width:8px; height:8px; border-radius:50%; background:var(--ring); opacity:0.3; animation:sp-pulse 1.2s ease-in-out infinite; }
.sp-loading span:nth-child(2) { animation-delay:0.2s; }
.sp-loading span:nth-child(3) { animation-delay:0.4s; }
@keyframes sp-pulse { 0%,100%{opacity:0.3;transform:scale(0.85)} 50%{opacity:1;transform:scale(1.1)} }

/* Honest tab loader (host 2026-06-11): REAL stage-driven progress — the fill advances only when
   a fetch actually completes (see loadSmartPricingData's onStage), never on a timer. Replaces
   the three-dot pulse on the Pricing & Stay tab. Token-themed → light/dark parity. */
.sp-load-panel { display:flex; flex-direction:column; gap:12px; justify-content:center; width:min(440px, 86%); min-height:55vh; margin:0 auto; }
.sp-load-head { font-size:15px; font-weight:700; color:var(--text-primary); }
.sp-load-bar { height:10px; border-radius:999px; background:var(--surface-muted); border:1px solid var(--border-subtle); overflow:hidden; }
.sp-load-fill { height:100%; border-radius:999px; background:linear-gradient(90deg, var(--accent), var(--ring)); box-shadow:0 0 8px color-mix(in srgb, var(--accent) 45%, transparent); transition:width 360ms cubic-bezier(0.22, 1, 0.36, 1); }
.sp-load-meta { display:flex; justify-content:space-between; gap:12px; font-size:12.5px; color:var(--text-muted); }
.sp-load-pct { font-weight:700; color:var(--text-soft); font-variant-numeric:tabular-nums; }

/* Load-failure panel — a real error + Retry, shown when the CORE fetch fails.
   Replaces the old silent engine-off render (host 2026-07-06). Token-themed →
   light/dark parity. */
.sp-load-panel.is-error { align-items:flex-start; }
.sp-load-panel.is-error .sp-load-head { color:var(--state-error); }
.sp-load-error-msg { margin:0; font-size:12.5px; color:var(--text-soft); line-height:1.5; }
.sp-retry-btn {
  margin-top:2px; align-self:flex-start;
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 14px; font-size:13px; font-weight:700;
  color:#fff; background:var(--brand-primary);
  border:1px solid color-mix(in srgb, var(--brand-primary) 70%, var(--border-subtle));
  border-radius:var(--radius-sm); cursor:pointer;
  transition:filter 140ms ease;
}
.sp-retry-btn:hover { filter:brightness(1.06); }
.sp-retry-btn:active { filter:brightness(0.96); }

/* Fetch-market-data outcome line (PricingSuggestions) — the button's click must visibly land. */
.sp-suggestion-status { margin:6px 0 0; font-size:13px; font-weight:600; }
.sp-suggestion-status.is-ok { color:var(--state-success); }
.sp-suggestion-status.is-err { color:var(--state-error); }

/* —— PropertiesPricingInsightsNav (workspace-property-nav-pane) — the pricing
   tab's supporting intelligence pane: revenue outlook + market context.
   (Renamed from PropertiesPricingCalendarNav 2026-06-02 when the heatmap +
   waterfall moved into the main tab's PricingPreviewCalendar.) —— */
.pnav-pricing { display:flex; flex-direction:column; gap:12px; padding:12px; height:100%; overflow-y:auto; container-type:inline-size; }
.pnav-loading { display:flex; align-items:center; justify-content:center; height:200px; }
.pnav-empty { padding:1.5rem 1rem; text-align:center; font-size:13px; color:var(--text-muted); line-height:1.5; }
/* Owner-mode pricing rail: portfolio pulse + the owner policy summary
   (PropertiesPricingInsightsNav's OwnerPricingRail). Theme tokens only. */
.pnav-owner-rail { display:flex; flex-direction:column; gap:0.75rem; padding:0.9rem 0.85rem; }
.pnav-owner-note { margin:0; font-size:13px; color:var(--text-muted); line-height:1.5; }
.pnav-retry-btn { display:inline-flex; align-items:center; min-height:36px; margin-top:0.7rem; padding:7px 11px; font-size:13px; font-weight:700; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-input); color:var(--text-primary); cursor:pointer; transition:all 0.12s; }
.pnav-retry-btn:hover:not(:disabled) { border-color:color-mix(in srgb,var(--ring) 40%,var(--border-subtle)); }
.pnav-retry-btn:disabled { opacity:0.6; cursor:default; }

.pnav-status { display:flex; align-items:center; gap:0.4rem; flex-wrap:wrap; }
.pnav-status-txt { font-size:13px; color:var(--text-muted); flex:1; }

/* Canonical calendar-publication status shared by the pricing editor and pane 4. */
.pricing-publication-status {
  display:inline-flex; align-items:center; gap:0.32rem;
  font-size:16px; font-weight:700;
  padding:2px 0;
  border:0;
  background:transparent;
  color:var(--text-muted);
  cursor:default;
}
.pricing-publication-status__dot { width:8px; height:8px; flex:0 0 8px; border-radius:50%; background:currentColor; opacity:0.9; }
.pricing-publication-status--checking { color:var(--text-muted); }
.pricing-publication-status--fresh { color:var(--state-success); }
.pricing-publication-status--ok    { color:var(--text-muted); }
.pricing-publication-status--stale { color:var(--state-warning); }
.pricing-publication-status--old   { color:var(--state-error); }
.pricing-publication-status--never { color:var(--text-muted); }
@keyframes pnav-pulse { 0%,100%{opacity:1} 50%{opacity:0.65} }

/* ── pnav header + section switcher ──────────────────────────────────────
   The pane is a calm, narrow (≈320–420px) supporting surface. Three sp3
   segmented sections (Revenue / Market / Long-let) sit under the status row;
   the active chip lifts on an elevated surface + token shadow (dark in both
   themes) so it reads tactile without a hardcoded drop. */
.pnav-header { display:flex; flex-direction:column; gap:0.55rem; }
.pnav-tabs {
  display:flex; gap:3px; padding:3px;
  border-radius:var(--sp3-radius-sm);
  background:var(--surface-muted);
  border:1px solid var(--border-subtle);
}
.pnav-tab-btn {
  flex:1; min-height:36px; padding:7px 8px;
  font-size:13px; font-weight:600;
  border:none; border-radius:8px;
  background:transparent; color:var(--text-muted);
  cursor:pointer;
  transition:background-color var(--sp3-dur-1) var(--sp3-ease),
    color var(--sp3-dur-1) var(--sp3-ease),
    box-shadow var(--sp3-dur-1) var(--sp3-ease);
}
.pnav-tab-btn:hover:not(:disabled) { color:var(--text-primary); }
.pnav-tab-btn.is-on { background:var(--bg-elevated); color:var(--text-primary); box-shadow:none; font-weight:700; }
.pnav-tab-btn:disabled { opacity:0.45; cursor:not-allowed; }
.pnav-tab-btn:focus-visible { outline:none; box-shadow:var(--sp3-ring); }

/* ── Preview section (default tab) ───────────────────────────────────────────
   Thin wrapper around PricingPreviewCalendar. The calendar declares its OWN
   inline-size container, so this wrapper just needs min-width:0 to let it
   shrink with the resizable pane (and not force a horizontal scrollbar). */
.pnav-preview { display:flex; flex-direction:column; gap:0.6rem; min-width:0; }
.pnav-preview-pending {
  display:flex; align-items:center; gap:0.45rem;
  font-size:13px; font-weight:600;
  color:var(--text-soft);
  padding:9px 10px;
  border-radius:var(--sp3-radius-sm);
  border:1px solid var(--border-subtle);
  background:var(--surface-muted);
}
.pnav-preview-pending-dot {
  width:8px; height:8px; border-radius:999px;
  background:var(--accent);
  flex-shrink:0;
}
@media (prefers-reduced-motion: reduce) {
  .pnav-preview-pending-dot { animation:none; }
}

/* ── Calendar polish (2026-06-06): expand-to-full-width affordance + overlay ──
   The Expand button sits top-right of the side-pane preview; the overlay re-renders the
   SAME PricingPreviewCalendar at full width, portaled to <body>. Card chrome is theme-
   tokened (light + dark parity); the scrim + drop-shadow match the event credibility modal
   (a fixed dark translucent dimmer that reads correctly in BOTH modes). Full-screen sheet
   < 768px (CLAUDE.md small-screen rule). */
.pnav-preview-expand {
  align-self:flex-end;
  display:inline-flex; align-items:center; gap:0.35rem;
  min-height:36px;
  font-size:13px;
  padding:7px 10px;
}
.pnav-pc-overlay {
  position:fixed; inset:0; z-index:1000;
  display:flex; align-items:center; justify-content:center;
  padding:1.25rem;
  background:rgba(15,23,42,0.55);
  backdrop-filter:blur(2px);
}
.pnav-pc-overlay-card {
  width:min(1080px, 100%); max-height:90vh;
  display:flex; flex-direction:column;
  background:var(--bg-elevated); color:var(--text-primary);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 24px 60px rgba(15,23,42,0.28);
  overflow:hidden;
}
.pnav-pc-overlay-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:0.7rem 0.9rem;
  border-bottom:1px solid var(--border-subtle);
  flex-shrink:0;
}
.pnav-pc-overlay-title { font-size:15px; font-weight:750; color:var(--text-primary); }
.pnav-pc-overlay-close {
  width:36px; height:36px;
  display:grid; place-items:center;
  border-radius:8px; cursor:pointer;
  color:var(--text-soft);
  background:transparent; border:1px solid var(--border-subtle);
  transition:color 0.15s ease, background 0.15s ease;
}
.pnav-pc-overlay-close:hover {
  color:var(--text-primary);
  background:color-mix(in srgb, var(--text-primary) 6%, transparent);
}
.pnav-pc-overlay-body { padding:1rem 1.1rem 1.2rem; overflow:auto; min-width:0; }
@media (max-width: 768px) {
  .pnav-pc-overlay { padding:0; }
  .pnav-pc-overlay-card { width:100%; height:100%; max-height:100%; border:none; border-radius:0; }
}

/* ── Revenue section ─────────────────────────────────────────────────────
   Flagship: a quiet elevated hero card carries the projected-annual headline
   in a big tabular figure, with RevPAN / avg / est-occ as supporting stats. */
.pnav-revsec { display:flex; flex-direction:column; gap:0.85rem; }
.pnav-revsec-foot { font-size:13px; color:var(--text-muted); margin:0.55rem 0 0; line-height:1.5; }

.pnav-hero {
  display:flex; flex-direction:column; gap:0.15rem;
  padding:16px;
  border-radius:10px;
  background:var(--bg-elevated);
  border:1px solid var(--border-subtle);
  box-shadow:none;
}
.pnav-hero-lbl { font-size:13px; font-weight:650; color:var(--text-muted); }
.pnav-hero-val { font-size:28px; font-weight:800; color:var(--text-primary); line-height:1.1; }
.pnav-hero-meta {
  display:flex; flex-wrap:wrap; gap:0.55rem 1rem;
  margin-top:0.7rem; padding-top:0.7rem;
  border-top:1px solid var(--border-subtle);
}
.pnav-hero-stat { display:flex; flex-direction:column; gap:0.1rem; min-width:0; }
.pnav-hero-stat-val { font-size:1rem; font-weight:800; color:var(--text-primary); line-height:1; }
.pnav-hero-stat:first-child .pnav-hero-stat-val { color:var(--text-primary); }
.pnav-hero-stat-lbl { font-size:13px; font-weight:650; color:var(--text-muted); line-height:1.3; display:inline-flex; align-items:center; gap:5px; }
.pnav-hero-stat-lbl .sp-tip { width:16px; height:16px; font-size:13px; opacity:0.75; }
.pnav-hero-stat-lbl .sp-tip:hover { opacity:1; }

/* Floor / ceiling / median — a single quiet supporting line under the hero */
.pnav-band-line {
  display:flex; align-items:center; gap:0.55rem;
  padding:10px 12px;
  border-radius:var(--sp3-radius-sm);
  background:var(--surface-muted);
  border:1px solid var(--border-subtle);
}
.pnav-band-seg { display:flex; flex-direction:column; gap:0.05rem; min-width:0; }
.pnav-band-k { font-size:13px; font-weight:650; color:var(--text-muted); line-height:1.2; }
.pnav-band-v { font-size:14px; font-weight:800; color:var(--text-primary); line-height:1.2; }
.pnav-band-v--muted { color:var(--text-muted); }
.pnav-band-rail { flex:1; height:1px; background:var(--border-subtle); }

/* —— /pricing page —— */
.prc-page { display:flex; flex-direction:column; gap:1.25rem; padding:1.5rem; max-width:900px; }
.prc-header { margin-bottom:0.25rem; }
.prc-h1 { font-size:1.4rem; font-weight:800; letter-spacing:-0.025em; color:var(--text-primary); margin:0 0 0.3rem; }
.prc-lead { font-size:0.85rem; line-height:1.55; margin:0; }
.prc-card { padding:1.25rem !important; }
.prc-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; margin-bottom:1.1rem; }
.prc-create-btn { font-size:0.82rem; min-height:34px; padding:0.3rem 0.8rem; }
.prc-create-form { display:flex; flex-direction:column; gap:0.6rem; padding:0.9rem; border-radius:10px; border:1px solid var(--border-subtle); background:color-mix(in srgb,var(--bg-deep) 55%,var(--surface-muted)); margin-bottom:1rem; }
.prc-create-actions { display:flex; gap:0.5rem; }
.prc-empty { display:flex; flex-direction:column; align-items:center; gap:0.5rem; padding:2.5rem 1rem; text-align:center; }
.prc-empty-icon { color:var(--text-muted); margin-bottom:0.25rem; }
.prc-empty-title { font-size:0.95rem; font-weight:700; color:var(--text-primary); margin:0; }
.prc-tmpl-list { display:flex; flex-direction:column; gap:0.7rem; }
.prc-tmpl-card { padding:0.9rem 1rem; border-radius:10px; border:1px solid var(--border-subtle); background:var(--surface-muted); display:flex; flex-direction:column; gap:0.55rem; }
.prc-tmpl-head { display:flex; align-items:flex-start; justify-content:space-between; gap:0.75rem; }
.prc-tmpl-meta { flex:1; }
.prc-tmpl-name { font-size:0.92rem; font-weight:700; color:var(--text-primary); display:flex; align-items:center; gap:0.5rem; margin-bottom:0.2rem; }
.prc-tmpl-desc { font-size:0.78rem; margin:0; }
.prc-tmpl-actions { display:flex; align-items:center; gap:0.4rem; flex-shrink:0; }
.prc-tmpl-btn { font-size:0.75rem; min-height:30px; padding:0.2rem 0.6rem; }
.prc-rm-btn { display:flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:7px; border:1px solid color-mix(in srgb,#ef4444 28%,var(--border-subtle)); background:color-mix(in srgb,#ef4444 8%,var(--bg-input)); color:#f87171; cursor:pointer; }
.prc-tmpl-chips { display:flex; gap:0.35rem; flex-wrap:wrap; }
.prc-chip { font-size:0.69rem; padding:0.18rem 0.45rem; border-radius:5px; background:color-mix(in srgb,var(--ring) 12%,var(--surface-muted)); border:1px solid color-mix(in srgb,var(--ring) 22%,var(--border-subtle)); color:color-mix(in srgb,var(--ring) 85%,var(--text-muted)); font-weight:600; }
.prc-tmpl-footer { display:flex; gap:1rem; padding-top:0.4rem; border-top:1px solid var(--border-subtle); }
.prc-tmpl-stat { font-size:0.72rem; color:var(--text-muted); }
.prc-badge { font-size:0.62rem; padding:0.12rem 0.38rem; border-radius:4px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; }
.prc-badge--default { background:color-mix(in srgb,#22c55e 16%,var(--surface-muted)); border:1px solid color-mix(in srgb,#22c55e 35%,var(--border-subtle)); color:#4ade80; }
.prc-coming-soon { display:flex; align-items:center; justify-content:center; padding:1.5rem; border-radius:8px; border:1px dashed var(--border-subtle); color:var(--text-muted); font-size:0.82rem; margin-top:0.75rem; }

/* ── Length-of-Stay (LOS) card ──────────────────────────────────────────────
   SIMPLE view (default): two plain-English "% off" fields (weekly + monthly).
   CUSTOM guard: calm read-only summary + explicit "reset to simple".
   ADVANCED slot: free-form per-length bracket editor.
   All token-only (light/dark parity), sp3 numerals, collapses <480px.
   See PricingRulesSection.tsx k="los" + lib/los-tiers.ts. */

/* SIMPLE — the dead-simple lever 90% of hosts use */
.sp-los-simple { display:flex; flex-direction:column; gap:0.7rem; }
.sp-los-disc { display:flex; align-items:center; justify-content:space-between; gap:0.75rem; flex-wrap:wrap; padding:0.7rem 0.85rem; border:1px solid var(--border-subtle); border-radius:var(--sp3-radius-sm); background:color-mix(in srgb,var(--bg-deep) 40%,var(--surface-muted)); }
.sp-los-disc-head { display:flex; flex-direction:column; gap:0.1rem; min-width:0; }
.sp-los-disc-lbl { font-size:0.86rem; font-weight:650; color:var(--text-primary); }
.sp-los-disc-help { font-size:0.74rem; color:var(--text-muted); }
.sp-los-disc-input-row { display:flex; align-items:center; gap:0.4rem; flex-shrink:0; }
.sp-los-disc-input { width:5.5rem; text-align:right; font-weight:700; }
.sp-los-disc-suffix { font-size:0.78rem; font-weight:600; color:var(--text-soft); white-space:nowrap; }
.sp-los-simple-recap { margin:0.1rem 0 0; font-size:0.78rem; color:var(--text-soft); font-variant-numeric:tabular-nums; }

/* CUSTOM schedule guard — never clobber the host's Advanced work */
.sp-los-custom { display:flex; align-items:flex-start; justify-content:space-between; gap:0.9rem; flex-wrap:wrap; padding:0.8rem 0.9rem; border:1px solid var(--border-subtle); border-radius:var(--sp3-radius-sm); background:color-mix(in srgb,var(--accent) 6%,var(--surface-muted)); }
.sp-los-custom-text { display:flex; flex-direction:column; gap:0.25rem; min-width:0; flex:1 1 14rem; }
.sp-los-custom-badge { align-self:flex-start; font-size:0.62rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:color-mix(in srgb,var(--accent) 80%,var(--text-primary)); padding:0.12rem 0.4rem; border-radius:5px; background:color-mix(in srgb,var(--accent) 14%,transparent); border:1px solid color-mix(in srgb,var(--accent) 30%,var(--border-subtle)); }
.sp-los-custom-summary { margin:0; font-size:0.88rem; font-weight:650; color:var(--text-primary); }
.sp-los-custom-hint { margin:0; font-size:0.76rem; color:var(--text-muted); }
.sp-los-custom-reset { flex-shrink:0; align-self:center; padding:0.42rem 0.8rem; font-size:0.78rem; font-weight:650; color:var(--text-primary); background:var(--bg-input); border:1px solid var(--border-strong); border-radius:var(--sp3-radius-sm); cursor:pointer; transition:border-color var(--sp3-dur-1) var(--sp3-ease), background-color var(--sp3-dur-1) var(--sp3-ease); }
.sp-los-custom-reset:hover { border-color:var(--accent); background:color-mix(in srgb,var(--accent) 8%,var(--bg-input)); }
.sp-los-custom-reset:focus-visible { outline:none; box-shadow:var(--sp3-ring); }

/* ADVANCED — free-form per-length brackets (RU-native <LOS Nights=…>) */
.sp-los-adv { display:flex; flex-direction:column; gap:0.35rem; }
.sp-los-adv-hint { margin:0 0 0.5rem; font-size:0.76rem; color:var(--text-muted); line-height:1.45; }
.sp-los-rows { display:flex; flex-direction:column; gap:0.5rem; }
.sp-los-row { display:flex; align-items:flex-end; gap:0.6rem; flex-wrap:wrap; padding:0.55rem 0.6rem; border:1px solid var(--border-subtle); border-radius:var(--sp3-radius-sm); background:var(--surface-muted); }
.sp-los-row-field { display:flex; flex-direction:column; gap:0.2rem; }
.sp-los-row-lbl { font-size:0.66rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted); }
.sp-los-row .sp-sfx-wrap .sp-input { width:5rem; }
.sp-los-row-eff { flex:1 1 8rem; min-width:0; align-self:center; font-size:0.78rem; font-weight:600; color:var(--text-soft); font-variant-numeric:tabular-nums; }
.sp-los-row-eff.is-disc { color:color-mix(in srgb,var(--state-success) 82%,var(--text-soft)); }
.sp-los-row-eff.is-prem { color:color-mix(in srgb,var(--state-warning) 82%,var(--text-soft)); }
.sp-los-row-rm { flex-shrink:0; align-self:center; width:1.7rem; height:1.7rem; display:flex; align-items:center; justify-content:center; font-size:1.1rem; line-height:1; color:var(--text-muted); background:transparent; border:1px solid var(--border-subtle); border-radius:6px; cursor:pointer; transition:color var(--sp3-dur-1) var(--sp3-ease), border-color var(--sp3-dur-1) var(--sp3-ease), background-color var(--sp3-dur-1) var(--sp3-ease); }
.sp-los-row-rm:hover { color:var(--state-danger,var(--text-primary)); border-color:color-mix(in srgb,var(--state-danger,var(--text-primary)) 45%,var(--border-subtle)); background:color-mix(in srgb,var(--state-danger,var(--text-primary)) 8%,transparent); }
.sp-los-row-rm:focus-visible { outline:none; box-shadow:var(--sp3-ring); }
.sp-los-add { align-self:flex-start; margin-top:0.5rem; padding:0.42rem 0.75rem; font-size:0.78rem; font-weight:650; color:color-mix(in srgb,var(--accent) 85%,var(--text-primary)); background:color-mix(in srgb,var(--accent) 8%,transparent); border:1px dashed color-mix(in srgb,var(--accent) 40%,var(--border-subtle)); border-radius:var(--sp3-radius-sm); cursor:pointer; transition:background-color var(--sp3-dur-1) var(--sp3-ease), border-color var(--sp3-dur-1) var(--sp3-ease); }
.sp-los-add:hover { background:color-mix(in srgb,var(--accent) 14%,transparent); border-style:solid; }
.sp-los-add:focus-visible { outline:none; box-shadow:var(--sp3-ring); }

/* <480px: stack the simple field label above the input, and let advanced rows
   wrap their effect line below the two number fields. */
@media (max-width:480px) {
  .sp-los-disc { flex-direction:column; align-items:stretch; gap:0.5rem; }
  .sp-los-disc-input-row { justify-content:space-between; }
  .sp-los-disc-input { width:100%; }
  .sp-los-row-eff { order:3; flex-basis:100%; }
}

.sp-adj-sub-title { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); margin:0 0 0.5rem; }

/* Market intelligence section */
.pnav-market { display:flex; flex-direction:column; gap:0.85rem; }
.pnav-mkt-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.4rem; }
.pnav-mkt-card { display:flex; flex-direction:column; gap:3px; padding:12px; border-radius:9px; border:1px solid var(--border-subtle); background:var(--surface-muted); }
.pnav-mkt-card--hi,
.pnav-mkt-card--lo { border-color:var(--border-subtle); background:var(--surface-muted); }
.pnav-mkt-val { font-size:1.05rem; font-weight:800; color:var(--text-primary); line-height:1.1; }
.pnav-mkt-card--hi .pnav-mkt-val,
.pnav-mkt-card--lo .pnav-mkt-val { color:var(--text-primary); }
.pnav-mkt-lbl { font-size:13px; font-weight:650; color:var(--text-muted); line-height:1.3; }
.pnav-mkt-section { display:flex; flex-direction:column; gap:0.4rem; }
.pnav-mkt-section-title { font-size:13px; font-weight:700; color:var(--text-secondary); margin:0; }

/* Day-of-week bar chart */
.pnav-dow-bars { display:flex; gap:0.25rem; align-items:flex-end; height:72px; padding-top:0.25rem; }
.pnav-dow-bar-col { display:flex; flex-direction:column; align-items:center; gap:0.15rem; flex:1; height:100%; justify-content:flex-end; }
.pnav-dow-bar-wrap { flex:1; width:100%; display:flex; align-items:flex-end; background:var(--border-subtle); border-radius:3px 3px 0 0; overflow:hidden; min-height:4px; }
.pnav-dow-bar-fill { width:100%; background:color-mix(in srgb,var(--accent) 65%,var(--state-success)); border-radius:3px 3px 0 0; transition:height var(--sp3-dur-3) var(--sp3-ease); }
.pnav-dow-bar-lbl { font-size:13px; font-weight:700; color:var(--text-muted); }
.pnav-dow-bar-pct { font-size:13px; color:var(--text-muted); }

/* Monthly bars */
.pnav-mkt-month-row { display:grid; grid-template-columns:2.5rem 1fr 2.2rem; gap:0.35rem; align-items:center; }
.pnav-mkt-month-lbl { font-size:13px; font-weight:700; color:var(--text-muted); }
.pnav-mkt-month-bar-wrap { height:6px; border-radius:3px; background:var(--border-subtle); overflow:hidden; }
.pnav-mkt-month-bar-fill { height:100%; background:color-mix(in srgb,var(--accent) 65%,var(--state-success)); border-radius:3px; transition:width var(--sp3-dur-3) var(--sp3-ease); }
.pnav-mkt-month-pct { font-size:13px; color:var(--text-muted); text-align:right; }

/* Peak demand dates — premium chips (replaces the old per-row bar list) */
.pnav-peak-chips { display:flex; flex-wrap:wrap; gap:0.35rem; }
.pnav-peak-chip {
  display:inline-flex; align-items:center; gap:0.4rem;
  padding:7px 9px;
  border-radius:8px;
  background:var(--surface-muted);
  border:1px solid var(--border-subtle);
  cursor:default;
}
.pnav-peak-chip-date { font-size:13px; font-weight:700; color:var(--text-primary); line-height:1; }
.pnav-peak-chip-pct { font-size:13px; font-weight:800; line-height:1; color:var(--text-secondary); }

.pnav-mkt-source { font-size:13px; color:var(--text-muted); margin:0; text-align:center; line-height:1.4; }

/* Dynamic LM windows */
.sp-lm-window { display:grid; grid-template-columns:auto 1fr 1fr auto; gap:0.5rem; align-items:end; padding:0.5rem 0.65rem; background:color-mix(in srgb,var(--bg-deep) 45%,var(--surface-muted)); border:1px solid var(--border-subtle); border-radius:8px; }
.sp-lm-window-label { font-size:0.69rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.05em; white-space:nowrap; align-self:center; padding-top:1.2rem; }
.sp-lm-rm { width:28px; height:28px; align-self:end; }

/* Override action row */
.sp-ov-actions { display:flex; gap:0.5rem; align-items:center; flex-wrap:wrap; }

/* ── Monthly revenue projection ── */
.pnav-monthly-rev { display:flex; flex-direction:column; gap:6px; padding:12px; background:var(--surface-muted); border:1px solid var(--border-subtle); border-radius:9px; }
.pnav-monthly-rev-header { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:0.15rem; gap:0.5rem; }
.pnav-monthly-rev-title { font-size:13px; font-weight:700; color:var(--text-secondary); }
.pnav-monthly-rev-note { font-size:13px; color:var(--text-muted); }
.pnav-monthly-row { display:grid; grid-template-columns:2.6rem 1fr 2.2rem 3.8rem; gap:0.4rem; align-items:center; }
.pnav-monthly-lbl { font-size:13px; font-weight:700; color:var(--text-muted); }
.pnav-monthly-bar-wrap { height:6px; border-radius:3px; background:var(--border-subtle); overflow:hidden; }
.pnav-monthly-bar-fill { height:100%; border-radius:3px; transition:width var(--sp3-dur-3) var(--sp3-ease); }
.pnav-monthly-occ { font-size:13px; color:var(--text-muted); text-align:right; }
.pnav-monthly-val { font-size:13px; font-weight:800; color:var(--text-primary); text-align:right; }

/* ── Market narrative ── */
.pnav-narrative { font-size:13px; color:var(--text-muted); line-height:1.55; margin:0; padding:12px; background:var(--surface-muted); border-radius:9px; border:1px solid var(--border-subtle); }

/* ── Live market data (PMI) — read-only external benchmark block ──
   A premium accent-tinted card (matches pnav-monthly-rev) so it reads as the
   featured headline external signal, distinct from the Inside Airbnb context
   below. All colour tokenised → light/dark parity (CLAUDE.md #5). */

/* ════════════════════════════════════════════════════════════════════════════
   pviz-* — Pricing Insights data-viz (the showpiece)
   ───────────────────────────────────────────────────────────────────────────
   Bespoke SVG charts for PropertiesPricingInsightsNav → "Insights" tab:
   booking-pace curve (hero), demand-spike timeline, comp-set price spread,
   market gauge. Read before changing (CLAUDE.md #9):

   • LIGHT/DARK PARITY (CLAUDE.md #5): every chrome colour is a theme token
     (--accent / --text-* / --surface-muted / --border-* / --state-*). SVG
     strokes/fills use currentColor (cards set `color:var(--accent)` on the
     chart container) or explicit tokens, so they re-resolve per theme with no
     hardcoded hex on any rule line.
   • RESPONSIVE: cards live in a resizable, narrow pane. SVGs use viewBox +
     width:100% (they scale to the pane); flex children carry min-width:0; the
     gauge row stacks below ~300px. No fixed pixel widths that could overflow.
   • MOTION: one mount reveal via the parent .sp3-reveal — no per-frame loops.
   The chart MATH lives in lib/pricing-viz.ts (tested); these are just styles.
   ════════════════════════════════════════════════════════════════════════════ */
.pnav-insights { display:flex; flex-direction:column; min-width:0; }
.pviz-stack { display:flex; flex-direction:column; gap:0.7rem; min-width:0; }

/* ── Card shell ── */
.pviz-card {
  display:flex; flex-direction:column; gap:10px;
  min-width:0;
  padding:14px;
  border-radius:10px;
  background:var(--bg-elevated);
  border:1px solid var(--border-subtle);
  box-shadow:none;
}
/* Booking pace uses the same calm shell as every other insight. */
.pviz-card--hero {
  background:var(--bg-elevated);
  border-color:var(--border-subtle);
  box-shadow:none;
}

/* ── Card header (eyebrow + takeaway + pill) ── */
.pviz-head { display:flex; flex-direction:column; gap:0.3rem; min-width:0; }
.pviz-head-titlerow { display:flex; align-items:center; justify-content:space-between; gap:0.5rem; min-width:0; }
.pviz-eyebrow {
  font-size:14px; font-weight:700;
  color:var(--text-primary); line-height:1.3;
}
.pviz-takeaway {
  margin:0; font-size:13px; line-height:1.5; color:var(--text-secondary);
}
.pviz-takeaway strong { color:var(--text-primary); font-weight:700; }

/* Delta / count pill (▲/▼ + magnitude). Up = success, down = warning — both
   theme-aware; the glyph carries direction so meaning never relies on colour. */
.pviz-pill {
  display:inline-flex; align-items:center; gap:0.2rem; flex-shrink:0;
  font-size:13px; font-weight:700; line-height:1.2;
  padding:2px 0;
  background:transparent; color:var(--text-secondary);
  border:0;
}
.pviz-pill--up,
.pviz-pill--down { color:var(--text-secondary); background:transparent; border:0; }

/* Scope chip (e.g. "2 bed") + market grade badge */
.pviz-scope {
  flex-shrink:0; font-size:13px; font-weight:650;
  color:var(--text-muted); padding:2px 0;
  background:transparent; border:0;
}

/* ── Generic SVG sizing — scale to the pane, never overflow ── */
.pviz-svg { display:block; width:100%; height:auto; }
.pviz-pace-svg { height:96px; color:var(--accent); } /* color → currentColor fill/stroke */
.pviz-hist-svg { height:88px; color:var(--accent); }
.pviz-spike-svg { height:96px; color:var(--accent); overflow:visible; }

/* ── Booking-pace curve ── */
.pviz-grid { stroke:var(--border-subtle); stroke-width:1; opacity:0.6; }
.pviz-pace-area { stroke:none; }
.pviz-pace-line { stroke:currentColor; stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.pviz-pace-baseline {
  stroke:var(--text-muted); stroke-width:1.4; stroke-dasharray:3 3; opacity:0.55;
}
.pviz-pace-dot { fill:currentColor; stroke:var(--bg-elevated); stroke-width:1.5; }

.pviz-pace-foot { display:flex; align-items:center; justify-content:space-between; gap:0.5rem; min-width:0; }
.pviz-pace-axis { display:flex; gap:0.8rem; min-width:0; overflow:hidden; }
.pviz-pace-axis-lbl { font-size:13px; font-weight:650; color:var(--text-muted); white-space:nowrap; }

/* Legend (shared by pace + comp-set) */
.pviz-legend { display:flex; align-items:center; gap:0.6rem; flex-wrap:wrap; justify-content:flex-end; }
.pviz-legend-item { display:inline-flex; align-items:center; gap:5px; font-size:13px; font-weight:600; color:var(--text-muted); white-space:nowrap; }
.pviz-legend-item .sp3-num { color:var(--text-primary); font-weight:700; }
.pviz-legend-swatch { width:14px; height:0; flex:0 0 auto; }
.pviz-legend-swatch--line { border-top:2px solid var(--accent); }
.pviz-legend-swatch--dash { border-top:1.4px dashed var(--text-muted); }
.pviz-legend-swatch--you { width:9px; height:9px; border-radius:50%; background:var(--accent); }
.pviz-legend-swatch--median { width:9px; height:9px; border-radius:0; border-left:2px dashed var(--text-soft); }

/* ── Comp-set price distribution (histogram) ── */
.pviz-hist-bar { fill:color-mix(in srgb, var(--accent) 28%, var(--surface-muted)); transition:fill var(--sp3-dur-2) var(--sp3-ease); }
.pviz-hist-bar.is-you { fill:var(--accent); }
.pviz-hist-median { stroke:var(--text-soft); stroke-width:1.4; stroke-dasharray:3 2.5; opacity:0.7; }
.pviz-hist-you-stem { stroke:var(--accent); stroke-width:1.4; opacity:0.5; }
.pviz-hist-you-dot { fill:var(--accent); stroke:var(--bg-elevated); stroke-width:1.5; }
.pviz-hist-foot { display:flex; align-items:center; justify-content:space-between; gap:0.5rem; min-width:0; }
.pviz-hist-axis-lbl { font-size:13px; font-weight:700; color:var(--text-muted); white-space:nowrap; flex-shrink:0; }
.pviz-hist-foot .pviz-legend { flex:1; }

/* ── Demand-spike timeline ── */
.pviz-spike-axis { stroke:var(--border-strong); stroke-width:1; }
.pviz-spike-stem { stroke:color-mix(in srgb, var(--state-warning) 60%, var(--accent)); stroke-width:2; stroke-linecap:round; opacity:0.85; }
.pviz-spike-dot { fill:color-mix(in srgb, var(--state-warning) 70%, var(--accent)); stroke:var(--bg-elevated); stroke-width:1.2; }
.pviz-spike-mark.is-top .pviz-spike-stem { stroke:color-mix(in srgb, var(--state-warning) 85%, var(--accent)); stroke-width:2.4; opacity:1; }
.pviz-spike-mark.is-top .pviz-spike-dot { fill:color-mix(in srgb, var(--state-warning) 88%, var(--accent)); }
.pviz-spike-date { fill:var(--text-muted); font-size:12px; font-weight:650; }
.pviz-spike-chips { display:flex; flex-wrap:wrap; gap:0.3rem; }
.pviz-spike-chip {
  display:inline-flex; align-items:center; gap:0.3rem; max-width:100%;
  padding:6px 8px; border-radius:8px;
  background:var(--surface-muted);
  border:1px solid var(--border-subtle);
}
.pviz-spike-chip-name { font-size:13px; font-weight:700; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.pviz-spike-chip-lift { font-size:13px; font-weight:800; color:var(--text-secondary); flex-shrink:0; }
.pviz-note { margin:4px 0 0; font-size:13px; line-height:1.45; color:var(--text-muted); }

/* ── Empty states (tasteful — never a broken chart) ── */
.pviz-empty {
  display:flex; flex-direction:column; align-items:center; gap:0.5rem;
  padding:1rem 0.75rem; text-align:center;
}
.pviz-empty-icon { color:var(--text-muted); opacity:0.65; }
.pviz-empty-txt { margin:0; font-size:13px; line-height:1.5; color:var(--text-muted); max-width:24rem; }

/* ── Loading skeletons (calm shimmer via the existing reduced-motion guard) ── */
.pviz-skel { border-radius:var(--sp3-radius-sm); background:linear-gradient(100deg, var(--surface-muted) 30%, color-mix(in srgb, var(--text-primary) 6%, var(--surface-muted)) 50%, var(--surface-muted) 70%); background-size:200% 100%; animation:pviz-shimmer 1.4s ease-in-out infinite; }
.pviz-skel--chart { height:96px; }
.pviz-skel--strip { height:84px; }
@keyframes pviz-shimmer { 0% { background-position:200% 0; } 100% { background-position:-200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .pviz-skel { animation:none; }
}

/* The Insights cards declare a container so the gauge stack query fires against
   the PANE width (the pane is user-resizable), not the viewport. */
.pnav-insights { container-type:inline-size; }

/* ── PDF export button ── */
.pnav-tabs-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.pnav-tabs-row .pnav-tabs { flex:1 1 220px; }
.pnav-pdf-btn { display:flex; align-items:center; gap:5px; min-height:36px; padding:7px 9px; font-size:13px; font-weight:700; border:1px solid var(--border-subtle); border-radius:7px; background:var(--bg-input); color:var(--text-muted); cursor:pointer; white-space:nowrap; transition:all 0.12s; flex-shrink:0; }
.pnav-pdf-btn:hover { border-color:color-mix(in srgb,var(--ring) 40%,var(--border-subtle)); color:var(--text-primary); }

/* ── Competition map legend (comp-set vs wider market) ──
   Overlaid on the bottom-left of MarketMap. Panel chrome uses theme tokens for
   light/dark parity; the dot colours are fixed hex so they match the on-tile
   circleMarkers exactly (and stay legible on the OSM layer in both themes). */
.mmap-legend {
  position:absolute; left:0.55rem; bottom:0.55rem; z-index:1000;
  display:flex; gap:0.7rem; align-items:center;
  padding:0.32rem 0.6rem; border-radius:8px;
  background:color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  border:1px solid var(--border-subtle); box-shadow:var(--shadow-soft);
  pointer-events:none;
}
.mmap-legend-item { display:inline-flex; align-items:center; gap:5px; font-size:13px; font-weight:600; color:var(--text-soft); white-space:nowrap; }
.mmap-legend-dot { width:9px; height:9px; border-radius:50%; flex:0 0 auto; }
.mmap-legend-dot--comp   { background:#6366f1; border:1.5px solid #4f46e5; }
.mmap-legend-dot--market { width:7px; height:7px; background:#94a3b8; border:1px solid #64748b; opacity:0.85; }

/* ── Map mode toggle (overlaid on map) ── */
.mmap-mode-toggle { position:absolute; top:0.55rem; left:0.55rem; z-index:1000; display:flex; border-radius:8px; overflow:hidden; border:1px solid rgba(255,255,255,0.3); box-shadow:0 2px 12px rgba(0,0,0,0.25); }
.mmap-mode-btn { min-height:36px; padding:7px 10px; font-size:13px; font-weight:700; border:none; background:rgba(15,23,42,0.82); backdrop-filter:blur(8px); color:rgba(255,255,255,0.65); cursor:pointer; transition:all 0.12s; white-space:nowrap; }
.mmap-mode-btn.is-on { background:rgba(79,70,229,0.9); color:#fff; }
.mmap-mode-btn:not(:last-child) { border-right:1px solid rgba(255,255,255,0.15); }

/* ── Leaflet popup tweaks ── */
.mmap-popup .leaflet-popup-content-wrapper { border-radius:10px; box-shadow:0 8px 32px rgba(0,0,0,0.35); padding:0; overflow:hidden; }
.mmap-popup .leaflet-popup-content { margin:0.6rem 0.75rem; }
.mmap-tooltip.leaflet-tooltip { font-size:13px; font-weight:700; background:rgba(15,23,42,0.88); color:#e0e7ff; border:none; border-radius:6px; padding:4px 8px; box-shadow:0 2px 8px rgba(0,0,0,0.3); }
.mmap-tooltip.leaflet-tooltip::before { border-bottom-color:rgba(15,23,42,0.88); }

/* ── City combobox ── */
.sp-city-combo { position:relative; }
.sp-city-opt { padding:0.48rem 0.75rem; cursor:pointer; font-size:0.84rem; color:var(--text-primary); border-bottom:1px solid color-mix(in srgb,var(--border-subtle) 50%,transparent); }
.sp-city-opt:last-child { border-bottom:none; }
.sp-city-opt:hover,.sp-city-opt.is-sel { background:color-mix(in srgb,var(--ring) 10%,var(--bg-elevated)); }
.sp-city-opt--auto { color:var(--text-soft); font-size:0.8rem; }

/* ── Anomaly cards ── */
.sp-anomalies { display:flex; flex-direction:column; gap:0.45rem; margin-bottom:1rem; }
.sp-anomaly { display:flex; flex-direction:column; gap:0.3rem; padding:0.6rem 0.8rem; border-radius:var(--radius-md); border:1px solid var(--border-subtle); background:var(--bg-elevated); transition:border-color 0.15s; }
.sp-anomaly:hover { border-color:color-mix(in srgb,var(--ring) 22%,var(--border-subtle)); }
.sp-anomaly-head { display:flex; align-items:center; gap:0.55rem; }
.sp-anomaly-dot { width:0.55rem; height:0.55rem; border-radius:50%; flex-shrink:0; }
.sp-anomaly-title { font-size:0.85rem; font-weight:700; color:var(--text-primary); }
.sp-anomaly-detail { margin:0 0 0 1.05rem; font-size:0.78rem; color:var(--text-soft); line-height:1.5; }
.sp-anomaly--info  { background:color-mix(in srgb,#5096ff 6%,var(--bg-elevated));  border-color:color-mix(in srgb,#5096ff 25%,var(--border-subtle)); }
.sp-anomaly--warn  { background:color-mix(in srgb,var(--state-warning) 8%,var(--bg-elevated));  border-color:color-mix(in srgb,var(--state-warning) 30%,var(--border-subtle)); }
.sp-anomaly--error { background:color-mix(in srgb,var(--state-error)   8%,var(--bg-elevated));  border-color:color-mix(in srgb,var(--state-error) 30%,var(--border-subtle)); }
.sp-anomaly--info  .sp-anomaly-dot { background:#5096ff; }
.sp-anomaly--warn  .sp-anomaly-dot { background:var(--state-warning); }
.sp-anomaly--error .sp-anomaly-dot { background:var(--state-error); }

/* ── Revenue Impact card ── */
.sp-revimpact { margin-top:1.75rem; margin-bottom:1rem; }
.sp-revimpact-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:0.5rem; }
.sp-revimpact-title { margin:0; }
.sp-revimpact-sub { margin:0; }
.sp-revimpact-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; margin:0.85rem 0 0.85rem; }
@media (max-width:640px) { .sp-revimpact-stats { grid-template-columns:1fr; gap:0.6rem; }}
.sp-revimpact-stat-lbl { font-size:0.66rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; }
.sp-revimpact-stat-val { font-size:1.5rem; font-weight:800; line-height:1.15; margin-top:0.15rem; font-variant-numeric:tabular-nums; }
.sp-revimpact-stat-val--total { font-size:1.7rem; }
.sp-revimpact-stat-val--up   { color:var(--state-success); }
.sp-revimpact-stat-val--down { color:var(--state-error); }
.sp-revimpact-stat-val--neutral { color:var(--text-primary); }
.sp-revimpact-stat-meta { font-size:0.72rem; color:var(--text-muted); margin-top:0.1rem; }
.sp-revimpact-factors { margin-top:0.4rem; }
.sp-revimpact-factors-lbl { font-size:0.7rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; margin-bottom:0.45rem; }
.sp-revimpact-factor-list { display:flex; flex-direction:column; gap:0.3rem; }
.sp-revimpact-factor-row { display:grid; grid-template-columns:9rem 1fr 5.5rem; align-items:center; gap:0.6rem; font-size:0.79rem; }
@media (max-width:640px) { .sp-revimpact-factor-row { grid-template-columns:7rem 1fr 4.5rem; gap:0.4rem; font-size:0.74rem; }}
.sp-revimpact-factor-name { color:var(--text-soft); }
.sp-revimpact-factor-bar { height:10px; background:var(--surface-muted); border-radius:5px; position:relative; overflow:hidden; border:1px solid var(--border-subtle); }
.sp-revimpact-factor-bar::before { content:""; position:absolute; top:0; bottom:0; left:50%; width:1px; background:var(--border-strong); opacity:0.5; }
.sp-revimpact-factor-bar-fill { position:absolute; top:0; bottom:0; transition:width 0.18s; }
.sp-revimpact-factor-bar-fill--up   { background:color-mix(in srgb,var(--state-success) 60%,transparent); left:50%; }
.sp-revimpact-factor-bar-fill--down { background:color-mix(in srgb,var(--state-error)   60%,transparent); right:50%; }
.sp-revimpact-factor-val { text-align:right; font-variant-numeric:tabular-nums; font-weight:600; }
.sp-revimpact-factor-val--up   { color:var(--state-success); }
.sp-revimpact-factor-val--down { color:var(--state-error); }
.sp-revimpact-foot { margin-top:0.7rem !important; font-size:0.74rem !important; }

/* ── Occupancy tab — Overview ─────────────────────────────────────────────── */
.properties-occ-subtabs { display:inline-flex; padding:0.18rem; border-radius:8px; background:var(--surface-muted); border:1px solid var(--border-subtle); gap:0; margin-bottom:1rem; }
.properties-occ-subtab { padding:0.42rem 1rem; font-size:0.8rem; font-weight:700; color:var(--text-muted); background:transparent; border:none; border-radius:6px; cursor:pointer; transition:all 0.15s; display:inline-flex; align-items:center; gap:0.45rem; }
.properties-occ-subtab:hover { color:var(--text-primary); }
.properties-occ-subtab.is-on { background:var(--bg-elevated); color:var(--text-primary); box-shadow:0 1px 2px rgba(0,0,0,0.2); }
.properties-occ-subtab-count { font-size:0.66rem; font-weight:700; padding:0.06rem 0.4rem; border-radius:999px; background:var(--surface-muted); color:var(--text-muted); }
.properties-occ-subtab.is-on .properties-occ-subtab-count { background:color-mix(in srgb,var(--ring) 22%,transparent); color:var(--text-primary); }

.properties-occupancy { display:flex; flex-direction:column; gap:1rem; }
.properties-occupancy-loading { padding:2rem 1rem; text-align:center; color:var(--text-muted); font-size:0.85rem; }

/* Period selector strip */
.properties-occ-period { display:flex; align-items:flex-end; gap:1rem; padding:0.85rem 1rem; border-radius:var(--radius-md); border:1px solid var(--border-subtle); background:var(--bg-elevated); flex-wrap:wrap; }
.properties-occ-period-block { display:flex; flex-direction:column; gap:0.3rem; min-width:0; }
.properties-occ-period-lbl { font-size:0.66rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); }
.properties-occ-period-controls { display:flex; align-items:center; gap:0.45rem; flex-wrap:wrap; }
.properties-occ-period-controls .sp-input { font-size:0.8rem; padding:0.32rem 0.5rem; min-width:9rem; }
.properties-occ-period-controls input[type="month"].sp-input,
.properties-occ-period-controls input[type="date"].sp-input { min-width:8.5rem; }
.properties-occ-period-controls input[type="number"].sp-input { min-width:5rem; }
.properties-occ-period-arrow { color:var(--text-muted); font-size:0.85rem; }
.properties-occ-period-summary { display:flex; flex-direction:column; gap:0.18rem; margin-left:auto; align-items:flex-end; min-width:0; }
.properties-occ-period-range { font-size:0.84rem; font-weight:700; color:var(--text-primary); font-variant-numeric:tabular-nums; }
.properties-occ-period-cmp { font-size:0.72rem; color:var(--text-muted); font-variant-numeric:tabular-nums; }
@media (max-width:720px) {
  .properties-occ-period-summary { margin-left:0; align-items:flex-start; width:100%; }}

/* KPI delta badge */
.properties-occ-kpi-delta { display:inline-flex; align-items:center; padding:0.08rem 0.45rem; margin-left:0.55rem; border-radius:999px; font-size:0.7rem; font-weight:800; letter-spacing:0.02em; font-variant-numeric:tabular-nums; vertical-align:middle; }
.properties-occ-kpi-delta--up   { background:color-mix(in srgb,var(--state-success) 18%,transparent); color:var(--state-success); }
.properties-occ-kpi-delta--down { background:color-mix(in srgb,var(--state-error) 18%,transparent);   color:var(--state-error); }
.properties-occ-kpi-delta--flat { background:var(--surface-muted); color:var(--text-muted); }
.properties-occ-kpi-delta--up::before   { content:"↑ "; }
.properties-occ-kpi-delta--down::before { content:"↓ "; }
.properties-occ-kpi-unit { font-size:0.85rem; font-weight:600; color:var(--text-muted); }

/* KPI comparison block */
.properties-occ-kpi-cmp { margin-top:0.7rem; padding-top:0.55rem; border-top:1px dashed color-mix(in srgb,var(--border-subtle) 80%,transparent); display:flex; flex-direction:column; gap:0.18rem; }
.properties-occ-kpi-cmp-head { display:flex; align-items:baseline; justify-content:space-between; gap:0.5rem; flex-wrap:wrap; }
.properties-occ-kpi-cmp-type { font-size:0.62rem; font-weight:800; text-transform:uppercase; letter-spacing:0.07em; color:var(--text-muted); }
.properties-occ-kpi-cmp-range { font-size:0.66rem; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.properties-occ-kpi-cmp-body { display:flex; align-items:baseline; gap:0.5rem; flex-wrap:wrap; }
.properties-occ-kpi-cmp-val { font-size:1rem; font-weight:700; color:var(--text-soft); font-variant-numeric:tabular-nums; }
.properties-occ-kpi-cmp-unit { font-size:0.72rem; font-weight:500; color:var(--text-muted); }
.properties-occ-kpi-cmp-meta { font-size:0.7rem; color:var(--text-muted); }

/* KPI card itself — give it a touch more breathing room with the comparison block */
.properties-occ-kpi { padding:0.95rem 1.05rem; }

/* KPI strip */
.properties-occ-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0.85rem; }
@media (max-width:840px) { .properties-occ-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }}
@media (max-width:480px) { .properties-occ-kpis { grid-template-columns:1fr; }}
.properties-occ-kpi { display:flex; flex-direction:column; gap:0.18rem; padding:0.85rem 1rem; border-radius:var(--radius-md); border:1px solid var(--border-subtle); background:var(--bg-elevated); }
.properties-occ-kpi-lbl { font-size:0.66rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); }
.properties-occ-kpi-val { font-size:1.6rem; font-weight:800; line-height:1.1; color:var(--text-primary); font-variant-numeric:tabular-nums; }
.properties-occ-kpi-meta { font-size:0.72rem; color:var(--text-muted); }

/* Card containers */
.properties-occ-card { padding:1rem 1.1rem; border-radius:var(--radius-md); border:1px solid var(--border-subtle); background:var(--bg-elevated); }
.properties-occ-card-head { display:flex; align-items:baseline; justify-content:space-between; gap:0.5rem; flex-wrap:wrap; margin-bottom:0.7rem; }
.properties-occ-card-h { font-size:0.95rem; font-weight:700; margin:0; color:var(--text-primary); }
.properties-occ-card-sub { font-size:0.72rem; color:var(--text-muted); }
.properties-occ-empty { font-size:0.78rem; color:var(--text-muted); margin:0; padding:0.7rem 0; }

/* Heatmap */
.properties-occ-heatmap-wrap { overflow-x:auto; }
.properties-occ-heatmap-months { display:grid; grid-template-columns:repeat(52,minmax(11px,1fr)); gap:2px; font-size:0.62rem; color:var(--text-muted); height:1.1rem; margin-bottom:0.25rem; }
.properties-occ-heatmap-month { font-weight:600; }
.properties-occ-heatmap { display:grid; grid-template-columns:repeat(52,minmax(11px,1fr)); gap:2px; }
.properties-occ-heatmap-week { display:grid; grid-template-rows:repeat(7,1fr); gap:2px; }
.properties-occ-heatmap-cell { display:block; aspect-ratio:1/1; border-radius:2px; cursor:default; transition:transform 0.1s, box-shadow 0.1s; }
.properties-occ-heatmap-cell:hover { transform:scale(1.4); z-index:2; box-shadow:0 0 0 1px var(--ring); }
.properties-occ-heatmap-cell--empty  { background:color-mix(in srgb,var(--state-error) 16%,var(--bg-input)); }
.properties-occ-heatmap-cell--booked { background:var(--state-success); }
.properties-occ-heatmap-cell--blocked{ background:var(--text-muted); }
.properties-occ-heatmap-cell--future { background:color-mix(in srgb,var(--text-muted) 20%,var(--bg-input)); }

.properties-occ-heatmap-foot { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-top:0.6rem; flex-wrap:wrap; }
.properties-occ-heatmap-hover { font-size:0.78rem; color:var(--text-soft); display:flex; align-items:center; gap:0.55rem; min-height:1.4rem; }
.properties-occ-heatmap-hover strong { color:var(--text-primary); font-weight:700; }
.properties-occ-heatmap-hint { color:var(--text-muted); font-size:0.74rem; }
.properties-occ-heatmap-tag { font-size:0.66rem; font-weight:800; text-transform:uppercase; letter-spacing:0.06em; padding:0.1rem 0.45rem; border-radius:4px; }
.properties-occ-heatmap-tag--booked  { background:color-mix(in srgb,var(--state-success) 22%,transparent); color:var(--state-success); }
.properties-occ-heatmap-tag--empty   { background:color-mix(in srgb,var(--state-error)   22%,transparent); color:var(--state-error); }
.properties-occ-heatmap-tag--future  { background:color-mix(in srgb,var(--text-muted)    24%,transparent); color:var(--text-soft); }
.properties-occ-heatmap-tag--blocked { background:color-mix(in srgb,var(--text-muted)    32%,transparent); color:var(--text-primary); }
.properties-occ-heatmap-legend { display:flex; gap:0.85rem; font-size:0.7rem; color:var(--text-muted); flex-wrap:wrap; }
.properties-occ-heatmap-legend-item { display:inline-flex; align-items:center; gap:0.3rem; }
.properties-occ-heatmap-legend-item .properties-occ-heatmap-cell { width:0.7rem; height:0.7rem; aspect-ratio:1/1; cursor:default; }
.properties-occ-heatmap-legend-item .properties-occ-heatmap-cell:hover { transform:none; box-shadow:none; }

/* Distribution grid */
.properties-occ-row { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; }
@media (max-width:1024px) { .properties-occ-row { grid-template-columns:repeat(2,minmax(0,1fr)); }}
@media (max-width:640px) { .properties-occ-row { grid-template-columns:1fr; }}

.properties-occ-bars { display:flex; flex-direction:column; gap:0.4rem; }
.properties-occ-bar-row { display:grid; grid-template-columns:6.5rem 1fr 5rem; align-items:center; gap:0.55rem; font-size:0.78rem; }
.properties-occ-bar-lbl { color:var(--text-soft); }
.properties-occ-bar-track { height:8px; background:var(--surface-muted); border-radius:4px; border:1px solid var(--border-subtle); overflow:hidden; }
.properties-occ-bar-fill { height:100%; background:color-mix(in srgb,var(--ring) 60%,transparent); border-radius:3px; transition:width 0.18s; }
.properties-occ-bar-fill--alt { background:color-mix(in srgb,var(--state-success) 50%,transparent); }
.properties-occ-bar-val { text-align:right; color:var(--text-primary); font-variant-numeric:tabular-nums; font-weight:600; }
.properties-occ-bar-pct { color:var(--text-muted); font-weight:500; }

/* Channel mix */
.properties-occ-channel-stack { display:flex; height:14px; border-radius:4px; overflow:hidden; border:1px solid var(--border-subtle); margin-bottom:0.7rem; }
.properties-occ-channel-seg { height:100%; transition:opacity 0.12s; }
.properties-occ-channel-seg:hover { opacity:0.85; }
.properties-occ-channel-seg--airbnb         { background:#ff5a5f; }
.properties-occ-channel-seg--bookingcom,
.properties-occ-channel-seg--booking        { background:#003580; }
.properties-occ-channel-seg--vrbo,
.properties-occ-channel-seg--homeaway       { background:#0066cc; }
.properties-occ-channel-seg--direct         { background:#7c3aed; }
.properties-occ-channel-seg--expedia        { background:#fdba2c; }

.properties-occ-channel-list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:0.3rem; font-size:0.78rem; }
.properties-occ-channel-list li { display:grid; grid-template-columns:0.7rem 1fr auto; align-items:center; gap:0.5rem; }
.properties-occ-channel-dot { width:0.7rem; height:0.7rem; border-radius:50%; background:var(--text-muted); display:inline-block; }
.properties-occ-channel-dot--airbnb        { background:#ff5a5f; }
.properties-occ-channel-dot--bookingcom,
.properties-occ-channel-dot--booking       { background:#003580; }
.properties-occ-channel-dot--vrbo,
.properties-occ-channel-dot--homeaway      { background:#0066cc; }
.properties-occ-channel-dot--direct        { background:#7c3aed; }
.properties-occ-channel-dot--expedia       { background:#fdba2c; }
.properties-occ-channel-name { text-transform:capitalize; color:var(--text-soft); }
.properties-occ-channel-count { color:var(--text-primary); font-variant-numeric:tabular-nums; font-weight:600; }

/* ── Long-Let Position card ── */
.sp-llp { margin-bottom:1rem; }
.sp-llp-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:0.5rem; }
.sp-llp-title { margin:0; }
.sp-llp-sub { margin:0; }
.sp-llp-empty { color:var(--text-soft); font-size:0.85rem; line-height:1.55; margin:0.6rem 0 0; }

.sp-llp-headline { display:flex; align-items:baseline; gap:1.25rem; flex-wrap:wrap; margin:0.85rem 0 0.6rem; padding:0.85rem 1rem; border-radius:var(--radius-md); background:linear-gradient(135deg, color-mix(in srgb,var(--ring) 8%,var(--bg-elevated)), color-mix(in srgb,var(--accent) 6%,var(--bg-elevated))); border:1px solid color-mix(in srgb,var(--ring) 22%,var(--border-subtle)); }
.sp-llp-headline-main { display:flex; align-items:baseline; gap:0.4rem; flex-shrink:0; }
.sp-llp-num { font-size:2rem; font-weight:800; color:var(--text-primary); line-height:1; font-variant-numeric:tabular-nums; }
.sp-llp-num-lbl { font-size:0.78rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; }
.sp-llp-range { font-size:0.78rem; color:var(--text-soft); font-variant-numeric:tabular-nums; }
.sp-llp-range strong { color:var(--text-primary); }

.sp-llp-asking { margin-top:0.85rem; padding-top:0.85rem; border-top:1px solid var(--border-subtle); }
.sp-llp-asking-label { font-size:0.69rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; display:block; margin-bottom:0.35rem; }
.sp-llp-asking-row { display:flex; align-items:center; gap:0.65rem; flex-wrap:wrap; }
.sp-llp-asking-help { margin:0.4rem 0 0; font-size:0.74rem; color:var(--text-muted); }
.sp-llp-position { padding:0.32rem 0.7rem; border-radius:999px; font-size:0.78rem; font-weight:700; }
.sp-llp-position--match { background:color-mix(in srgb,var(--state-success) 16%,transparent); color:var(--state-success); }
.sp-llp-position--below { background:color-mix(in srgb,var(--state-warning) 18%,transparent); color:var(--state-warning); }
.sp-llp-position--above { background:color-mix(in srgb,var(--state-error)   16%,transparent); color:var(--state-error); }
.sp-llp-position-hint { font-weight:500; opacity:0.85; }

.sp-llp-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; margin-top:0.85rem; }
@media (max-width:840px) { .sp-llp-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }}
@media (max-width:480px) { .sp-llp-stats { grid-template-columns:1fr; }}
.sp-llp-stat-lbl { font-size:0.66rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; }
.sp-llp-stat-val { font-size:1.3rem; font-weight:700; line-height:1.15; margin-top:0.15rem; font-variant-numeric:tabular-nums; }
.sp-llp-stat-unit { font-size:0.72rem; font-weight:500; color:var(--text-muted); }
.sp-llp-stat-meta { font-size:0.7rem; color:var(--text-muted); margin-top:0.1rem; }

.sp-llp-comps { margin-top:1rem; }
.sp-llp-comps-lbl { font-size:0.7rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; margin-bottom:0.5rem; }
.sp-llp-comps-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:0.6rem; }
.sp-llp-comp { display:flex; flex-direction:column; gap:0.25rem; padding:0.65rem 0.8rem; border-radius:var(--radius-md); border:1px solid var(--border-subtle); background:var(--bg-elevated); text-decoration:none; color:var(--text-primary); transition:all 0.15s; }
.sp-llp-comp:hover { border-color:color-mix(in srgb,var(--ring) 40%,var(--border-subtle)); transform:translateY(-1px); }
.sp-llp-comp-head { display:flex; align-items:center; justify-content:space-between; gap:0.5rem; }
.sp-llp-comp-source { font-size:0.6rem; font-weight:800; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-muted); padding:0.1rem 0.4rem; border-radius:4px; background:var(--surface-muted); }
.sp-llp-comp--rightmove .sp-llp-comp-source { background:color-mix(in srgb,var(--brand-rightmove) 22%,transparent); color:var(--brand-rightmove); }
.sp-llp-comp--zoopla .sp-llp-comp-source { background:color-mix(in srgb,var(--brand-zoopla) 22%,transparent); color:var(--brand-zoopla); }
.sp-llp-comp-rent { font-size:0.85rem; font-weight:700; font-variant-numeric:tabular-nums; }
.sp-llp-comp-title { font-size:0.78rem; line-height:1.35; }
.sp-llp-comp-addr { font-size:0.72rem; color:var(--text-muted); }

.sp-llp-foot { margin-top:0.8rem !important; font-size:0.74rem !important; }

/* ─────────────────────────────────────────────────────────────────────────────
   LONG-LET PRICING ENGINE CARD (llp2) — the single monthly-rent surface:
   evidence state, recommendation or honest hold, levers and actions.

   THEME PARITY (CLAUDE.md #5): every colour below is a theme token (the
   var(--text), var(--bg), var(--surface), var(--border), var(--ring),
   var(--state), var(--accent) and var(--sp3) families) so it works in light and
   dark. The only literal colours are the portal brand tints on the comp chips
   (rightmove teal and zoopla purple), matching the established pattern in the
   sibling sp-llp-comp rules.
   ───────────────────────────────────────────────────────────────────────────── */
.llp2 { margin-bottom:1rem; }
.llp2-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.llp2-head-titles { display:flex; flex-direction:column; gap:0.15rem; min-width:0; }
.llp2-title { margin:0; }
.llp2-sub { margin:0; }
.llp2-enable { display:flex; align-items:center; gap:0.5rem; flex-shrink:0; }
.llp2-enable-lbl { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); }

.llp2-canonical {
  display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap;
  margin-top:0.85rem; padding:0.85rem 1rem; border:1px solid color-mix(in srgb,var(--state-success) 28%,var(--border-subtle));
  border-radius:var(--radius-md); background:color-mix(in srgb,var(--state-success) 6%,var(--bg-elevated));
}
.llp2-canonical.is-missing {
  border-color:color-mix(in srgb,var(--state-warning) 36%,var(--border-subtle));
  background:color-mix(in srgb,var(--state-warning) 7%,var(--bg-elevated));
}
.llp2-canonical-copy { display:flex; flex:1 1 22rem; flex-direction:column; gap:0.16rem; min-width:0; }
.llp2-canonical-kicker { color:var(--text-muted); font-size:0.65rem; font-weight:800; letter-spacing:0.07em; text-transform:uppercase; }
.llp2-canonical-copy strong { color:var(--text-primary); font-size:0.88rem; }
.llp2-canonical-copy small { color:var(--text-soft); font-size:0.75rem; line-height:1.45; }
.llp2-canonical-control { display:grid; flex:0 1 25rem; grid-template-columns:minmax(10rem,1fr) auto; align-items:end; gap:0.4rem 0.65rem; min-width:min(100%,20rem); }
.llp2-canonical-control > label { grid-column:1 / -1; color:var(--text-soft); font-size:0.7rem; font-weight:750; }
.llp2-rent-input-row {
  display:grid; grid-template-columns:auto minmax(5rem,1fr) auto; align-items:center; gap:0.35rem; min-height:2.45rem;
  padding:0 0.7rem; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-base);
  color:var(--text-muted); font-size:0.75rem;
}
.llp2-rent-input-row:focus-within { border-color:color-mix(in srgb,var(--accent) 62%,var(--border-subtle)); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 10%,transparent); }
.llp2-rent-input-row input { width:100%; min-width:0; border:0; outline:0; color:var(--text-primary); background:transparent; font:inherit; font-size:0.92rem; font-weight:750; font-variant-numeric:tabular-nums; }
.llp2-rent-save-btn { min-height:2.45rem; white-space:nowrap; }
.llp2-canonical-load-error { display:flex; align-items:center; gap:0.65rem; color:var(--state-danger); font-size:0.78rem; }
.llp2-canonical-loading { color:var(--text-muted); font-size:0.78rem; }
@media (max-width:640px) {
  .llp2-canonical-control { grid-template-columns:1fr; width:100%; }
  .llp2-canonical-control > label { grid-column:auto; }
  .llp2-rent-save-btn { width:100%; }
}

.llp2-empty { color:var(--text-soft); font-size:0.85rem; line-height:1.55; margin:0.85rem 0 0; }
.llp2-empty-base { margin-top:0.75rem; max-width:16rem; }

/* Recommendation headline — same elevated tinted panel language as sp-llp-headline. */
.llp2-headline {
  display:flex; align-items:baseline; gap:1.25rem; flex-wrap:wrap;
  margin:0.85rem 0 0.6rem; padding:0.85rem 1rem;
  border-radius:var(--radius-md);
  background:linear-gradient(135deg, color-mix(in srgb,var(--ring) 8%,var(--bg-elevated)), color-mix(in srgb,var(--accent) 6%,var(--bg-elevated)));
  border:1px solid color-mix(in srgb,var(--ring) 22%,var(--border-subtle));
}
.llp2-headline-main { display:flex; align-items:baseline; gap:0.4rem; flex-shrink:0; }
.llp2-num { font-size:2rem; font-weight:800; color:var(--text-primary); line-height:1; font-variant-numeric:tabular-nums; }
.llp2-num-lbl { font-size:0.78rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; }
.llp2-range { font-size:0.78rem; color:var(--text-soft); font-variant-numeric:tabular-nums; }
.llp2-range strong { color:var(--text-primary); }
.llp2-vsmkt { font-size:0.78rem; color:var(--text-soft); font-variant-numeric:tabular-nums; }
.llp2-vsmkt strong { color:var(--text-primary); }
.llp2-decision {
  margin:0.5rem 0; padding:0.65rem 0.8rem; border-radius:var(--radius-md);
  font-size:0.8rem; line-height:1.45; border:1px solid var(--border-subtle);
}
.llp2-decision.is-actionable {
  color:color-mix(in srgb,var(--state-success) 78%,var(--text-primary));
  background:color-mix(in srgb,var(--state-success) 7%,var(--bg-elevated));
  border-color:color-mix(in srgb,var(--state-success) 28%,var(--border-subtle));
}
.llp2-decision.is-held {
  color:color-mix(in srgb,var(--state-warning) 82%,var(--text-primary));
  background:color-mix(in srgb,var(--state-warning) 7%,var(--bg-elevated));
  border-color:color-mix(in srgb,var(--state-warning) 30%,var(--border-subtle));
}

.llp2-factors { display:flex; flex-wrap:wrap; gap:0.4rem; margin:0.5rem 0; }
.llp2-factor {
  font-size:0.72rem; font-weight:600;
  padding:0.22rem 0.55rem; border-radius:999px;
  background:color-mix(in srgb,var(--accent) 14%,transparent);
  color:var(--accent);
}

.llp2-annual {
  display:flex; align-items:baseline; gap:0.6rem; flex-wrap:wrap;
  margin-top:0.5rem; padding:0.6rem 0.8rem;
  border-radius:var(--radius-md); background:var(--surface-muted);
  border:1px solid var(--border-subtle);
}
.llp2-annual-lbl { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); }
.llp2-annual-val { font-size:1.15rem; font-weight:800; color:var(--text-primary); font-variant-numeric:tabular-nums; }
.llp2-annual-meta { font-size:0.72rem; color:var(--text-muted); }

/* Levers */
.llp2-levers { margin-top:0.95rem; padding-top:0.85rem; border-top:1px solid var(--border-subtle); display:flex; flex-direction:column; gap:0.85rem; }
.llp2-pos-row { display:flex; align-items:center; gap:0.75rem; }
.llp2-range-input { flex:1 1 auto; min-width:0; accent-color:var(--accent); cursor:pointer; }
.llp2-pos-val { flex:0 0 auto; min-width:3.2rem; text-align:right; font-weight:700; font-variant-numeric:tabular-nums; color:var(--text-primary); }
.llp2-guardrails { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
@media (max-width:480px) { .llp2-guardrails { grid-template-columns:1fr; } }

.llp2-expert { margin-top:0.15rem; }
.llp2-evidence-grid {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0.55rem;
  margin-bottom:0.75rem;
}
.llp2-evidence-grid > div {
  display:flex; flex-direction:column; gap:0.15rem; padding:0.55rem 0.65rem;
  background:var(--surface-muted); border:1px solid var(--border-subtle); border-radius:var(--radius-sm);
}
.llp2-evidence-grid span { color:var(--text-muted); font-size:0.65rem; text-transform:uppercase; letter-spacing:0.05em; }
.llp2-evidence-grid strong { color:var(--text-primary); font-size:1rem; font-variant-numeric:tabular-nums; }
.llp2-trace { display:flex; flex-direction:column; gap:0; list-style:none; margin:0; padding:0; }
.llp2-trace li {
  display:grid; grid-template-columns:4.5rem minmax(0,1fr) auto; align-items:start; gap:0.65rem;
  padding:0.55rem 0; border-bottom:1px solid var(--border-subtle); font-size:0.76rem;
}
.llp2-trace li:last-child { border-bottom:0; }
.llp2-trace li > span:nth-child(2) { display:flex; flex-direction:column; gap:0.12rem; }
.llp2-trace li small { color:var(--text-muted); line-height:1.35; }
.llp2-trace li b { color:var(--text-primary); font-variant-numeric:tabular-nums; }
.llp2-trace-status {
  width:max-content; padding:0.12rem 0.35rem; border-radius:999px; color:var(--text-muted);
  background:var(--surface-muted); font-size:0.58rem; font-weight:800; text-transform:uppercase;
}
.llp2-trace-status.is-applied { color:var(--state-success); background:color-mix(in srgb,var(--state-success) 11%,transparent); }
.llp2-trace-status.is-context { color:var(--state-warning); background:color-mix(in srgb,var(--state-warning) 11%,transparent); }
.llp2-manual-base { max-width:16rem; margin-top:0.8rem; padding-top:0.8rem; border-top:1px dashed var(--border-subtle); }
@media (max-width:640px) {
  .llp2-evidence-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .llp2-trace li { grid-template-columns:4rem minmax(0,1fr); }
  .llp2-trace li b { grid-column:2; }
}

/* Comp strip — same chip language as sp-llp-comp. */
.llp2-comps { margin-top:1rem; }
.llp2-comps-lbl { font-size:0.7rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; margin-bottom:0.5rem; }
.llp2-comps-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:0.6rem; }
.llp2-comp { display:flex; flex-direction:column; gap:0.25rem; padding:0.65rem 0.8rem; border-radius:var(--radius-md); border:1px solid var(--border-subtle); background:var(--bg-elevated); text-decoration:none; color:var(--text-primary); transition:border-color 0.15s, transform 0.15s; }
.llp2-comp:hover { border-color:color-mix(in srgb,var(--ring) 40%,var(--border-subtle)); transform:translateY(-1px); }
.llp2-comp-head { display:flex; align-items:center; justify-content:space-between; gap:0.5rem; }
.llp2-comp-source { font-size:0.6rem; font-weight:800; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-muted); padding:0.1rem 0.4rem; border-radius:4px; background:var(--surface-muted); }
.llp2-comp--rightmove .llp2-comp-source { background:color-mix(in srgb,#00b0a0 22%,transparent); color:#00b0a0; }
.llp2-comp--zoopla .llp2-comp-source { background:color-mix(in srgb,#8000ff 22%,transparent); color:#9b3aff; }
.llp2-comp-rent { font-size:0.85rem; font-weight:700; font-variant-numeric:tabular-nums; }
.llp2-comp-title { font-size:0.78rem; line-height:1.35; }
.llp2-comp-addr { font-size:0.72rem; color:var(--text-muted); }

/* Footer actions */
.llp2-actions { display:flex; align-items:center; justify-content:space-between; gap:0.85rem; flex-wrap:wrap; margin-top:1rem; padding-top:0.85rem; border-top:1px solid var(--border-subtle); }
.llp2-actions-left { min-width:0; }
.llp2-actions-right { display:flex; align-items:center; gap:0.6rem; flex-wrap:wrap; }
.llp2-advertised { font-size:0.8rem; color:var(--text-soft); }
.llp2-advertised strong { color:var(--text-primary); font-variant-numeric:tabular-nums; }
.llp2-foot { margin-top:0.8rem; font-size:0.74rem; line-height:1.5; }

/* ── Sidebar recommended-rent block (llp2-side-*) ──
   The compact read-only mirror rendered in the Preview pane for long mode. */
.llp2-side { display:flex; flex-direction:column; gap:0.7rem; }
.llp2-side-empty { color:var(--text-soft); font-size:0.84rem; line-height:1.55; margin:0; }
.llp2-side-headline { display:flex; align-items:baseline; gap:0.45rem; flex-wrap:wrap; }
.llp2-side-num { font-size:1.7rem; font-weight:800; color:var(--text-primary); line-height:1; font-variant-numeric:tabular-nums; }
.llp2-side-lbl { font-size:0.74rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; }
.llp2-side-range { font-size:0.8rem; color:var(--text-soft); font-variant-numeric:tabular-nums; }
.llp2-side-factors { margin:0; }
.llp2-side-annual {
  display:flex; align-items:baseline; justify-content:space-between; gap:0.6rem;
  padding:0.55rem 0.75rem; border-radius:var(--radius-md);
  background:var(--surface-muted); border:1px solid var(--border-subtle);
}
.llp2-side-annual-lbl { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted); }
.llp2-side-annual-val { font-size:1.05rem; font-weight:800; color:var(--text-primary); font-variant-numeric:tabular-nums; }
.llp2-side-comps { display:flex; flex-direction:column; gap:0.4rem; }
.llp2-side-comps-lbl { font-size:0.68rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; }
.llp2-side-comp {
  display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:0.5rem;
  padding:0.4rem 0.6rem; border-radius:var(--radius-md);
  border:1px solid var(--border-subtle); background:var(--bg-elevated);
  text-decoration:none; color:var(--text-primary); transition:border-color 0.15s;
}
.llp2-side-comp:hover { border-color:color-mix(in srgb,var(--ring) 40%,var(--border-subtle)); }
.llp2-side-comp-src { font-size:0.56rem; font-weight:800; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); }
.llp2-side-comp-title { font-size:0.74rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.llp2-side-comp-rent { font-size:0.8rem; font-weight:700; font-variant-numeric:tabular-nums; }
.llp2-side-foot { font-size:0.72rem; color:var(--text-muted); margin:0; line-height:1.5; }

/* ── Rental-mode toggle ──────────────────────────────────────────────
   Stacked layout: label on top, full-width segmented control below,
   optional help line at the bottom. Matches the Optimise-for treatment
   in the Strategy card and the top tab chrome so all three switchers
   read as siblings — same minimalist track, same flex:1 buttons that
   grow / shrink with the container. */
.sp-rentalmode {
  display:flex;
  flex-direction:column;
  gap:0.45rem;
  padding:0.55rem 0.75rem;
  border-radius:var(--radius-md);
  background:var(--bg-elevated);
  border:1px solid var(--border-subtle);
  margin-bottom:1rem;
}
.sp-rentalmode-lbl { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); }
.sp-rentalmode-pills { display:inline-flex; padding:0.18rem; border-radius:8px; background:var(--surface-muted); border:1px solid var(--border-subtle); }

/* ── Shared segmented control ──────────────────────────────────────────────
   One canonical visual treatment for mutually-exclusive pill groups, used
   anywhere a small handful of options need to be picked from inline.
   Replaces the hand-rolled `sp-rentalmode-pills` / `sp-strategy-goal-toggle`
   variants. `--compact` is a denser size for tight rows; default reads as
   a section-level control. */
.segmented-control {
  display:inline-flex;
  /* sp3 tactile track: a subtle neutral tint (color-mix on --text-primary
     is a sanctioned neutral, not a shadow) recessed behind the segments,
     with a tight 3px gutter so the active chip floats. */
  padding:3px;
  border-radius:var(--sp3-radius-sm);
  background:color-mix(in srgb, var(--text-primary) 5%, transparent);
  border:1px solid var(--border-subtle);
}
.segmented-control--compact { padding:3px; border-radius:9px; }
.segmented-control-btn {
  padding:0.36rem 0.8rem;
  font:inherit;
  font-size:0.8rem;
  font-weight:600;
  color:var(--text-muted);
  background:transparent;
  border:none;
  border-radius:8px;
  cursor:pointer;
  transition:background-color var(--sp3-dur-1) var(--sp3-ease),
    color var(--sp3-dur-1) var(--sp3-ease),
    box-shadow var(--sp3-dur-1) var(--sp3-ease);
}
.segmented-control--compact .segmented-control-btn { padding:0.26rem 0.65rem; font-size:0.76rem; border-radius:6px; }
.segmented-control-btn:hover:not(:disabled) { color:var(--text-primary); }
.segmented-control-btn.is-on {
  /* Active segment lifts on an elevated surface + token shadow (dark in
     both themes). Replaces the old hardcoded rgba(0,0,0,.18) drop. */
  background:var(--bg-elevated);
  color:var(--text-primary);
  box-shadow:var(--sp3-shadow-sm);
  font-weight:700;
}
.segmented-control-btn:disabled { opacity:0.5; cursor:not-allowed; }
.segmented-control-btn:focus-visible {
  outline:none;
  box-shadow:var(--sp3-ring);
}
.sp-rentalmode-help { font-size:0.74rem; color:var(--text-muted); }

/* ── Property type segmented control ─────────────────────────────────────
   Full-width with equal-share buttons. `display:flex !important`
   overrides the base `.segmented-control { display:inline-flex }` so
   the track spans the parent and each button claims an equal slice.
   Works for both the 3-option property-type row and the 2-option
   hybrid sub-view toggle without per-count CSS branching. Icons
   render at currentColor + a slight opacity dip on inactive so the
   active chip pops without needing an accent border. */
.sp-rentalmode-seg {
  display:flex !important;
  width:100%;
}
.sp-rentalmode-seg .segmented-control-btn {
  /* Equal-width slot: `flex:1 1 0` lets all buttons share the track
     evenly regardless of label length. `min-width:0` allows labels
     to ellipsis when the container is genuinely too narrow rather
     than pushing siblings off the edge. */
  flex:1 1 0;
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0.5rem 0.6rem;
  font-size:0.84rem;
  font-weight:700;
}
.sp-rentalmode-opt {
  display:inline-flex;
  align-items:center;
  gap:0.42rem;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sp-rentalmode-opt svg {
  flex-shrink:0;
  opacity:0.75;
  transition:opacity 0.15s;
}
.sp-rentalmode-seg .segmented-control-btn.is-on .sp-rentalmode-opt svg {
  opacity:1;
}

/* ── Demand Forecast card ── */
.sp-forecast { margin-bottom:1rem; }
.sp-forecast-head { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:0.5rem; }
.sp-forecast-title { margin:0; }
.sp-forecast-sub { margin:0; }

/* Headline — primary number + meta line */
.sp-forecast-headline { display:flex; align-items:baseline; gap:1.25rem; flex-wrap:wrap; margin:0.85rem 0 0.6rem; }
.sp-forecast-headline-main { display:flex; align-items:baseline; gap:0.4rem; flex-shrink:0; }
.sp-forecast-headline-num { font-size:2.4rem; font-weight:800; color:var(--text-primary); line-height:1; font-variant-numeric:tabular-nums; }
.sp-forecast-headline-lbl { font-size:0.78rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; font-weight:700; }
.sp-forecast-headline-meta { display:flex; align-items:center; gap:0.55rem; flex-wrap:wrap; font-size:0.78rem; color:var(--text-soft); padding-bottom:0.2rem; }
.sp-forecast-headline-meta strong { color:var(--text-primary); font-variant-numeric:tabular-nums; }
.sp-forecast-headline-sep { color:var(--border-strong); }
.sp-forecast-conf-inline { font-size:0.72rem; font-weight:700; padding:0.1rem 0.5rem; border-radius:999px; cursor:help; }
.sp-forecast-conf-inline.sp-forecast-conf--high   { background:color-mix(in srgb,var(--state-success) 18%,transparent); color:var(--state-success); }
.sp-forecast-conf-inline.sp-forecast-conf--medium { background:color-mix(in srgb,var(--state-warning) 22%,transparent); color:var(--state-warning); }
.sp-forecast-conf-inline.sp-forecast-conf--low    { background:color-mix(in srgb,var(--state-error)   18%,transparent); color:var(--state-error); }

/* Hover slot — single controlled tooltip rather than 90 native ones */
.sp-forecast-hover-slot { min-height:1.5rem; padding:0.35rem 0.55rem; margin-bottom:0.35rem; border-radius:6px; background:var(--bg-input); border:1px solid var(--border-subtle); display:flex; align-items:center; gap:0.5rem; font-size:0.78rem; color:var(--text-primary); transition:border-color 0.12s; }
.sp-forecast-hover-slot strong { font-weight:700; }
.sp-forecast-hover-pct { color:var(--text-soft); font-variant-numeric:tabular-nums; }
.sp-forecast-hover-hint { color:var(--text-muted); font-size:0.74rem; }

/* Heatmap strip */
.sp-forecast-heatmap { display:grid; grid-template-columns:repeat(90,1fr); gap:0; height:42px; border-radius:6px; overflow:hidden; border:1px solid var(--border-subtle); background:var(--bg-input); }
.sp-forecast-cell { display:block; height:100%; cursor:default; transition:transform 0.12s, filter 0.12s; background:var(--bg-input); position:relative; }
.sp-forecast-cell:hover { filter:brightness(1.25); transform:scaleY(1.06); z-index:2; outline:1px solid color-mix(in srgb,var(--ring) 50%,transparent); }
/* data-prob snaps to bands of 5 in JS so the colour scale steps cleanly. */
.sp-forecast-cell[data-prob="0"]  { background:color-mix(in srgb,var(--state-error)   24%,var(--bg-input)); }
.sp-forecast-cell[data-prob="5"]  { background:color-mix(in srgb,var(--state-error)   16%,var(--bg-input)); }
.sp-forecast-cell[data-prob="10"] { background:color-mix(in srgb,var(--state-error)    8%,var(--bg-input)); }
.sp-forecast-cell[data-prob="15"] { background:color-mix(in srgb,var(--state-warning) 10%,var(--bg-input)); }
.sp-forecast-cell[data-prob="20"] { background:color-mix(in srgb,var(--state-warning) 16%,var(--bg-input)); }
.sp-forecast-cell[data-prob="25"] { background:color-mix(in srgb,var(--state-warning) 22%,var(--bg-input)); }
.sp-forecast-cell[data-prob="30"] { background:color-mix(in srgb,var(--state-warning) 28%,var(--bg-input)); }
.sp-forecast-cell[data-prob="35"] { background:color-mix(in srgb,var(--state-warning) 34%,var(--bg-input)); }
.sp-forecast-cell[data-prob="40"] { background:color-mix(in srgb,var(--state-warning) 38%,var(--bg-input)); }
.sp-forecast-cell[data-prob="45"] { background:color-mix(in srgb,var(--state-warning) 32%,var(--bg-input)); }
.sp-forecast-cell[data-prob="50"] { background:color-mix(in srgb,var(--state-success) 22%,var(--bg-input)); }
.sp-forecast-cell[data-prob="55"] { background:color-mix(in srgb,var(--state-success) 30%,var(--bg-input)); }
.sp-forecast-cell[data-prob="60"] { background:color-mix(in srgb,var(--state-success) 38%,var(--bg-input)); }
.sp-forecast-cell[data-prob="65"] { background:color-mix(in srgb,var(--state-success) 46%,var(--bg-input)); }
.sp-forecast-cell[data-prob="70"] { background:color-mix(in srgb,var(--state-success) 54%,var(--bg-input)); }
.sp-forecast-cell[data-prob="75"] { background:color-mix(in srgb,var(--state-success) 62%,var(--bg-input)); }
.sp-forecast-cell[data-prob="80"] { background:color-mix(in srgb,var(--state-success) 70%,var(--bg-input)); }
.sp-forecast-cell[data-prob="85"] { background:color-mix(in srgb,var(--state-success) 78%,var(--bg-input)); }
.sp-forecast-cell[data-prob="90"] { background:color-mix(in srgb,var(--state-success) 86%,var(--bg-input)); }
.sp-forecast-cell[data-prob="95"] { background:color-mix(in srgb,var(--state-success) 92%,var(--bg-input)); }
.sp-forecast-cell--booked, .sp-forecast-cell[data-prob="100"] { background:var(--state-success); }
.sp-forecast-cell--booked::after { content:""; position:absolute; inset:30% 30%; border-radius:1px; background:rgba(255,255,255,0.85); }

.sp-forecast-legend { display:flex; align-items:center; justify-content:space-between; gap:0.6rem; margin-top:0.45rem; font-size:0.7rem; color:var(--text-muted); }
.sp-forecast-legend-bar { display:flex; align-items:center; gap:0.4rem; flex:1; max-width:280px; }
.sp-forecast-legend-grad { flex:1; height:6px; border-radius:3px; background:linear-gradient(90deg, color-mix(in srgb,var(--state-error) 24%,var(--bg-input)) 0%, color-mix(in srgb,var(--state-warning) 32%,var(--bg-input)) 38%, color-mix(in srgb,var(--state-success) 60%,var(--bg-input)) 70%, var(--state-success) 100%); border:1px solid var(--border-subtle); }
.sp-forecast-legend-lbl { font-variant-numeric:tabular-nums; }

/* ── Hint / warn lines reusable ── */
.sp-warn-line { margin-top:0.55rem; color:color-mix(in srgb,var(--state-warning) 88%,var(--text-soft)); font-size:0.78rem; }
.sp-info-line { margin-top:0.55rem; font-size:0.78rem; color:var(--text-soft); }

/* ── Suggest-base popover ── */
.sp-suggest-pop { margin-top:0.5rem; padding:0.7rem 0.85rem; background:color-mix(in srgb,var(--state-success) 8%,var(--bg-elevated)); border:1px solid color-mix(in srgb,var(--state-success) 28%,var(--border-subtle)); border-radius:var(--radius-md); }
.sp-suggest-pop-msg { margin:0; font-size:0.82rem; color:var(--text-primary); }
.sp-suggest-pop-actions { margin-top:0.55rem; display:flex; gap:0.5rem; }
.sp-suggest-err { margin-top:0.4rem; color:color-mix(in srgb,var(--state-warning) 88%,var(--text-soft)); font-size:0.78rem; }

/* ── Quick Setup modal ── */
.sp-quick-overlay { position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,0.6); backdrop-filter:blur(4px); display:flex; align-items:center; justify-content:center; padding:1rem; animation:sp-quick-fade 0.18s ease-out; }
@keyframes sp-quick-fade { from { opacity:0; } to { opacity:1; } }
.sp-quick-modal { width:100%; max-width:560px; max-height:90vh; overflow-y:auto; background:var(--bg-elevated); border:1px solid var(--border-strong); border-radius:14px; box-shadow:0 24px 64px rgba(0,0,0,0.5); display:flex; flex-direction:column; animation:sp-quick-slide 0.22s ease-out; }
@keyframes sp-quick-slide { from { transform:translateY(8px); opacity:0; } to { transform:translateY(0); opacity:1; } }

.sp-quick-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; padding:1.1rem 1.25rem 0.6rem; }
.sp-quick-title { font-size:1.15rem; font-weight:800; margin:0; color:var(--text-primary); letter-spacing:-0.01em; }
.sp-quick-sub { margin:0.25rem 0 0; font-size:0.8rem; color:var(--text-soft); line-height:1.5; }
.sp-quick-close { background:transparent; border:none; color:var(--text-muted); cursor:pointer; padding:0.4rem; border-radius:6px; transition:all 0.12s; flex-shrink:0; display:flex; align-items:center; justify-content:center; }
.sp-quick-close:hover { background:var(--surface-muted); color:var(--text-primary); }

/* Stepper */
.sp-quick-steps { display:flex; align-items:center; gap:0.4rem; padding:0.5rem 1.25rem 0.85rem; margin:0; list-style:none; border-bottom:1px solid var(--border-subtle); flex-wrap:wrap; }
.sp-quick-step { display:flex; align-items:center; gap:0.4rem; flex:0 1 auto; }
.sp-quick-step:not(:last-child)::after { content:""; width:1.5rem; height:1px; background:var(--border-subtle); margin-left:0.4rem; }
.sp-quick-step-num { width:1.4rem; height:1.4rem; border-radius:50%; background:var(--surface-muted); border:1px solid var(--border-subtle); color:var(--text-muted); font-size:0.7rem; font-weight:800; display:flex; align-items:center; justify-content:center; transition:all 0.15s; }
.sp-quick-step-lbl { font-size:0.72rem; font-weight:600; color:var(--text-muted); transition:color 0.15s; }
.sp-quick-step--active .sp-quick-step-num { background:var(--ring); border-color:var(--ring); color:var(--accent-contrast); box-shadow:0 0 0 3px color-mix(in srgb,var(--ring) 22%,transparent); }
.sp-quick-step--active .sp-quick-step-lbl { color:var(--text-primary); }
.sp-quick-step--done .sp-quick-step-num { background:var(--state-success); border-color:var(--state-success); color:var(--text-primary); }
.sp-quick-step--done .sp-quick-step-lbl { color:var(--text-soft); }

/* Body */
.sp-quick-body { padding:1.1rem 1.25rem; flex:1; min-height:200px; }
.sp-quick-prompt { font-size:0.92rem; font-weight:600; color:var(--text-primary); margin:0 0 0.85rem; }

/* Property type choices */
.sp-quick-choices { display:flex; flex-direction:column; gap:0.55rem; }
.sp-quick-choice { display:flex; flex-direction:column; gap:0.2rem; padding:0.85rem 1rem; border-radius:var(--radius-md); border:1.5px solid var(--border-subtle); background:var(--bg-input); cursor:pointer; text-align:left; transition:all 0.15s; }
.sp-quick-choice:hover { border-color:color-mix(in srgb,var(--ring) 40%,var(--border-subtle)); transform:translateY(-1px); }
.sp-quick-choice.is-on { border-color:var(--ring); background:color-mix(in srgb,var(--ring) 10%,var(--bg-input)); box-shadow:0 0 0 3px color-mix(in srgb,var(--ring) 14%,transparent); }
.sp-quick-choice-t { font-size:0.92rem; font-weight:700; color:var(--text-primary); }
.sp-quick-choice-d { font-size:0.78rem; color:var(--text-soft); line-height:1.4; }

/* Loading state */
.sp-quick-loading { display:flex; flex-direction:column; align-items:center; gap:1rem; padding:2.5rem 1rem; }
.sp-quick-spinner { width:36px; height:36px; border-radius:50%; border:3px solid var(--surface-muted); border-top-color:var(--ring); animation:sp-quick-spin 0.7s linear infinite; }
@keyframes sp-quick-spin { to { transform:rotate(360deg); } }
.sp-quick-loading-msg { font-size:0.85rem; color:var(--text-soft); margin:0; text-align:center; }

/* Review step */
.sp-quick-review-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:0.6rem 0; border-top:1px solid var(--border-subtle); flex-wrap:wrap; }
.sp-quick-review-row:first-of-type { border-top:none; padding-top:0; }
.sp-quick-review-lbl { font-size:0.78rem; font-weight:600; color:var(--text-soft); }
.sp-quick-review-meta { font-size:0.74rem; color:var(--text-muted); margin:0 0 0.6rem; line-height:1.5; }

.sp-quick-base-input { display:flex; align-items:center; gap:0.3rem; border:1px solid var(--border-strong); border-radius:8px; background:var(--bg-input); padding:0.2rem 0.55rem; transition:border-color 0.15s; }
.sp-quick-base-input:focus-within { border-color:color-mix(in srgb,var(--ring) 60%,var(--border-strong)); box-shadow:0 0 0 2px color-mix(in srgb,var(--ring) 14%,transparent); }
.sp-quick-base-sym { font-size:0.95rem; font-weight:700; color:var(--text-muted); }
.sp-quick-base-input input { background:transparent; border:none; outline:none; color:var(--text-primary); font-size:1.1rem; font-weight:700; width:5rem; text-align:right; font-variant-numeric:tabular-nums; }

.sp-quick-goals { display:inline-flex; gap:0.25rem; padding:0.2rem; background:var(--surface-muted); border:1px solid var(--border-subtle); border-radius:8px; }
.sp-quick-goal { padding:0.32rem 0.7rem; font-size:0.74rem; font-weight:700; color:var(--text-muted); background:transparent; border:none; border-radius:6px; cursor:pointer; transition:all 0.15s; white-space:nowrap; }
.sp-quick-goal:hover { color:var(--text-primary); }
.sp-quick-goal.is-on { background:var(--bg-elevated); color:var(--text-primary); box-shadow:0 1px 2px rgba(0,0,0,0.2); }

.sp-quick-factors { margin-top:0.6rem; padding:0.7rem 0.85rem; background:color-mix(in srgb,var(--state-success) 5%,var(--bg-input)); border:1px solid color-mix(in srgb,var(--state-success) 22%,var(--border-subtle)); border-radius:var(--radius-md); }
.sp-quick-factors-lbl { font-size:0.66rem; font-weight:800; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-muted); }
.sp-quick-factor-list { list-style:none; padding:0; margin:0.4rem 0 0; display:flex; flex-direction:column; gap:0.3rem; }
.sp-quick-factor-list li { font-size:0.78rem; color:var(--text-primary); display:flex; flex-direction:column; gap:0.05rem; }
.sp-quick-factor-list strong { font-weight:700; }
.sp-quick-factor-desc { font-size:0.72rem; color:var(--text-muted); line-height:1.4; }

/* Done state */
.sp-quick-done { display:flex; flex-direction:column; align-items:center; gap:0.7rem; padding:1.2rem 0.5rem; text-align:center; }
.sp-quick-done-icon { width:48px; height:48px; border-radius:50%; background:color-mix(in srgb,var(--state-success) 20%,transparent); color:var(--state-success); font-size:1.6rem; font-weight:800; display:flex; align-items:center; justify-content:center; }
.sp-quick-done-h { font-size:1.05rem; font-weight:700; margin:0; color:var(--text-primary); }
.sp-quick-done-p { font-size:0.82rem; color:var(--text-soft); margin:0; max-width:380px; line-height:1.55; }

/* Actions */
.sp-quick-actions { display:flex; justify-content:flex-end; gap:0.55rem; padding:0.85rem 1.25rem 1.1rem; border-top:1px solid var(--border-subtle); }

@media (max-width:480px) {
  .sp-quick-modal { max-height:96vh; border-radius:0; max-width:100vw; }
  .sp-quick-overlay { padding:0; }}
/* ── Top-level sub-tab nav (Pricing | Stay rules) ─────────────────── */
.sp-subtab-nav {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0.3rem;
  padding:0.25rem;
  margin:0.4rem 0 0.8rem;
  border:1px solid var(--border-subtle);
  border-radius:10px;
  background:var(--surface-muted);
}
.sp-subtab-nav.has-channels { grid-template-columns:repeat(3,minmax(0,1fr)); }
.sp-subtab-nav-btn {
  display:grid;
  place-items:center;
  min-width:0;
  min-height:40px;
  padding:0.55rem 0.7rem;
  border-radius:7px;
  border:1px solid transparent;
  background:transparent;
  color:var(--text-muted);
  cursor:pointer;
  text-align:center;
  transition:border-color 0.15s, background-color 0.15s, color 0.15s, transform 0.12s;
}
.sp-subtab-nav-btn:hover {
  background:color-mix(in srgb,var(--text-primary) 5%,transparent);
  color:var(--text-primary);
}
.sp-subtab-nav-btn:active { transform:translateY(1px); }
.sp-subtab-nav-btn.is-active {
  background:var(--bg-elevated);
  border-color:var(--border-subtle);
  color:var(--text-primary);
  box-shadow:0 1px 2px color-mix(in srgb,var(--text-primary) 12%,transparent);
}

/* Pricing & Stay uses one navigation level. Each tab is a different job,
   avoiding the previous nightly/monthly switch nested above another tab row. */
.sp-workspace-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--border-subtle);
}

.sp-workspace-nav > button {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 0.65rem 0.75rem;
  border: 0;
  color: var(--text-muted);
  background: var(--table-surface);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sp-workspace-nav > button:hover {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 5%, var(--table-surface));
}

.sp-workspace-nav > button.is-active {
  color: var(--text-primary);
  background: var(--bg-elevated);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.sp-workspace-nav strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .sp-workspace-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.sp-subtab-nav-icon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  border-radius:9px;
  background:color-mix(in srgb,var(--accent) 8%,var(--surface-muted));
  color:color-mix(in srgb,var(--accent) 70%,var(--text-muted));
  flex-shrink:0;
  transition:background-color 0.15s, color 0.15s;
}
.sp-subtab-nav-btn.is-active .sp-subtab-nav-icon {
  background:color-mix(in srgb,var(--accent) 18%,var(--surface-muted));
  color:color-mix(in srgb,var(--accent) 95%,var(--text-primary));
}
.sp-subtab-nav-text { display:flex; flex-direction:column; gap:0.1rem; min-width:0; }
.sp-subtab-nav-label { max-width:100%; overflow:hidden; font-size:0.8rem; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.sp-subtab-nav-sub { font-size:0.72rem; }

/* ── Adjustment group header ── */
.sp-adj-group-h { font-size:0.68rem; font-weight:800; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-muted); margin:1rem 0 0.4rem; padding:0 0 0.35rem; border-bottom:1px solid var(--border-subtle); }
.sp-adj-group-h:first-of-type { margin-top:0.35rem; }

/* Collapsible factor group — wraps 2-4 AdjSections with a summary header */
.sp-fgroup { margin-top:1rem; }
.sp-fgroup:first-of-type { margin-top:0.35rem; }
.sp-fgroup-head {
  display:flex; align-items:center; gap:0.75rem;
  width:100%; padding:0.55rem 0;
  background:transparent; border:none; border-bottom:1px solid var(--border-subtle);
  cursor:pointer; color:var(--text-primary); text-align:left;
  transition:border-color 0.15s;
}
.sp-fgroup-head:hover { border-bottom-color:color-mix(in srgb,var(--ring) 35%,var(--border-subtle)); }
.sp-fgroup-head:focus-visible { outline:2px solid var(--ring); outline-offset:2px; border-radius:4px; }
.sp-fgroup-title { font-size:0.7rem; font-weight:800; text-transform:uppercase; letter-spacing:0.1em; color:var(--text-muted); flex:1; display:inline-flex; align-items:center; gap:0.4rem; }
.sp-fgroup-title .sp-tip { width:13px; height:13px; font-size:0.55rem; text-transform:none; letter-spacing:0; }
.sp-fgroup-summary {
  font-size:0.65rem; font-weight:700; letter-spacing:0.02em;
  padding:2px 8px; border-radius:999px; line-height:1.3;
  font-variant-numeric:tabular-nums;
  border:1px solid var(--border-subtle);
}
.sp-fgroup-summary--firing { color:color-mix(in srgb,#22c55e 85%,var(--text-primary)); background:color-mix(in srgb,#22c55e 12%,var(--surface-muted)); border-color:color-mix(in srgb,#22c55e 30%,var(--border-subtle)); }
.sp-fgroup-summary--idle   { color:var(--text-muted); background:color-mix(in srgb,var(--text-muted) 6%,var(--surface-muted)); }
.sp-fgroup-summary--off    { color:var(--text-soft); background:transparent; }
.sp-fgroup-chev { font-size:0.85rem; color:var(--text-muted); transition:transform 0.15s; flex-shrink:0; }
.sp-fgroup-chev.is-on { transform:rotate(180deg); }
.sp-fgroup-body { display:flex; flex-direction:column; gap:0.65rem; padding-top:0.65rem; }

/* ── PDF export dialog ── */
.pnav-pdf-dialog-overlay { position:fixed; inset:0; z-index:9999; display:flex; align-items:center; justify-content:center; background:rgb(var(--sp3-shadow-color) / 0.6); backdrop-filter:blur(4px); }
.pnav-pdf-dialog { width:440px; max-width:92vw; padding:1.75rem 2rem; border-radius:14px !important; display:flex; flex-direction:column; gap:0; }
.pnav-pdf-dialog-title { margin:0 0 0.2rem; font-size:1.05rem; font-weight:800; color:var(--text-primary); }
.pnav-pdf-dialog-sub { margin:0 0 1.25rem; font-size:13px; line-height:1.5; color:var(--text-soft); }
.pnav-pdf-dialog-field { display:block; margin-bottom:1rem; }
.pnav-pdf-dialog-lbl { display:block; font-size:13px; font-weight:700; color:var(--text-soft); margin-bottom:0.35rem; }
.pnav-pdf-dialog-ta { resize:vertical; font-family:inherit; min-height:72px; }
.pnav-pdf-dialog-actions { display:flex; gap:0.65rem; justify-content:flex-end; margin-top:0.5rem; }

/* ── PDF type selector ── */
.pnav-pdf-wrap { display:flex; align-items:center; gap:0; border:1px solid var(--border-subtle); border-radius:7px; overflow:hidden; }
.pnav-pdf-type { min-height:36px; font-size:13px; font-weight:700; border:none; background:var(--bg-input); color:var(--text-muted); padding:7px 6px; cursor:pointer; border-right:1px solid var(--border-subtle); }
.pnav-pdf-wrap .pnav-pdf-btn { border:none; border-radius:0; }

/* ── "You are here" tooltip ── */
.mmap-you-tooltip.leaflet-tooltip { background:rgba(239,68,68,0.92); color:#fff; border:none; border-radius:6px; font-size:0.68rem; font-weight:700; padding:0.2rem 0.5rem; box-shadow:0 2px 8px rgba(239,68,68,0.4); white-space:nowrap; }
.mmap-you-tooltip.leaflet-tooltip::before { border-bottom-color:rgba(239,68,68,0.92); }

/* ── Management fee conditions builder ── */
.mgmt-cond-builder { display:flex; flex-direction:column; gap:0.85rem; }
.mgmt-cond-rule { display:flex; flex-direction:column; gap:0.6rem; padding:0.85rem 1rem; border:1px solid var(--border-subtle); border-radius:10px; background:color-mix(in srgb,var(--bg-deep) 50%,var(--surface-muted)); }
.mgmt-cond-rule--fallback { background:color-mix(in srgb,var(--ring) 6%,var(--surface-muted)); border-style:dashed; }
.mgmt-cond-rule-head { display:flex; align-items:center; gap:0.6rem; flex-wrap:wrap; }
.mgmt-cond-rule-label { font-size:0.78rem; font-weight:700; color:var(--text-primary); text-transform:uppercase; letter-spacing:0.04em; }
.mgmt-cond-combinator { max-width:140px; }
.mgmt-cond-rule-remove { color:#f87171; margin-left:auto; }
.mgmt-cond-predicates { display:flex; flex-direction:column; gap:0.45rem; }
.mgmt-cond-pred { display:grid; grid-template-columns:minmax(150px,1.2fr) minmax(140px,1fr) minmax(120px,1.2fr) auto; gap:0.45rem; align-items:center; }
@media (max-width:760px) { .mgmt-cond-pred { grid-template-columns:1fr 1fr; }}
.mgmt-cond-between { display:flex; align-items:center; gap:0.4rem; }
.mgmt-cond-between span { font-size:0.78rem; color:var(--text-muted); }
.mgmt-cond-chips { display:flex; flex-wrap:wrap; gap:5px; align-content:flex-start; }
.mgmt-cond-chip {
  padding:4px 10px;
  border:1px solid var(--border-subtle);
  border-radius:999px;
  background:var(--surface-muted);
  color:var(--text-soft);
  font-size:11.5px;
  font-weight:500;
  cursor:pointer;
  transition:background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.mgmt-cond-chip:disabled { cursor:default; opacity:0.6; }
.mgmt-cond-chip.on {
  background:var(--accent);
  border-color:var(--accent);
  color:var(--accent-contrast, #fff);
  font-weight:600;
}
.mgmt-cond-result { display:flex; align-items:center; gap:0.6rem; padding-top:0.45rem; border-top:1px dashed var(--border-subtle); }
.mgmt-cond-result-label { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted); min-width:60px; }
.mgmt-cond-actions { display:flex; gap:0.5rem; }
/* On/off row: the sw-switch track + a sentence explaining the current state.
   (The old bare checkbox sat inside a `.field`, which is display:grid — the
   inline flex-direction:row was silently ignored and the control floated.) */
.mgmt-cond-toggle { display:flex; align-items:center; gap:0.6rem; margin-bottom:0.6rem; }
.mgmt-cond-toggle-text { font-size:0.82rem; font-weight:600; color:var(--text-soft); }
.mgmt-cond-result-input { display:inline-flex; align-items:center; gap:0.4rem; }
.mgmt-cond-result-input .properties-input-text { width:140px; }
.mgmt-cond-result-input > span { font-size:0.84rem; font-weight:600; color:var(--text-muted); }
.btn.mgmt-cond-pred-remove { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; padding:0; color:var(--text-muted); }
.btn.mgmt-cond-pred-remove:hover:not(:disabled) { color:#f87171; }
.mgmt-cond-pred-remove svg { width:16px; height:16px; }
.btn-sm { font-size:0.74rem; padding:0.28rem 0.65rem; min-height:28px; }

.properties-fee-kind-pill { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:18px; padding:0 0.35rem; margin-left:0.4rem; font-size:0.62rem; font-weight:700; border-radius:4px; background:color-mix(in srgb,var(--ring) 14%,var(--surface-muted)); border:1px solid color-mix(in srgb,var(--ring) 26%,var(--border-subtle)); color:color-mix(in srgb,var(--ring) 80%,var(--text-primary)); }

/* Dated fee chains: the date pill on a fee row ("from 20 Jul 2026" /
   "takes over 1 Aug 2026" / "since the start"), plus quiet styling for rows a
   later change already took over and slight emphasis for not-yet-active rows.
   Token-only — light/dark parity for free. */
.properties-fee-from-pill { display:inline-flex; align-items:center; height:18px; padding:0 0.4rem; margin-left:0.4rem; font-size:0.62rem; font-weight:600; border-radius:4px; white-space:nowrap; background:var(--surface-muted); border:1px solid var(--border-subtle); color:var(--text-muted); }
.properties-fee-row--superseded td { opacity:0.55; }
.properties-fee-row--future .properties-fee-from-pill { background:color-mix(in srgb,var(--accent) 12%,var(--surface-muted)); border-color:color-mix(in srgb,var(--accent) 30%,var(--border-subtle)); color:color-mix(in srgb,var(--accent) 75%,var(--text-primary)); }

/* Configuration-tab guest fees */
.properties-guest-fees-grid { gap:0.85rem; }
.properties-currency-input { display:flex; align-items:stretch; border:1px solid var(--border-strong); border-radius:8px; background:var(--bg-input); overflow:hidden; transition:border-color 0.15s; }
.properties-currency-input:focus-within { border-color:color-mix(in srgb,var(--ring) 60%,var(--border-strong)); box-shadow:0 0 0 2px color-mix(in srgb,var(--ring) 14%,transparent); }
.properties-currency-prefix { padding:0 0.5rem; font-size:0.72rem; font-weight:700; color:var(--text-muted); border-right:1px solid var(--border-subtle); display:flex; align-items:center; flex-shrink:0; background:color-mix(in srgb,var(--bg-deep) 50%,var(--surface-muted)); }
.properties-currency-input input { border:none !important; background:transparent !important; box-shadow:none !important; padding:0.42rem 0.55rem !important; flex:1; }
.properties-fee-disabled-pill { display:inline-flex; align-items:center; margin-left:0.45rem; padding:0.1rem 0.4rem; border-radius:4px; font-size:0.6rem; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; background:color-mix(in srgb,#f59e0b 12%,var(--surface-muted)); border:1px solid color-mix(in srgb,#f59e0b 25%,var(--border-subtle)); color:#f59e0b; }

/* Channel-specific markup — promoted to a first-class lever in the channel row.
   Tinted ring + brand accent prefix to signal "this is THE channel pricing
   control." Inherits the suffix-input baseline so it sits cleanly next to the
   Listed toggle. */
.properties-child-markup-field { min-width:8.5rem; }
.properties-child-markup-input { border-color:color-mix(in srgb,var(--accent) 35%,var(--border-strong)); background:color-mix(in srgb,var(--accent) 5%,var(--bg-input)); }
.properties-child-markup-input:focus-within { border-color:color-mix(in srgb,var(--accent) 65%,var(--border-strong)); box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 18%,transparent); }
.properties-child-markup-input input { font-weight:600; }
.properties-child-markup-input .properties-suffix-input-suffix { font-weight:700; color:color-mix(in srgb,var(--accent) 70%,var(--text-muted)); }

/* Child-channel sync controls */
.properties-child-sync { margin-top:0.6rem; padding-top:0.55rem; border-top:1px dashed var(--border-subtle); display:flex; flex-direction:column; gap:0.55rem; }
.properties-child-sync-heading { display:flex; flex-direction:column; gap:0.2rem; }
.properties-child-sync-label { font-size:0.78rem; font-weight:700; color:var(--text-primary); }
.properties-child-sync-heading small { font-size:0.72rem; line-height:1.4; }
.properties-child-sync-controls { display:flex; flex-wrap:wrap; align-items:center; gap:0.45rem; }
.properties-child-sync-mode { display:flex; flex-direction:column; gap:0.3rem; margin-top:0.15rem; }
.properties-child-sync-mode-label { font-size:0.66rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted); }
.properties-child-cancel-policy { display:flex; flex-direction:column; gap:0.3rem; margin-top:0.6rem; }
.properties-child-cancel-policy-label { font-size:0.66rem; font-weight:700; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted); }
.properties-child-cancel-policy-select { font-size:0.78rem; padding:0.45rem 0.6rem; border:1px solid var(--border-strong); border-radius:8px; background:var(--bg-input); color:var(--text-primary); cursor:pointer; max-width:280px; }
.properties-child-cancel-policy-select:hover { border-color:var(--border-strong-hover,var(--border-strong)); }
.properties-child-cancel-policy-select:focus-visible { outline:2px solid var(--ring); outline-offset:1px; }
.properties-child-sync--parent { background:color-mix(in srgb,var(--ring) 6%,transparent); border-radius:7px; padding:0.55rem 0.7rem; border:1px dashed color-mix(in srgb,var(--ring) 25%,var(--border-subtle)); }
.properties-child-sync--parent .properties-child-sync-label::before { content:"★ "; color:var(--ring); font-weight:800; }

/* Unlisted state — markup + sync controls hide entirely; a soft placeholder
   sits in their slot to explain why and how to bring them back. */
.properties-child-sync--unlisted {
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  background: color-mix(in srgb, var(--text-soft) 6%, transparent);
  border: 1px dashed color-mix(in srgb, var(--border-subtle) 90%, transparent);
  border-top: 1px dashed var(--border-subtle);
}
.properties-child-sync-unlisted-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text-soft) 14%, transparent);
  color: var(--text-soft);
  flex-shrink: 0;
}
.properties-child-sync-unlisted-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.properties-child-sync-unlisted-copy strong {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.properties-child-sync-unlisted-copy small {
  font-size: 0.72rem;
  line-height: 1.35;
}
[data-theme="light"] .properties-child-sync--unlisted {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.12);
}

/* Location section — lock badge, warning banner, locked inputs, copy button */
.properties-location-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:0.5rem; }
.properties-location-head > div { flex:1; min-width:0; }
.properties-location-lock-badge { display:inline-flex; align-items:center; margin-left:0.5rem; padding:0.12rem 0.45rem; border-radius:5px; font-size:0.62rem; font-weight:800; letter-spacing:0.06em; text-transform:uppercase; background:color-mix(in srgb,#f59e0b 14%,var(--surface-muted)); border:1px solid color-mix(in srgb,#f59e0b 30%,var(--border-subtle)); color:#f59e0b; vertical-align:middle; cursor:help; transition:background 0.14s ease, border-color 0.14s ease; }
.properties-location-lock-wrap { margin-left:0.1rem; }
.properties-location-lock-wrap:hover .properties-location-lock-badge,
.properties-location-lock-wrap:focus-within .properties-location-lock-badge { background:color-mix(in srgb,#f59e0b 22%,var(--surface-muted)); border-color:color-mix(in srgb,#f59e0b 50%,var(--border-subtle)); }
.properties-location-warning { display:flex; align-items:flex-start; gap:0.6rem; padding:0.65rem 0.8rem; margin-bottom:0.7rem; border-radius:7px; background:color-mix(in srgb,#f59e0b 8%,var(--surface-muted)); border:1px solid color-mix(in srgb,#f59e0b 25%,var(--border-subtle)); color:var(--text-primary); font-size:0.8rem; line-height:1.45; }
.properties-location-warning strong { color:#f59e0b; }
.properties-location-warning-body { flex:1; min-width:0; }
.properties-location-warning-dismiss { flex-shrink:0; appearance:none; border:0; background:transparent; color:color-mix(in srgb,#f59e0b 80%,var(--text-soft)); padding:0.2rem; margin:-0.1rem -0.1rem 0 0; border-radius:4px; cursor:pointer; line-height:0; }
.properties-location-warning-dismiss:hover { background:color-mix(in srgb,#f59e0b 14%,transparent); color:#f59e0b; }
.properties-input-text.is-locked { background:color-mix(in srgb,var(--bg-deep) 55%,var(--surface-muted)) !important; color:var(--text-muted); cursor:not-allowed; }
.properties-input-text.is-locked:focus { outline:none; box-shadow:none; border-color:var(--border-subtle); }
/* Elegant copy button — ghost style, animated success state */
.properties-copy-btn {
  display:inline-flex;
  align-items:center;
  gap:0.4rem;
  font-size:0.74rem;
  font-weight:600;
  letter-spacing:0.01em;
  padding:0.38rem 0.7rem 0.38rem 0.55rem;
  border-radius:7px;
  border:1px solid var(--border-strong);
  background:transparent;
  color:var(--text-soft);
  cursor:pointer;
  white-space:nowrap;
  flex-shrink:0;
  transition:background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.properties-copy-btn:hover:not(:disabled) {
  background:color-mix(in srgb, var(--ring) 8%, transparent);
  border-color:color-mix(in srgb, var(--ring) 40%, var(--border-strong));
  color:var(--text-primary);
}
.properties-copy-btn:active:not(:disabled) {
  transform:scale(0.97);
}
.properties-copy-btn:disabled {
  opacity:0.45;
  cursor:not-allowed;
}
.properties-copy-btn.is-copied {
  background:color-mix(in srgb, #22c55e 14%, transparent);
  border-color:color-mix(in srgb, #22c55e 42%, var(--border-strong));
  color:#22c55e;
}
.properties-copy-btn-icon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:16px;
  flex-shrink:0;
}
.properties-copy-btn-icon svg {
  display:block;
  transition:transform 0.2s ease;
}
.properties-copy-btn.is-copied .properties-copy-btn-icon svg {
  animation:propertiesCopyCheckPop 0.32s cubic-bezier(0.5, 1.6, 0.55, 1) both;
}
@keyframes propertiesCopyCheckPop {
  0% { transform:scale(0.55) rotate(-6deg); opacity:0; }
  60% { transform:scale(1.12) rotate(0deg); opacity:1; }
  100% { transform:scale(1) rotate(0deg); opacity:1; }
}
.properties-copy-btn-label {
  line-height:1;
}

.properties-child-sync-segment { display:inline-flex; border:1px solid var(--border-strong); border-radius:8px; background:var(--bg-input); overflow:hidden; padding:2px; gap:2px; }
.properties-child-sync-segment-btn { font-size:0.72rem; font-weight:600; padding:0.36rem 0.7rem; border:1px solid transparent; border-radius:6px; background:transparent; color:var(--text-muted); cursor:pointer; transition:background 0.12s,color 0.12s,border-color 0.12s,box-shadow 0.12s,transform 0.08s; position:relative; }
.properties-child-sync-segment-btn:hover:not(:disabled):not(.is-active) { background:color-mix(in srgb,var(--ring) 10%,transparent); color:var(--text-primary); }
.properties-child-sync-segment-btn.is-active {
  background:var(--ring);
  color:#ffffff;
  font-weight:700;
  border-color:color-mix(in srgb,var(--ring) 60%,#000);
  box-shadow:0 1px 2px rgb(0 0 0 / 30%), inset 0 0 0 1px color-mix(in srgb,#ffffff 25%,transparent);
}
.properties-child-sync-segment-btn.is-active::before {
  content:"✓ ";
  font-weight:800;
  margin-right:0.15rem;
}
.properties-child-sync-segment-btn:disabled { opacity:0.55; cursor:default; }

/* Save confirm modal — per-channel changes block */
.properties-save-confirm-children { margin:0.5rem 0 0; padding-left:1rem; display:flex; flex-direction:column; gap:0.55rem; }
.properties-save-confirm-children > li { font-size:0.82rem; color:var(--text-primary); }
.properties-save-confirm-children code { font-size:0.74rem; padding:0.05rem 0.32rem; border-radius:4px; background:color-mix(in srgb,var(--ring) 10%,var(--surface-muted)); border:1px solid var(--border-subtle); }
.properties-save-confirm-child-fields { margin:0.25rem 0 0.35rem; padding-left:1.1rem; display:flex; flex-direction:column; gap:0.15rem; color:var(--text-muted); font-size:0.76rem; list-style:disc; }

/* Debug — API call preview at the bottom of the configuration tab */
.properties-api-preview { border:1px dashed color-mix(in srgb,var(--ring) 40%,var(--border-subtle)); background:color-mix(in srgb,var(--bg-deep) 70%,var(--surface-muted)); }
.properties-api-preview-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; }
.properties-api-preview-body { margin-top:0.75rem; }
.properties-api-preview-warn { font-size:0.78rem; padding:0.5rem 0.7rem; border:1px solid color-mix(in srgb,#f59e0b 35%,var(--border-subtle)); border-radius:7px; background:color-mix(in srgb,#f59e0b 10%,var(--surface-muted)); color:#f59e0b; margin:0 0 0.65rem; }
.properties-api-preview-list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:0.85rem; }
.properties-api-preview-call { padding:0.65rem 0.85rem; border:1px solid var(--border-subtle); border-radius:9px; background:var(--surface); }
.properties-api-preview-call-head { display:flex; align-items:center; gap:0.55rem; flex-wrap:wrap; }
.properties-api-preview-idx { font-size:0.7rem; font-weight:700; color:var(--text-muted); letter-spacing:0.04em; }
.properties-api-preview-method { font-size:0.66rem; font-weight:800; letter-spacing:0.06em; padding:0.1rem 0.45rem; border-radius:4px; }
.properties-api-preview-method.method-post { background:color-mix(in srgb,#3b82f6 16%,var(--surface-muted)); border:1px solid color-mix(in srgb,#3b82f6 32%,var(--border-subtle)); color:#60a5fa; }
.properties-api-preview-method.method-put { background:color-mix(in srgb,#f59e0b 16%,var(--surface-muted)); border:1px solid color-mix(in srgb,#f59e0b 32%,var(--border-subtle)); color:#fbbf24; }
.properties-api-preview-url { font-size:0.78rem; padding:0.1rem 0.4rem; border-radius:4px; background:color-mix(in srgb,var(--ring) 8%,var(--surface-muted)); border:1px solid var(--border-subtle); color:var(--text-primary); }
.properties-api-preview-via { font-size:0.7rem; margin:0.3rem 0 0.45rem; }
.properties-api-preview-via code { font-size:0.7rem; background:color-mix(in srgb,var(--ring) 7%,var(--surface-muted)); padding:0.05rem 0.3rem; border-radius:3px; border:1px solid var(--border-subtle); }
.properties-api-preview-json { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:0.72rem; line-height:1.45; padding:0.65rem 0.8rem; border-radius:7px; background:color-mix(in srgb,var(--bg-deep) 60%,var(--surface-muted)); border:1px solid var(--border-subtle); overflow-x:auto; margin:0; color:var(--text-primary); white-space:pre; }
.properties-api-preview-responses { margin:0 0 1rem; display:flex; flex-direction:column; gap:0.5rem; }
.properties-api-preview-call--ok { border-left:3px solid color-mix(in srgb,#10b981 60%,var(--border-subtle)); }
.properties-api-preview-call--fail { border-left:3px solid color-mix(in srgb,#ef4444 60%,var(--border-subtle)); background:color-mix(in srgb,#ef4444 6%,var(--surface)); }
.properties-api-preview-method.method-ok { background:color-mix(in srgb,#10b981 16%,var(--surface-muted)); border:1px solid color-mix(in srgb,#10b981 32%,var(--border-subtle)); color:#34d399; }
.properties-api-preview-method.method-fail { background:color-mix(in srgb,#ef4444 18%,var(--surface-muted)); border:1px solid color-mix(in srgb,#ef4444 36%,var(--border-subtle)); color:#f87171; }

/* ── Payout protection card ──────────────────────────────────────────
   Channel economics commercial guardrail. Lives in the Pricing sub-tab
   between Foundations and Strategy. See docs/payout-protection.md for
   the engine logic the card surfaces. */
.sp-payout-card { display:flex; flex-direction:column; gap:0.85rem; }
.sp-payout-card--loading { opacity:0.7; }
.sp-discounts-card { margin-top:1rem; }

/* Off state — invitation card */
.sp-payout-card--off { gap:0.85rem; }
.sp-payout-off-head { display:flex; gap:0.85rem; align-items:flex-start; }
.sp-payout-off-icon {
  width:36px; height:36px; border-radius:9px; flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:1.05rem; font-weight:700;
  background:color-mix(in srgb, var(--accent) 12%, var(--surface-muted));
  color:color-mix(in srgb, var(--accent) 90%, var(--text-primary));
}
.sp-payout-off-h { margin:0 0 0.25rem; font-size:1rem; font-weight:700; color:var(--text-primary); }
.sp-payout-off-lead { margin:0; font-size:14px; color:var(--text-muted); line-height:1.55; max-width:62ch; }
.sp-payout-off-actions { display:flex; align-items:center; gap:0.85rem; }
.sp-payout-off-link { font-size:0.78rem; color:var(--text-muted); text-decoration:underline; }
.sp-payout-off-link:hover { color:var(--text-primary); }

/* On state — header */
.sp-payout-head { display:flex; align-items:center; justify-content:space-between; gap:0.85rem; flex-wrap:wrap; }
.sp-payout-title-wrap { display:flex; align-items:center; gap:0.6rem; }
.sp-payout-title { margin:0; font-size:1rem; font-weight:700; color:var(--text-primary); }

.sp-payout-error {
  padding:0.55rem 0.7rem; border-radius:8px; font-size:14px;
  background:color-mix(in srgb, #ef4444 10%, var(--surface-muted));
  border:1px solid color-mix(in srgb, #ef4444 32%, var(--border-subtle));
  color:color-mix(in srgb, #ef4444 80%, var(--text-primary));
}

/* Main inputs grid */
.sp-payout-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:0.85rem;
}
.sp-payout-currency-row { display:flex; align-items:stretch; gap:0.3rem; }
.sp-payout-currency {
  display:inline-flex; align-items:center; justify-content:center;
  padding:0 0.7rem; border-radius:8px;
  background:var(--surface-muted); border:1px solid var(--border-subtle);
  font-weight:700; color:var(--text-muted);
}
.sp-payout-recovery-seg .segmented-control-btn { flex:1 1 0; min-width:0; justify-content:center; }

.sp-payout-warnings { list-style:none; margin:0.5rem 0 0; padding:0; display:flex; flex-direction:column; gap:0.4rem; }
.sp-payout-warning {
  display:flex; flex-direction:column; gap:0.2rem;
  padding:0.55rem 0.7rem; border-radius:8px; font-size:14px;
}
.sp-payout-warning strong { font-size:14px; }
.sp-payout-warning--info {
  background:color-mix(in srgb, var(--ring) 6%, var(--surface));
  border:1px solid color-mix(in srgb, var(--ring) 24%, var(--border-subtle));
}
.sp-payout-warning--warn {
  background:color-mix(in srgb, #f59e0b 8%, var(--surface));
  border:1px solid color-mix(in srgb, #f59e0b 30%, var(--border-subtle));
}
.sp-payout-warning--error {
  background:color-mix(in srgb, #ef4444 8%, var(--surface));
  border:1px solid color-mix(in srgb, #ef4444 32%, var(--border-subtle));
}
.sp-payout-grid--advanced { grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:0.55rem; }
.sp-payout-balance { display:flex; align-items:center; gap:0.55rem; font-size:14px; color:var(--text-primary); }
.sp-payout-balance input { accent-color:var(--ring); }

/* Empty state when no OTAs are connected */
.sp-payout-empty {
  padding:0.7rem 0.85rem; border-radius:10px;
  background:color-mix(in srgb, var(--ring) 5%, var(--surface));
  border:1px solid var(--border-subtle);
  font-size:14px; color:var(--text-muted); line-height:1.5;
}

/* Commission rates row — derived from real bookings */
.sp-payout-commissions {
  display:flex; flex-wrap:wrap; align-items:center; gap:0.5rem;
  padding:0.45rem 0.7rem; border-radius:8px;
  background:var(--surface);
  border:1px solid var(--border-subtle);
  font-size:14px;
}
.sp-payout-commissions-lbl { color:var(--text-muted); font-weight:600; }
.sp-payout-commission-pill {
  display:inline-flex; align-items:center; gap:0.3rem;
  padding:0.16rem 0.55rem; border-radius:999px;
  background:color-mix(in srgb, var(--ring) 8%, var(--surface-muted));
  border:1px solid color-mix(in srgb, var(--ring) 22%, var(--border-subtle));
  color:var(--text-primary);
}
.sp-payout-commission-pill strong { font-variant-numeric:tabular-nums; }
.sp-payout-commission-source {
  font-style:normal; font-size:12px;
  letter-spacing:0; color:var(--text-muted);
  padding-left:0.18rem;
}

/* Airbnb read-only row showing currently pushed values */
.sp-payout-airbnb-readonly {
  display:flex; flex-wrap:wrap; gap:0.6rem;
  padding:0.45rem 0.6rem; border-radius:8px;
  background:var(--surface-muted); border:1px solid var(--border-subtle);
  font-size:0.74rem; color:var(--text-muted);
}
.sp-payout-airbnb-readonly strong { color:var(--text-primary); font-variant-numeric:tabular-nums; }

/* Uptake field — value % stacked above the optional uptake-% row so the
   pair takes a single grid cell of the same height as a plain numeric
   field. Previously laid them out horizontally, which overflowed narrow
   cells and pushed adjacent fields out of their rows on smaller widths. */
.sp-payout-uptake-row { display:flex; flex-direction:column; gap:0.3rem; min-width:0; }
.sp-payout-uptake-inner {
  display:inline-flex; align-items:center; gap:0.35rem;
  padding:0.22rem 0.55rem;
  border-radius:6px;
  background:color-mix(in srgb, var(--text-primary) 4%, transparent);
  border:1px solid var(--border-subtle);
  font-size:14px;
  color:var(--text-muted);
  align-self:flex-start;
  max-width:100%;
}
.sp-payout-uptake-x { color:var(--text-muted); font-weight:700; font-size:14px; }
.sp-payout-uptake-inner .sp-input { width:64px; padding:0.35rem 0.45rem !important; font-size:14px !important; }
.sp-payout-uptake-inner input[type="number"] { width:64px; padding:0.35rem 0.45rem !important; font-size:14px !important; }
.sp-payout-uptake-suffix { font-size:13px; color:var(--text-muted); white-space:nowrap; }

/* Channel-details grid: more generous min-width so each F field stays
   readable instead of squishing two columns into 180px each when the
   pane is narrow. */
.sp-payout-grid--advanced {
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap:0.7rem !important;
}

/* ── Payout protection (v2 layout) ─────────────────────────────────────
   Plain-English recommendations are the centrepiece. The inputs sit
   above as a guardrail-setting row; channel details visible below
   (no Advanced toggle) so a curious host can verify the model without
   hunting. */
.sp-payout-head-actions { display:flex; align-items:center; gap:0.5rem; }
.sp-payout-head-btn {
  min-height:40px; padding:0.5rem 0.85rem; border-radius:7px; font-size:14px; font-weight:600;
  cursor:pointer; transition:border-color 0.15s, background-color 0.15s, color 0.15s;
}
.sp-payout-head-btn--ghost {
  background:transparent; border:1px solid var(--border-subtle); color:var(--text-muted);
}
.sp-payout-head-btn--ghost:hover { color:var(--text-primary); border-color:var(--border-strong); }
.sp-payout-head-btn--primary {
  background:color-mix(in srgb, var(--accent) 80%, var(--bg-elevated));
  border:1px solid color-mix(in srgb, var(--accent) 50%, var(--border-strong));
  color:var(--accent-contrast);
}
.sp-payout-head-btn--primary:disabled { opacity:0.5; cursor:wait; }

/* Sections */
.sp-payout-section {
  display:flex; flex-direction:column; gap:0.55rem;
  padding-top:0.75rem;
  margin-top:0.25rem;
  border-top:1px solid var(--border-subtle);
}
.sp-payout-section:first-of-type { border-top:0; padding-top:0; margin-top:0; }
.sp-payout-section-h {
  margin:0;
  font-size:16px; font-weight:700;
  letter-spacing:0; color:var(--text-primary);
}
.sp-payout-section-saving { color:var(--text-muted); font-weight:400; text-transform:none; letter-spacing:0; }
.sp-payout-section-lead {
  margin:0; font-size:14px; line-height:1.55;
}
.sp-payout-section--inputs .sp-payout-input-row {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:0.85rem;
  align-items:start;
}
.sp-payout-input-block { display:flex; flex-direction:column; gap:0.35rem; }
.sp-payout-input-lbl {
  font-size:14px; font-weight:600; color:var(--text-primary);
  display:inline-flex; align-items:center; gap:0.32rem;
}

/* "How conservative?" — labeled buttons, not a generic segmented control,
   because each label needs more breathing room than 70px of segmented chip. */
.sp-payout-mode-buttons {
  display:flex; gap:0.3rem; width:100%;
}
.sp-payout-mode-btn {
  flex:1; min-width:0;
  min-height:40px; padding:0.5rem;
  border-radius:7px;
  background:var(--surface-muted);
  border:1px solid var(--border-subtle);
  color:var(--text-muted);
  font-size:14px; font-weight:600;
  cursor:pointer; text-align:center;
  transition:border-color 0.15s, background-color 0.15s, color 0.15s;
}
.sp-payout-mode-btn:hover { color:var(--text-primary); }
.sp-payout-mode-btn.is-on {
  background:var(--bg-elevated);
  border-color:color-mix(in srgb, var(--accent) 40%, var(--border-strong));
  color:var(--text-primary);
  box-shadow:0 1px 2px color-mix(in srgb, var(--text-primary) 10%, transparent);
}

/* Recommendations list — numbered, plain-English instructions */
.sp-payout-rec-list {
  list-style:none; margin:0; padding:0;
  display:flex; flex-direction:column; gap:0.6rem;
}
.sp-payout-rec-item {
  display:flex; gap:0.85rem;
  padding:0.75rem 0.85rem;
  border-radius:10px;
  background:var(--surface-muted);
  border:1px solid var(--border-subtle);
}
.sp-payout-rec-num {
  flex-shrink:0;
  width:24px; height:24px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
  background:color-mix(in srgb, var(--accent) 14%, var(--surface));
  color:color-mix(in srgb, var(--accent) 80%, var(--text-primary));
  font-size:14px; font-weight:700;
  font-variant-numeric:tabular-nums;
  margin-top:0.06rem;
}
.sp-payout-rec-body { flex:1; min-width:0; display:flex; flex-direction:column; gap:0.3rem; }
.sp-payout-rec-instruction { font-size:0.92rem; font-weight:700; color:var(--text-primary); line-height:1.35; }
.sp-payout-rec-rationale { font-size:14px; color:var(--text-muted); line-height:1.55; }
.sp-payout-rec-actions { display:flex; gap:0.6rem; flex-wrap:wrap; margin-top:0.15rem; }
.sp-payout-rec-why {
  min-height:40px; background:transparent; border:none; padding:0 0.25rem;
  font-size:14px; font-weight:600;
  color:color-mix(in srgb, var(--accent) 80%, var(--text-primary));
  cursor:pointer; text-decoration:underline;
}
.sp-payout-rec-why:hover { color:var(--text-primary); }
.sp-payout-rec-apply {
  min-height:40px; padding:0.5rem 0.85rem; border-radius:7px;
  background:color-mix(in srgb, var(--accent) 88%, var(--bg-elevated));
  border:1px solid color-mix(in srgb, var(--accent) 60%, var(--border-strong));
  color:var(--accent-contrast);
  font-size:14px; font-weight:700; cursor:pointer;
}
.sp-payout-rec-apply:hover { background:var(--accent); }
.sp-payout-rec-math {
  margin-top:0.45rem; padding:0.55rem 0.7rem;
  background:var(--surface); border:1px solid var(--border-subtle);
  border-radius:8px;
  font-size:14px; line-height:1.55;
  color:var(--text-muted);
  display:flex; flex-direction:column; gap:0.25rem;
  font-variant-numeric:tabular-nums;
}
.sp-payout-rec-math-line strong { color:var(--text-primary); }

.sp-payout-rec-all-good {
  padding:0.75rem 0.9rem; border-radius:10px;
  background:color-mix(in srgb, #10b981 8%, var(--surface-muted));
  border:1px solid color-mix(in srgb, #10b981 25%, var(--border-subtle));
  font-size:0.85rem; font-weight:600;
  color:color-mix(in srgb, #10b981 60%, var(--text-primary));
}

/* Status list — traffic-light per channel */
.sp-payout-status-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:0.4rem; }
.sp-payout-status-row {
  display:grid;
  grid-template-columns:48px 130px 1fr;
  align-items:center; gap:0.6rem;
  padding:0.5rem 0.7rem;
  border-radius:8px;
  font-size:14px;
}
.sp-payout-status-row--pass {
  background:color-mix(in srgb, #10b981 5%, var(--surface));
  border:1px solid color-mix(in srgb, #10b981 18%, var(--border-subtle));
}
.sp-payout-status-row--fail {
  background:color-mix(in srgb, #ef4444 5%, var(--surface));
  border:1px solid color-mix(in srgb, #ef4444 22%, var(--border-subtle));
}
.sp-payout-status-icon { font-weight:700; font-size:12px; text-transform:uppercase; letter-spacing:0.03em; }
.sp-payout-status-row--pass .sp-payout-status-icon { color:color-mix(in srgb, #10b981 70%, var(--text-primary)); }
.sp-payout-status-row--fail .sp-payout-status-icon { color:color-mix(in srgb, #ef4444 70%, var(--text-primary)); }
.sp-payout-status-channel { font-weight:700; color:var(--text-primary); }
.sp-payout-status-figure { color:var(--text-muted); }
.sp-payout-status-short { color:color-mix(in srgb, #ef4444 75%, var(--text-primary)); }

/* Channel details (always visible, no Advanced toggle) */
.sp-payout-channel-block {
  padding:0.7rem 0.85rem;
  border-radius:8px;
  background:var(--surface);
  border:1px solid var(--border-subtle);
  display:flex; flex-direction:column; gap:0.55rem;
}
.sp-payout-channel-h {
  margin:0; font-size:16px; font-weight:700; color:var(--text-primary);
}
.sp-payout-channel-hint {
  margin:0; font-size:14px; line-height:1.55;
}
.sp-payout-channel-hint strong { color:var(--text-primary); }

/* ===== sp2-*: calm-confident Smart Pricing redesign (2026-05-30) ===== */
/*
   A fresh namespace for the Smart Pricing tab restyle. Deliberately NOT
   reusing the older `sp-*` rules — those carry the "noisy/cheap" look we're
   replacing (sp-hero, sp-foundations-card, sp-compete-card, insight
   sub-cards). The new aesthetic is calm / confident / premium: fewer, larger
   sections; generous spacing; a single accent (var(--accent)); quiet pills
   and dots; understated controls.

   HARD RULES this block obeys (CLAUDE.md #5):
   - Theme tokens ONLY. No hardcoded hex/rgb. Every colour is var(--…) so
     light + dark are at parity by construction.
   - Semantic colour (on/off/health) uses --accent and --state-* only, and
     sparingly — no traffic-light dot spam.
   - Responsive: flex children get min-width:0; bands/stat-rows wrap and
     stack under 640px.

   The three presentational components that consume these classes live in
   apps/web/app/properties/ : PricingStatusBand, YourCompetition,
   PricingPerformanceSummary. If you rename a class here, grep those files.
*/

/* ── Section shell ────────────────────────────────────────────────────── */
.sp2-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  margin: 0;
  box-shadow: none;
}

.sp2-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 2px;
  line-height: 1.3;
}
.sp2-section-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* ── Status band ──────────────────────────────────────────────────────── */
.sp2-band {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-radius: var(--sp3-radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  /* Matches .sp2-section elevation so the status band reads as the same
     family of lifted surface (token shadow → dark in both themes). */
  box-shadow: var(--sp3-shadow-md);
}
.sp2-band-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-soft);
}
.sp2-band-dot.is-on {
  background: var(--accent);
  /* Soft halo so "on" reads alive without being loud. */
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.sp2-band-dot.is-off { background: var(--text-soft); }
.sp2-band-main { flex: 1; min-width: 0; }
.sp2-band-h {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}
.sp2-band-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 2px 0 0;
  line-height: 1.5;
}
.sp2-band-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Collapse to a stacked layout on narrow screens: the band wraps, the
   actions take the full width and sit below the headline. */
@media (max-width: 640px) {
  .sp2-band { flex-wrap: wrap; }
  .sp2-band-actions { width: 100%; }
  .sp2-band-actions .sp2-btn,
  .sp2-band-actions .sp2-btn-ghost { flex: 1; justify-content: center; }
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.sp2-btn,
.sp2-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--sp3-radius-sm);
  padding: 9px 17px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  /* sp3: animate the tactile lift (transform) alongside colour. */
  transition: filter var(--sp3-dur-1) var(--sp3-ease),
    border-color var(--sp3-dur-1) var(--sp3-ease),
    background var(--sp3-dur-1) var(--sp3-ease),
    box-shadow var(--sp3-dur-1) var(--sp3-ease),
    transform var(--sp3-dur-1) var(--sp3-ease);
  white-space: nowrap;
}
.sp2-btn {
  background: var(--accent);
  color: var(--accent-contrast);
  border: 1px solid var(--accent);
  box-shadow: var(--sp3-shadow-sm);
}
/* Tactile press: primary lifts a hair on hover, settles flat on press. */
.sp2-btn:hover:not(:disabled) { filter: brightness(0.96); transform: translateY(-1px); }
.sp2-btn:active:not(:disabled) { transform: translateY(0); filter: brightness(0.92); }
.sp2-btn-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.sp2-btn-ghost:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
}
.sp2-btn:disabled,
.sp2-btn-ghost:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
.sp2-btn:focus-visible,
.sp2-btn-ghost:focus-visible {
  outline: none;
  box-shadow: var(--sp3-ring);
}

/* ── Quiet pill ───────────────────────────────────────────────────────── */
.sp2-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid transparent;
  line-height: 1.4;
}
.sp2-pill--on {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
}

/* ── Disclosure (Details / Show on map) ───────────────────────────────── */
/* Real button affordance (host 2026-06-11: the expanders were invisible — "even I have to look
   for them"). Accent text + tinted fill + border so it reads as clickable at a glance; matches
   .sp-adj-adv-toggle so every expander on the tab looks the same. */
.sp2-disclosure {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 13px;
  line-height: 1.3;
  transition: background 120ms ease, border-color 120ms ease;
}
.sp2-disclosure:hover {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
}
.sp2-disclosure:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.sp2-disclosure-caret {
  display: inline-block;
  transition: transform 0.18s ease;
  font-size: 10px;
  line-height: 1;
}
.sp2-disclosure-caret.is-open { transform: rotate(90deg); }
.sp2-disclosure-body { margin-top: 14px; }

/* ── Health line ──────────────────────────────────────────────────────── */
.sp2-health {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.sp2-health-score {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  line-height: 1.4;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.sp2-health--good .sp2-health-score {
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 10%, var(--surface-muted));
  border-color: color-mix(in srgb, var(--state-success) 30%, var(--border-subtle));
}
.sp2-health-note {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 0;
  line-height: 1.4;
}

/* Read-only strategy chip in the status band masthead — informational only
   (never interactive). Quiet accent-tinted pill so it sits in the same family
   as the health-good chip without competing with it. sp3 tokens → light/dark
   parity by construction. */
.sp2-strat-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  line-height: 1.4;
  white-space: nowrap;
}

/* ── Performance line (slim) ──────────────────────────────────────────── */
.sp2-perf-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  min-width: 0;
}
.sp2-perf-copy { display:grid; gap:4px; min-width:0; }
.sp2-perf-headline {
  margin:0;
  font-size: 14px;
  color: var(--text-muted);
  min-width: 0;
  line-height: 1.5;
}
.sp2-perf-toggle { min-height:36px; font-size:13px; }
@media (max-width: 640px) {
  .sp2-perf-row { align-items:stretch; flex-direction:column; }
  .sp2-perf-toggle { align-self:flex-start; }}

/* ══════════════════════════════════════════════════════════════════════
   sp3 — premium foundation utilities (Wave 1)
   "Quiet precision instrument." Token-only (no hardcoded colour); the only
   raw values are the --sp3-shadow-color tokens defined up in :root. These
   utilities + the refinements applied to the sp2 / sp control classes
   above turn the calm sp2 layer into a tactile, layered, precision-numeral
   instrument. Light/dark parity is inherited from the tokens.
   Read docs/superpowers/specs/2026-06-01-pricing-tab-premium-redesign.md.
   ══════════════════════════════════════════════════════════════════════ */

/* Tabular numerals — the signature treatment. Apply to any price / % /
   figure so digits hold a fixed advance width (no horizontal jitter as a
   live preview ticks) and read like a precision instrument. */
.sp3-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: -0.01em;
}

/* Orchestrated mount reveal — the ONE motion moment. Top-level pricing
   sections fade + rise on mount, staggered by their --sp3-i index (set
   inline at the call site). Tasteful, not theatrical. */
@keyframes sp3-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.sp3-reveal {
  animation: sp3-rise var(--sp3-dur-3) var(--sp3-ease) both;
  animation-delay: calc(var(--sp3-i, 0) * 55ms);
  /* `both` holds the from-state until the (possibly delayed) start, so a
     later-indexed section doesn't flash visible before its turn. */
  will-change: opacity, transform;
}

/* Reduced-motion: honour the OS setting. Kill the reveal animation and
   make every sp3 control transition effectively instant — the look is
   preserved, only the movement is removed (WCAG 2.3.3 / 2.2.2). The 0.01ms
   (rather than 0) keeps transitionend listeners firing where any exist. */
@media (prefers-reduced-motion: reduce) {
  .sp3-reveal {
    animation: none;
  }
  .sp2-section,
  .sp2-band,
  .sp2-btn,
  .sp2-btn-ghost,
  .segmented-control-btn,
  .sp-input,
  .sp-sel-select,
  .sp-dir-btn,
  .sp-toggle-pill-mini,
  .sp-toggle-pill-mini-knob {
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   PricingPreviewCalendar (sp3-pc-*) — the in-tab price-preview SHOWPIECE.
   A 9-week heatmap calendar + "why this price" waterfall. All chrome uses theme
   tokens; the heat ramp and waterfall magnitude bars use color-mix() on tokens
   (the sanctioned data-viz exception) so they adapt to light AND dark
   automatically — see PricingPreviewCalendar.tsx banner for the legibility
   reasoning (cell text is always --text-primary; ramp caps accent mix at 62%).
   ════════════════════════════════════════════════════════════════════════════ */
.sp3-pc {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
  /* RESIZABLE-PANE RESPONSIVE: the side-pane that hosts this is user-resizable.
     Declaring an inline-size container here lets the @container breakpoints
     below react to THIS component's own width, not the viewport — so the grid
     ↔ compact-list swap tracks the pane as the host drags it. min-width:0 so a
     flex/grid parent can shrink us below content width without overflow. */
  container-type: inline-size;
  container-name: sp3pc;
  min-width: 0;
}
/* Sidebar variant: tighter top margin (the pane supplies its own section gap)
   and a hair smaller heat cells, so the grid reads calm even mid-width. */
.sp3-pc--sidebar { margin-top: 0; gap: 0.7rem; }

/* The compact narrow-pane list is hidden by default; the @container rule below
   reveals it (and hides the grid) only when the pane gets narrow. Kept in the
   DOM at all widths so the swap is instant on resize with no JS measurement. */
.sp3-pc-list { display: none; }

.sp3-pc-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--sp3-radius-sm);
}

/* ── Summary + legend bar ── */
.sp3-pc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.sp3-pc-summary {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}
.sp3-pc-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--sp3-radius-sm);
  background: var(--bg-elevated);
  min-width: 0;
}
.sp3-pc-stat--accent {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-elevated));
}
.sp3-pc-stat-val {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}
.sp3-pc-stat--accent .sp3-pc-stat-val {
  color: var(--accent);
}
.sp3-pc-stat-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.sp3-pc-legend {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sp3-pc-legend-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.sp3-pc-legend-ramp {
  width: 96px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  /* Same token-derived ramp the cells use (low → high). */
  background: linear-gradient(
    to right,
    var(--surface-muted),
    color-mix(in srgb, var(--accent) 62%, var(--surface-muted))
  );
}

/* ── Pending-changes summary ── */
.sp3-pc-pending {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 13px;
  color: var(--text-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: var(--sp3-radius-sm);
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.sp3-pc-pending strong { color: var(--text-primary); }
.sp3-pc-pending-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── Heatmap calendar grid ── */
.sp3-pc-cal {
  border: 1px solid var(--border-subtle);
  border-radius: var(--sp3-radius);
  background: var(--bg-elevated);
  box-shadow: var(--sp3-shadow-sm);
  overflow: hidden;
}
.sp3-pc-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-muted);
}
.sp3-pc-dow {
  padding: 0.4rem 0.3rem;
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.sp3-pc-body {
  padding: 0.35rem;
}
.sp3-pc-weekwrap { margin-bottom: 0.1rem; }
.sp3-pc-month {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 0.35rem 0.25rem 0.2rem;
}
.sp3-pc-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.3rem;
}

.sp3-pc-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.05rem;
  min-height: 66px;
  padding: 0.4rem 0.45rem 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--sp3-radius-sm);
  background: var(--surface-muted);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--sp3-dur-1) var(--sp3-ease),
    box-shadow var(--sp3-dur-1) var(--sp3-ease),
    border-color var(--sp3-dur-1) var(--sp3-ease);
}
.sp3-pc-cell:hover {
  transform: translateY(-1px);
  box-shadow: var(--sp3-shadow-sm);
  border-color: var(--border-strong);
  z-index: 1;
}
.sp3-pc-cell:focus-visible {
  outline: none;
  box-shadow: var(--sp3-ring);
  z-index: 2;
}
.sp3-pc-cell.is-selected {
  border-color: var(--accent);
  box-shadow: var(--sp3-ring);
  z-index: 2;
}
.sp3-pc-cell.is-focus {
  /* Jump-to-date target ring (2026-06-06) — a far-out play applied elsewhere landed on this
     cell. A solid accent outline, distinct from is-selected's box-shadow ring, so a cell that
     is BOTH focused and selected still reads clearly. Theme-tokened accent → light + dark parity. */
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  z-index: 3;
}
.sp3-pc-cell.is-today {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong));
}
.sp3-pc-cell.is-today::after {
  content: "Today";
  position: absolute;
  top: 0.25rem;
  right: 0.3rem;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.sp3-pc-cell.is-wknd {
  /* Subtle weekend tint layered UNDER the heat background via the border only —
     keeps the heat ramp readable while still signalling Sat/Sun. */
  border-color: color-mix(in srgb, var(--accent) 18%, var(--border-subtle));
}
.sp3-pc-cell.is-booked {
  background: repeating-linear-gradient(
    45deg,
    var(--surface-muted),
    var(--surface-muted) 5px,
    color-mix(in srgb, var(--text-muted) 14%, var(--surface-muted)) 5px,
    color-mix(in srgb, var(--text-muted) 14%, var(--surface-muted)) 10px
  );
  cursor: pointer;
  color: var(--text-muted);
}
.sp3-pc-cell--empty {
  background: transparent;
  border: 1px dashed var(--border-subtle);
  cursor: default;
  opacity: 0.4;
}
.sp3-pc-dn {
  /* The DATE must be readable (host feedback "can you read the dates?") — was 0.6rem/muted, now a
     clear 0.8rem in the softer text tone, sitting cleanly at the cell's top-left. */
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-soft);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sp3-pc-price {
  /* The price is the hero of the cell — bumped + tabular so the column reads cleanly. */
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: auto;
}
.sp3-pc-booked-lbl {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.1;
  margin-top: auto;
}
.sp3-pc-ms {
  position: absolute;
  bottom: 0.28rem;
  right: 0.3rem;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--state-warning) 22%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--state-warning) 35%, transparent);
}
.sp3-pc-pending-cell-dot {
  position: absolute;
  top: 0.3rem;
  right: 0.32rem;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

/* ── "Why this price" waterfall ── */
.sp3-pc-wf {
  border: 1px solid var(--border-subtle);
  border-radius: var(--sp3-radius);
  background: var(--bg-elevated);
  box-shadow: var(--sp3-shadow-md);
  padding: 0.85rem 1rem 1rem;
}
.sp3-pc-wf-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.sp3-pc-wf-head-main { min-width: 0; }
.sp3-pc-wf-date {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}
.sp3-pc-wf-headerdelta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.sp3-pc-wf-headerdelta-amt {
  font-weight: 800;
}
.sp3-pc-wf-headerdelta-amt--up { color: var(--accent); }
.sp3-pc-wf-headerdelta-amt--down { color: var(--state-warning); }
.sp3-pc-wf-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background-color var(--sp3-dur-1) var(--sp3-ease), color var(--sp3-dur-1) var(--sp3-ease);
}
.sp3-pc-wf-close:hover { background: var(--border-subtle); color: var(--text-primary); }
.sp3-pc-wf-close:focus-visible { outline: none; box-shadow: var(--sp3-ring); }

.sp3-pc-wf-rows {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sp3-pc-wf-row {
  display: grid;
  grid-template-columns: minmax(7rem, 1.1fr) minmax(60px, 2fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.28rem 0;
}
.sp3-pc-wf-lbl {
  font-size: 13px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp3-pc-wf-row--base .sp3-pc-wf-lbl,
.sp3-pc-wf-row--final .sp3-pc-wf-lbl {
  font-weight: 800;
  color: var(--text-primary);
}
.sp3-pc-wf-bar-wrap {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  overflow: hidden;
}
.sp3-pc-wf-row--base .sp3-pc-wf-bar-wrap,
.sp3-pc-wf-row--final .sp3-pc-wf-bar-wrap,
.sp3-pc-wf-row--ms .sp3-pc-wf-bar-wrap {
  background: transparent;
}
.sp3-pc-wf-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 999px;
  transition: width var(--sp3-dur-2) var(--sp3-ease);
}
.sp3-pc-wf-amt {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  text-align: right;
}
.sp3-pc-wf-delta {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sp3-pc-wf-delta--up { color: var(--accent); }
.sp3-pc-wf-delta--down { color: var(--state-warning); }
.sp3-pc-wf-pct {
  font-weight: 600;
  opacity: 0.8;
}
.sp3-pc-wf-run {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.sp3-pc-wf-row--base .sp3-pc-wf-run {
  font-weight: 800;
  color: var(--text-primary);
  font-size: 14px;
}
.sp3-pc-wf-dormant {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0.3rem 0;
  font-style: italic;
}
.sp3-pc-wf-guard {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 13px;
  font-weight: 700;
  padding: 0.4rem 0.55rem;
  margin: 0.2rem 0;
  border-radius: var(--sp3-radius-sm);
}
.sp3-pc-wf-guard-icon { font-size: 16px; line-height: 1; }
.sp3-pc-wf-guard--floor {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.sp3-pc-wf-guard--ceil {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 9%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--state-warning) 30%, transparent);
}
.sp3-pc-wf-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.35rem 0;
}
.sp3-pc-wf-final {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.sp3-pc-wf-row--ms .sp3-pc-wf-run {
  font-weight: 800;
  color: var(--text-primary);
}

/* ── Stay-mode / engine-off explainer (sp3-pc-mode-note) ──────────────────────
   Shown instead of the grid for long-let mode (no nightly engine) and when the
   engine is off. Calm, honest, premium — a tokenised icon + title + copy. */
.sp3-pc-mode-note {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--sp3-radius);
  background: var(--bg-elevated);
  box-shadow: var(--sp3-shadow-sm);
}
.sp3-pc-mode-note--long {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, var(--bg-elevated)), var(--bg-elevated));
}
.sp3-pc-mode-note-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.sp3-pc-mode-note-body { min-width: 0; }
.sp3-pc-mode-note-title {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}
.sp3-pc-mode-note-txt {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-soft);
}
.sp3-pc-mode-note-txt--soft {
  margin-top: 0.45rem;
  color: var(--text-muted);
}

/* ── Hybrid "short-let view" tag — a quiet pill above the heatmap ──────────── */
.sp3-pc-modetag {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-muted));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
}

/* ── Compact narrow-pane list (sp3-pc-list) ───────────────────────────────────
   The graceful degrade for a narrow resizable pane: a vertical list of upcoming
   nights, each row = weekday/date · (pending dot) · min-stay badge · vs-base
   colour chip · price. Tapping a row opens the SAME waterfall as a grid cell.
   Hidden by default (.sp3-pc-list above); the @container rule reveals it. */
.sp3-pc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--sp3-radius);
  background: var(--bg-elevated);
  box-shadow: var(--sp3-shadow-sm);
  overflow: hidden;
}
.sp3-pc-list > li { margin: 0; }
.sp3-pc-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 42px;
  padding: 0.5rem 0.7rem;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--sp3-dur-1) var(--sp3-ease);
}
.sp3-pc-list > li:last-child .sp3-pc-list-row { border-bottom: none; }
.sp3-pc-list-row:hover { background: var(--surface-muted); }
.sp3-pc-list-row:focus-visible { outline: none; box-shadow: var(--sp3-ring); z-index: 1; position: relative; }
.sp3-pc-list-row.is-selected {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  box-shadow: inset 2px 0 0 0 var(--accent);
}
.sp3-pc-list-row.is-today { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.sp3-pc-list-row.is-wknd .sp3-pc-list-dow { color: color-mix(in srgb, var(--accent) 60%, var(--text-muted)); }
.sp3-pc-list-row.is-booked { cursor: pointer; }
.sp3-pc-list-row.is-booked .sp3-pc-list-dnum { color: var(--text-muted); }
.sp3-pc-list-date {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  min-width: 0;
}
.sp3-pc-list-dow {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  width: 1.9rem;
  flex-shrink: 0;
}
.sp3-pc-list-dnum {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sp3-pc-list-today {
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  flex-shrink: 0;
}
.sp3-pc-list-mid {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}
.sp3-pc-list-pend {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  flex-shrink: 0;
}
.sp3-pc-list-ms {
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: 999px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--state-warning) 22%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--state-warning) 35%, transparent);
}
/* vs-base direction chip — token-derived (same accent/warning/muted language as
   the waterfall deltas). up = engine pushed above base, down = below, flat = at. */
.sp3-pc-list-chip {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.sp3-pc-list-chip--up { background: color-mix(in srgb, var(--accent) 78%, transparent); }
.sp3-pc-list-chip--down { background: color-mix(in srgb, var(--state-warning) 70%, transparent); }
.sp3-pc-list-chip--flat { background: color-mix(in srgb, var(--text-muted) 40%, transparent); }
.sp3-pc-list-price {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: right;
  white-space: nowrap;
}
.sp3-pc-list-booked {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
}
/* 2026-07-09 visual pass — month landmarks, collapsed booked runs, weekend
   tint, and a one-line pager. All token-derived (light/dark for free). */
.sp3-pc-list-month {
  padding: 0.5rem 0.7rem 0.2rem;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.sp3-pc-list-run { grid-template-columns: minmax(0, 1fr) auto; }
.sp3-pc-list-run .sp3-pc-list-dnum { color: var(--text-muted); font-weight: 600; }
/* Same hatch language as the grid's booked cells, at whisper volume. */
.sp3-pc-list-row.sp3-pc-list-run {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    color-mix(in srgb, var(--text-muted) 7%, transparent) 5px 10px
  );
}
.sp3-pc-list-row.is-wknd { background: color-mix(in srgb, var(--accent) 3%, transparent); }
.sp3-pc-list-row.is-wknd:hover { background: var(--surface-muted); }
.sp3-pc-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 10px;
}
.sp3-pc-pager-btn { padding: 4px 10px; font-size: 14px; line-height: 1.1; }
.sp3-pc-pager-btn[disabled] { opacity: 0.45; }
.sp3-pc-pager-range {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── @container responsive (KEY) ──────────────────────────────────────────────
   These react to the .sp3-pc container width (the resizable pane), NOT the
   viewport. Wide stays as the full grid; narrow swaps to the compact list and
   reflows the waterfall + summary so nothing ever overflows or squashes. */

/* Mid (≤ 420px): tighten the heatmap so 7 columns still read before we drop to
   the list — smaller cells, smaller type, the legend hides to free width. */
@container sp3pc (max-width: 420px) {
  .sp3-pc-cell { min-height: 50px; padding: 0.3rem 0.32rem; }
  .sp3-pc-price { font-size: 0.76rem; }
  .sp3-pc-week { gap: 0.22rem; }
  .sp3-pc-body { padding: 0.28rem; }
  .sp3-pc-legend { display: none; }
  .sp3-pc-summary { gap: 0.4rem; }
  .sp3-pc-stat { padding: 0.4rem 0.55rem; }
}

/* Narrow (≤ 360px): the 7-col grid can no longer read — swap to the compact
   vertical list. Grid out, list in. The waterfall stays useful below. */
@container sp3pc (max-width: 360px) {
  .sp3-pc-cal { display: none; }
  .sp3-pc-list { display: flex; }
  /* The min/max/avg summary stays but goes full-width row of three. */
  .sp3-pc-bar { gap: 0.5rem; }
  .sp3-pc-summary { width: 100%; justify-content: space-between; }
  .sp3-pc-stat { flex: 1; align-items: center; text-align: center; }
}

/* Narrow waterfall reflow (≤ 360px): drop the magnitude-bar column and stack
   label over amount so the figures stay legible in a slim pane. */
@container sp3pc (max-width: 360px) {
  .sp3-pc-wf { padding: 0.7rem 0.8rem 0.85rem; }
  .sp3-pc-wf-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem;
  }
  .sp3-pc-wf-bar-wrap { display: none; }
  .sp3-pc-wf-amt { flex-direction: row; align-items: baseline; gap: 0.4rem; }
}

/* Very narrow (≤ 260px): even the date+price row gets tight — let the date
   number wrap under the weekday and keep the price hard-right. */
@container sp3pc (max-width: 260px) {
  .sp3-pc-list-date { flex-wrap: wrap; gap: 0.1rem 0.35rem; }
  .sp3-pc-list-row { padding: 0.45rem 0.55rem; gap: 0.35rem; }
  .sp3-pc-wf-date { font-size: 0.84rem; }
}

/* ── Intelligence Context Core (pi- namespace). Theme tokens only → light/dark parity. ── */
.pi-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--sp3-radius, 14px);
  padding: 20px;
  margin-bottom: 20px;
  min-width: 0;
}
.pi-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.pi-card-headings { min-width: 0; }
.pi-card-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); margin: 0; }
.pi-card-sub { font-size: 0.78rem; color: var(--text-muted); margin: 4px 0 0; }
.pi-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.pi-pill {
  font-size: 0.7rem; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-subtle); white-space: nowrap;
}
.pi-pill-ok { color: var(--state-success); background: color-mix(in srgb, var(--state-success) 14%, transparent); border-color: color-mix(in srgb, var(--state-success) 30%, transparent); }
.pi-pill-warn { color: var(--state-warning); background: color-mix(in srgb, var(--state-warning) 14%, transparent); border-color: color-mix(in srgb, var(--state-warning) 30%, transparent); }
.pi-pill-busy { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.pi-pill-muted { color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 10%, transparent); }

.pi-token { font-size: 0.7rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pi-token-amber { color: var(--state-warning); }

.pi-btn {
  font-size: 0.78rem; font-weight: 600; padding: 6px 12px; border-radius: 9px; cursor: pointer;
  color: var(--text-primary); background: var(--bg-input); border: 1px solid var(--border-subtle);
  transition: filter 120ms ease, transform 120ms ease;
}
.pi-btn:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); }
.pi-btn:disabled { opacity: 0.55; cursor: default; }
.pi-btn-primary { color: #fff; background: var(--accent); border-color: transparent; }

.pi-guide { border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.pi-guide-md {
  white-space: pre-wrap; word-break: break-word; margin: 0; font: inherit;
  font-size: 0.82rem; line-height: 1.5; color: var(--text-soft);
}
.pi-empty { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

.pi-editor {
  width: 100%; min-width: 0; box-sizing: border-box; resize: vertical;
  background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: 10px; padding: 12px;
  font: inherit; font-size: 0.85rem; line-height: 1.5;
}
.pi-editor:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle)); }
.pi-editor-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

.pi-seed { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

.pi-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pi-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 11px;
  border: 1px solid var(--border-subtle); border-radius: 999px; background: var(--bg-input);
  font-size: 0.76rem; color: var(--text-primary); max-width: 100%;
}
.pi-chip-label { font-weight: 600; white-space: nowrap; }
.pi-chip-value { color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-chip-accept, .pi-chip-reject {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  border-radius: 999px; border: none; cursor: pointer; font-size: 0.72rem; line-height: 1;
}
.pi-chip-accept { color: var(--state-success); background: color-mix(in srgb, var(--state-success) 16%, transparent); }
.pi-chip-reject { color: var(--text-muted); background: color-mix(in srgb, var(--text-muted) 12%, transparent); }
.pi-chip-accept:hover:not(:disabled), .pi-chip-reject:hover:not(:disabled) { filter: brightness(1.1); }
.pi-chip-accept:disabled, .pi-chip-reject:disabled { opacity: 0.5; cursor: default; }

.pi-facts-accepted { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pi-fact-pill {
  font-size: 0.76rem; color: var(--text-soft); padding: 4px 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-input)); border: 1px solid var(--border-subtle);
}

.pi-comment-add { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; }
.pi-comment-textarea, .pi-comment-input {
  width: 100%; min-width: 0; box-sizing: border-box; background: var(--bg-input); color: var(--text-primary);
  border: 1px solid var(--border-subtle); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 0.82rem;
}
.pi-comment-textarea:focus, .pi-comment-input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle)); }
.pi-comment-add .pi-btn { align-self: flex-end; }
.pi-comment {
  border-top: 1px solid var(--border-subtle); padding: 12px 0;
}
.pi-comment-head { display: flex; align-items: center; gap: 8px; }
.pi-comment-author { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); }
.pi-comment-time { font-size: 0.7rem; color: var(--text-muted); }
.pi-comment-resolve {
  margin-left: auto; font-size: 0.7rem; color: var(--accent); background: none; border: none; cursor: pointer; padding: 2px 4px;
}
.pi-comment-resolve:disabled { opacity: 0.5; cursor: default; }
.pi-comment-body { font-size: 0.82rem; color: var(--text-soft); margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.pi-comment-replyrow { margin: 8px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--border-subtle); }
.pi-comment-reply { display: flex; gap: 8px; margin: 8px 0 0 14px; }
.pi-comment-reply .pi-comment-input { flex: 1; min-width: 0; }
.pi-comment-done .pi-comment-body { color: var(--text-muted); }
.pi-comment-resolved { margin-top: 12px; }
.pi-comment-resolved > summary { font-size: 0.76rem; color: var(--text-muted); cursor: pointer; }

/* Collapse toggle + caret */
.pi-collapse { display: inline-flex; align-items: center; gap: 7px; background: none; border: none; padding: 0; cursor: pointer; color: inherit; }
.pi-caret { font-size: 0.7rem; color: var(--text-muted); transition: transform 140ms ease; }
.pi-caret.is-open { transform: rotate(90deg); }

/* Purpose segmented control */
.pi-purpose { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 12px; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 10px; flex-wrap: wrap; }
.pi-purpose-tab { font-size: 0.74rem; font-weight: 600; padding: 4px 11px; border-radius: 7px; border: none; background: transparent; color: var(--text-muted); cursor: pointer; }
.pi-purpose-tab.is-active { background: var(--bg-elevated); color: var(--text-primary); box-shadow: var(--sp3-shadow-sm, 0 1px 2px rgba(0,0,0,0.08)); }
.pi-purpose-tab:disabled { opacity: 0.6; cursor: default; }

/* Markdown (read-only guide) */
.pi-md { font-size: 0.84rem; line-height: 1.55; color: var(--text-soft); }
.pi-md-h { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); margin: 14px 0 6px; text-transform: none; }
.pi-md-h:first-child { margin-top: 0; }
.pi-md-p { margin: 0 0 8px; }
.pi-md-ul { margin: 0 0 10px; padding-left: 18px; }
.pi-md-ul li { margin: 2px 0; }

/* Context entries list */
.pi-entries { list-style: none; margin: 8px 0 0; padding: 0; }
.pi-entry { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.pi-entry-main { min-width: 0; }
.pi-entry-cat { display: inline-block; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent); margin-bottom: 3px; }
.pi-entry-body { font-size: 0.82rem; color: var(--text-soft); margin: 0; white-space: pre-wrap; word-break: break-word; }
.pi-entry-meta { font-size: 0.68rem; color: var(--text-muted); }
.pi-entry-archive { flex-shrink: 0; font-size: 0.72rem; color: var(--text-muted); background: none; border: 1px solid var(--border-subtle); border-radius: 7px; padding: 4px 9px; cursor: pointer; }
.pi-entry-archive:hover:not(:disabled) { color: var(--state-error); border-color: color-mix(in srgb, var(--state-error) 40%, transparent); }
.pi-entry-archive:disabled { opacity: 0.5; cursor: default; }

/* Secrets vault (pane 4) */
.pi-vault { margin-top: 6px; }
.pi-vault-banner {
  font-size: 0.72rem; color: var(--text-muted); margin: 4px 0 10px; padding: 8px 10px;
  background: color-mix(in srgb, var(--state-warning) 8%, transparent);
  border-left: 2px solid color-mix(in srgb, var(--state-warning) 45%, transparent); border-radius: 4px;
}
.pi-vault-warn { font-size: 0.74rem; color: var(--state-warning); margin: 0 0 10px; }
.pi-vault-add { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.pi-vault-list { list-style: none; margin: 0; padding: 0; }
.pi-vault-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.pi-vault-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pi-vault-code { font-variant-numeric: tabular-nums; font-size: 0.82rem; color: var(--text-primary); letter-spacing: 0.04em; word-break: break-all; }
.pi-vault-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Properties → Management pane 4: custom fields panel (PropertiesCustomFieldsNav).
   Layout glue only — inputs/buttons reuse the pi-* family above. */
.pcf-root { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 20px; }
.pcf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pcf-head .pi-vault-banner { margin: 0; flex: 1; }
.pcf-upload-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 10px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border-subtle));
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
  color: var(--text-primary);
  font-size: 0.74rem;
}
.pcf-upload-progress > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pcf-upload-track {
  display: block;
  grid-column: 1 / -1;
  grid-row: 2;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-subtle);
}
.pcf-upload-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}
.pcf-upload-progress button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.pcf-empty { font-size: 0.8rem; color: var(--text-secondary); margin: 4px 0; }
.pcf-error {
  font-size: 0.76rem; color: var(--state-danger, #d33); margin: 0;
  padding: 6px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--state-danger, #d33) 8%, transparent);
}
.pcf-section-label {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-secondary); margin: 10px 0 2px;
}
.pcf-field { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.pcf-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pcf-field-label { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); min-width: 0; }
.pcf-field-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pcf-copy-btn { font-size: 0.68rem; padding: 2px 8px; }
.pcf-textarea { min-height: 60px; resize: vertical; }
.pcf-choice-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pcf-chip {
  font-size: 0.74rem; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-subtle); background: var(--bg-elevated); color: var(--text-primary);
}
.pcf-chip[data-on] { background: var(--accent); border-color: transparent; color: #fff; }
.pcf-chip:disabled { opacity: 0.6; cursor: default; }
/* Checklist fields render the task modal's checklist chrome
   (task-modal-checklist-*) so a checklist reads the same here as on the
   task it ends up attached to — this wrapper only stacks the sections. */
.pcf-checklist { display: flex; flex-direction: column; gap: 4px; }
.pcf-files { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pcf-files-grid { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.pcf-file-thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-subtle); }
.pcf-file-open {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.pcf-file-thumb .pcf-file-open { width: 100%; height: 100%; }
.pcf-file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcf-file-remove {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; line-height: 1;
  border-radius: 50%; border: none; cursor: pointer; font-size: 0.66rem;
  background: color-mix(in srgb, #000 55%, transparent); color: #fff;
}
.pcf-file-row { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; max-width: 100%; }
.pcf-file-row .pcf-file-open:hover { text-decoration: underline; }
/* People fields: contact/Group chips + the find-people popover. Popover chrome
   is the canonical tag-picker contract (.properties-tag-picker etc.) — rules
   here only size the chips and the two-control search row. */
.pcf-people { position: relative; }
.pcf-people-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pcf-person-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-size: 0.74rem; padding: 3px 8px 3px 4px; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: var(--bg-elevated); color: var(--text-primary);
}
.pcf-person-chip.is-gone { opacity: 0.65; border-style: dashed; }
.pcf-person-chip-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; display: inline-flex; flex: 0 0 auto; }
.pcf-person-chip-group {
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; flex: 0 0 auto; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.pcf-person-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcf-person-chip-meta { color: var(--text-muted); font-size: 0.68rem; flex-shrink: 0; }
.pcf-person-chip-x {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  padding: 0; border: none; background: none; color: var(--text-muted); cursor: pointer; border-radius: 50%;
}
.pcf-person-chip-x:hover { color: var(--text-primary); background: color-mix(in srgb, var(--text-primary) 10%, transparent); }
.pcf-people-picker { width: 300px; }
.pcf-people-picker-controls { display: flex; gap: 6px; }
.pcf-people-picker-controls .filter-input { min-width: 0; flex: 1; }
.pcf-people-picker-filter { flex: 0 0 auto; max-width: 45%; }
.pcf-people-option { display: flex; align-items: center; gap: 8px; }
.pcf-people-option-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.pcf-people-option-meta { color: var(--text-muted); font-size: 0.68rem; flex-shrink: 0; }
.properties-intel-legacy-list {
  display: grid;
  gap: 6px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}
.properties-intel-legacy-list li { display: grid; gap: 2px; font-size: 0.74rem; }
.properties-intel-legacy-list li > strong { color: var(--text-primary); }
.properties-intel-legacy-list li > span { color: var(--text-muted); overflow-wrap: anywhere; }
.pcf-sync-tag {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; cursor: pointer;
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent);
}
.pcf-sync-value { font-size: 0.78rem; color: var(--text-primary); white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.pcf-confirm {
  display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding: 8px;
  border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-elevated);
}
.pcf-confirm p { margin: 0; font-size: 0.74rem; color: var(--text-secondary); }
.pcf-confirm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pcf-build { display: flex; flex-direction: column; gap: 10px; }
.pcf-add-form { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border-subtle); }
.pcf-build-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; border-top: 1px solid var(--border-subtle); }
.pcf-build-main { display: flex; align-items: center; gap: 8px; }
.pcf-build-main .pi-comment-input { flex: 1; min-width: 0; }
.pcf-build-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pcf-build-controls .selectmenu-trigger.pi-comment-input { width: auto; flex: 1; min-width: 0; }

/* Editor-first tab layout */
.pi-tab { display: flex; flex-direction: column; gap: 16px; padding: 20px; min-width: 0; overflow-y: auto; height: 100%; }
.pi-notes {
  background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: var(--sp3-radius, 14px);
  padding: 22px 26px; min-width: 0;
  display: flex; flex-direction: column; flex: 1 0 auto;
}
.pi-notes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

/* Intelligence sub-tabs + Captured panel (spec Slice A). Tokens: this project's Intelligence
   vocabulary (--text-primary, --text-muted, --accent, --bg-input, --bg-elevated, --border-subtle)
   so light/dark parity is free (CLAUDE.md #5). Classes are prefixed pi-cap to avoid colliding
   with the existing .pi-chip fact-chip. */
.pi-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); }
.pi-subtab { appearance: none; background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 14px; font-size: 0.82rem; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.pi-subtab:hover { color: var(--text-primary); }
.pi-subtab.is-active { color: var(--text-primary); border-bottom-color: var(--accent); }
.pi-cap { display: flex; flex-direction: column; gap: 12px; }
.pi-cap-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pi-cap-search { display: flex; align-items: center; gap: 6px; flex: 1 1 220px; border: 1px solid var(--border-subtle); border-radius: 9px; padding: 6px 10px; background: var(--bg-input); color: var(--text-muted); }
.pi-cap-search input { border: none; outline: none; background: transparent; flex: 1; min-width: 0; font: inherit; font-size: 0.82rem; color: var(--text-primary); }
.pi-cap-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pi-cap-chip { border: 1px solid var(--border-subtle); border-radius: 999px; background: var(--bg-input); color: var(--text-muted); font-size: 0.72rem; font-weight: 600; padding: 4px 11px; cursor: pointer; white-space: nowrap; }
.pi-cap-chip:hover { color: var(--text-primary); }
.pi-cap-chip.is-active { background: var(--accent); border-color: transparent; color: #fff; }
.pi-cap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pi-cap-card { border: 1px solid var(--border-subtle); border-radius: 11px; background: var(--bg-elevated); padding: 10px 13px; display: flex; flex-direction: column; gap: 6px; }
.pi-cap-card.is-dismissed { opacity: 0.55; }
.pi-cap-card.is-negative { border-left: 3px solid color-mix(in srgb, var(--state-error) 60%, transparent); }
.pi-cap-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pi-cap-source { display: inline-flex; align-items: center; gap: 5px; font-size: 0.74rem; font-weight: 600; color: var(--text-primary); }
.pi-cap-cat { font-size: 0.72rem; color: var(--text-muted); text-transform: capitalize; }
.pi-cap-when { font-size: 0.72rem; color: var(--text-muted); margin-left: auto; }
.pi-cap-dismiss { appearance: none; border: none; background: none; color: var(--text-muted); cursor: pointer; padding: 2px; display: inline-flex; border-radius: 6px; }
.pi-cap-dismiss:hover { color: var(--text-primary); }
.pi-cap-summary { margin: 0; font-size: 0.82rem; color: var(--text-primary); }
.pi-cap-fix { margin: 0; font-size: 0.79rem; color: var(--text-muted); }
.pi-cap-quote summary { font-size: 0.72rem; color: var(--text-muted); cursor: pointer; }
.pi-cap-quote blockquote { margin: 6px 0 0; padding: 6px 10px; border-left: 2px solid var(--border-subtle); font-size: 0.79rem; color: var(--text-soft); white-space: pre-wrap; word-break: break-word; }
.pi-cap-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.79rem; color: var(--accent); text-decoration: none; }
.pi-cap-link:hover { text-decoration: underline; }
.pi-cap-card-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pi-cap-promote-button { display: inline-flex; align-items: center; gap: 5px; }
.pi-cap-promote { display: flex; flex-direction: column; gap: 7px; padding-top: 8px; border-top: 1px solid var(--border-subtle); }
.pi-cap-promote label { font-size: 0.74rem; font-weight: 600; color: var(--text-primary); }
.pi-cap-promote textarea { width: 100%; box-sizing: border-box; resize: vertical; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 8px 10px; background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 0.82rem; line-height: 1.45; }
.pi-cap-promote textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; }
.pi-cap-promote-actions { display: flex; align-items: center; gap: 7px; }
.pi-cap-promotion-status { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; color: var(--accent); }
.pi-cap-promotion-error { margin: 0; font-size: 0.76rem; color: var(--state-error); }
.pi-cap-error { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--text-muted); }
.pi-cap-more { align-self: flex-start; }
@media (max-width: 768px) { .pi-cap-controls { flex-direction: column; align-items: stretch; } .pi-cap-when { margin-left: 0; } }
.pi-notes-status { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Full-page editor: a real page, not a small scrollable box. The ProseMirror fills a tall area so
   clicking ANYWHERE places the cursor and you write there (Notion-style). Scoped to the Intelligence
   tab so the legacy boxed usage elsewhere is untouched. */
.pi-notes-editor { display: flex; flex-direction: column; min-height: 0; }
.pi-notes-editor .property-intel-editor-wrap { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pi-notes-editor .property-intel-editor-surface {
  max-height: none;
  min-height: 0;
  flex: 1;
  resize: none;
  border: none;
  background: transparent;
  overflow: visible;
  border-radius: 0;
}
.pi-notes-editor .property-intel-editor .ProseMirror {
  min-height: 62vh;          /* a full page of writing room — click anywhere below text to write */
  padding: 0.5rem 0.25rem 4rem;
  font-size: 0.96rem;
  line-height: 1.7;
  cursor: text;
}
.pi-seed-inline {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--text-soft); margin-bottom: 14px; padding: 12px 14px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-input)); border: 1px dashed var(--border-subtle); border-radius: 10px;
}

@media (max-width: 768px) {
  .pi-card-head { flex-direction: column; align-items: stretch; }
  .pi-seed { flex-direction: column; align-items: stretch; }
  .pi-entry { flex-direction: column; }
  .pi-purpose { width: 100%; }
  .pi-vault-item { flex-direction: column; }
  .pi-tab { padding: 14px; }
  .pi-notes-head { flex-direction: column; }
  .pi-seed-inline { flex-direction: column; align-items: stretch; }
}

/* Property assistant (AI pane, pane 5) */
.pa-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pa-head { padding: 4px 2px 12px; }
.pa-title { display: block; font-size: 0.9rem; color: var(--text-primary); }
.pa-sub { font-size: 0.7rem; color: var(--text-muted); }
.pa-thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.pa-empty { color: var(--text-muted); font-size: 0.82rem; }
.pa-empty p { margin: 0 0 12px; }
.pa-starters { display: flex; flex-direction: column; gap: 6px; }
.pa-starter {
  text-align: left; font-size: 0.78rem; color: var(--text-soft); background: var(--bg-input);
  border: 1px solid var(--border-subtle); border-radius: 9px; padding: 8px 10px; cursor: pointer;
}
.pa-starter:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle)); }
.pa-msg { font-size: 0.82rem; line-height: 1.5; padding: 9px 12px; border-radius: 12px; max-width: 92%; white-space: pre-wrap; word-break: break-word; }
.pa-msg-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.pa-msg-assistant { align-self: flex-start; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-subtle); border-bottom-left-radius: 4px; }
.pa-thinking { color: var(--text-muted); font-style: italic; }
.pa-compose { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.pa-input {
  flex: 1; min-width: 0; background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-subtle);
  border-radius: 9px; padding: 8px 11px; font: inherit; font-size: 0.82rem;
}
.pa-input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle)); }
/* ── Documents — the company "drive" (/documents) ───────────────────────────
   Pane 2 = drive tree, pane 3 = editor/file view, pane 4 = details. All theme-
   token based for light/dark parity. */

/* Pane 2 — list/tree */
.doc-list-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.doc-list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.7rem 0.8rem 0.5rem;
}
.doc-list-head h2 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); min-width: 0; }
.doc-list-actions { display: inline-flex; gap: 0.3rem; flex-shrink: 0; }
.doc-list-actions button {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border-subtle); background: var(--bg-input);
  color: var(--text-soft); cursor: pointer; transition: color .12s, border-color .12s, background .12s;
}
.doc-list-actions button:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle)); }
/* Pin lucide icon size — flex contexts were shrinking the unconstrained svg. */
.doc-list-actions button svg { width: 18px; height: 18px; flex-shrink: 0; }
.doc-list-new svg, .doc-tree-add svg, .doc-drive-btn svg, .doc-crumb svg { flex-shrink: 0; }

.doc-list-new {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0.7rem 0.6rem; padding: 0.6rem 0.7rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  border-radius: 9px; background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent); font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.doc-list-new:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.doc-upload-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 10px;
  margin: 0 0.7rem 0.6rem;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
  color: var(--text-primary);
  font-size: 0.76rem;
}
.doc-drive > .doc-upload-status { margin: 0.75rem 1.4rem 0; }
.doc-upload-status > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-upload-track {
  display: block;
  grid-column: 1 / -1;
  grid-row: 2;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border-subtle);
}
.doc-upload-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}
.doc-upload-status button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.doc-upload-error {
  margin: 0 0.7rem 0.6rem;
  padding: 7px 9px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--state-danger) 8%, transparent);
  color: var(--state-danger);
  font-size: 0.76rem;
}
.doc-drive > .doc-upload-error { margin: 0.75rem 1.4rem 0; }

/* Documents search reuses the shared .workspace-list-toolbar (same as /inbox) —
   no bespoke .doc-search styles. */

.doc-tree { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0.4rem 0.8rem; }
.doc-tree-empty { padding: 1rem 0.8rem; color: var(--text-muted); font-size: 0.84rem; }
.doc-tree-group { display: flex; flex-direction: column; }
.doc-tree-folder, .doc-tree-doc, .doc-tree-add {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 0.45rem 0.55rem; border-radius: 7px; color: var(--text-primary);
  font-size: 0.88rem; line-height: 1.25;
}
.doc-tree-folder:hover, .doc-tree-doc:hover, .doc-tree-add:hover {
  background: color-mix(in srgb, var(--border-subtle) 55%, transparent);
}
.doc-tree-doc.is-active {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-input));
  color: var(--text-primary); font-weight: 600;
}
.doc-tree-ico { flex-shrink: 0; color: var(--text-soft); }
.doc-tree-doc.is-active .doc-tree-ico { color: var(--accent); }
.doc-tree-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-tree-count { color: var(--text-muted); font-size: 0.74rem; }
.doc-tree-chevron { flex-shrink: 0; color: var(--text-muted); transition: transform .12s; }
.doc-tree-chevron.is-open { transform: rotate(90deg); }
.doc-tree-add { color: var(--text-muted); font-size: 0.8rem; }
.doc-tree-add:hover { color: var(--accent); }

/* ── Tasks pane-2 Streams tree (TasksListPane) ───────────────────────────────
   The Folders to Streams navigator. Same visual language as the documents tree
   above (shared theme tokens give automatic light/dark parity), named for the
   Tasks surface per CLAUDE.md #9. Plan 4 folds the stream- and tasks- classes
   into the workspace- system. */
.stream-list-pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.stream-list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.7rem 0.8rem 0.5rem;
}
.stream-list-head h2 { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); min-width: 0; }
.stream-list-actions { display: inline-flex; gap: 0.3rem; flex-shrink: 0; }
.stream-list-actions button {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border-subtle); background: var(--bg-input);
  color: var(--text-soft); cursor: pointer; transition: color .12s, border-color .12s, background .12s;
}
.stream-list-actions button:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle)); }
.stream-list-actions button svg { width: 18px; height: 18px; flex-shrink: 0; }
.stream-list-actions button:disabled { opacity: 0.5; cursor: default; }

.stream-list-new {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0.7rem 0.6rem; padding: 0.6rem 0.7rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  border-radius: 9px; background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent); font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.stream-list-new svg { flex-shrink: 0; }
.stream-list-new:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.stream-list-new:disabled { opacity: 0.5; cursor: default; }

.stream-tree { flex: 1; min-height: 0; overflow-y: auto; padding: 0 0.4rem 0.8rem; }
.stream-tree-empty { padding: 1rem 0.8rem; color: var(--text-muted); font-size: 0.84rem; }
.stream-tree-group { display: flex; flex-direction: column; }
.stream-tree-children { display: flex; flex-direction: column; padding-left: 0.85rem; }

.stream-row, .stream-tree-folder, .stream-tree-add {
  display: flex; align-items: center; gap: 0.5rem; width: 100%;
  text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 0.45rem 0.55rem; border-radius: 7px; color: var(--text-primary);
  font-size: 0.88rem; line-height: 1.25;
}
.stream-row:hover, .stream-tree-folder:hover, .stream-tree-add:hover {
  background: color-mix(in srgb, var(--border-subtle) 55%, transparent);
}
.stream-row.is-active {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-input));
  color: var(--text-primary); font-weight: 600;
}
.stream-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stream-count { color: var(--text-muted); font-size: 0.74rem; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.stream-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.stream-view-ico { flex-shrink: 0; color: var(--text-soft); }
.stream-row.is-active .stream-view-ico { color: var(--accent); }
.stream-chevron { flex-shrink: 0; color: var(--text-muted); transition: transform .12s; }
.stream-chevron.is-open { transform: rotate(90deg); }
.stream-tree-add { color: var(--text-muted); font-size: 0.8rem; }
.stream-tree-add:hover { color: var(--accent); }
.stream-tree-add svg { flex-shrink: 0; }

/* Drag-to-folder (TasksListPane): the dragged row fades; the hovered folder
   (header + its open children area) wears an accent wash; while dragging a
   foldered stream, the tree itself shows a dashed outline meaning "drop here
   to take it out of its folder". Theme tokens only (§5 light/dark parity). */
.stream-row-wrap.is-dragging { opacity: 0.45; }
.stream-tree-folder.is-drop-target,
.stream-tree-children.is-drop-target {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 7px;
}
.stream-tree.is-root-target {
  outline: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  outline-offset: -3px;
  border-radius: 10px;
}

/* ── Tasks pane-4 quick look (TaskQuickLook) ─────────────────────────────────
   Shared related-record card styles inside the complete Task pane. */
.tql { display: flex; flex-direction: column; gap: 14px; padding: 16px; }
.tql-empty { padding: 18px 16px; color: var(--text-muted); font-size: 0.86rem; }
.tql-head { display: flex; align-items: center; gap: 8px; }
.tql-number { color: var(--text-muted); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.tql-type, .tql-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 600;
  border: 1px solid var(--border-subtle); color: var(--text-soft);
}
.tql-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-soft); flex-shrink: 0; }
.tql-title { margin: 0; font-size: 1.02rem; font-weight: 650; line-height: 1.3; color: var(--text-primary); }
.tql-title.is-closed { text-decoration: line-through; color: var(--text-muted); }
.tql-meta { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.tql-meta-row { display: flex; align-items: center; gap: 10px; }
.tql-meta-row dt { flex: 0 0 76px; color: var(--text-muted); font-size: 0.76rem; }
.tql-meta-row dd { margin: 0; font-size: 0.82rem; color: var(--text-primary); display: flex; align-items: center; min-width: 0; }
.tql-avatars { display: inline-flex; }
.tql-avatars .task-avatar { margin-left: -6px; }
.tql-avatars .task-avatar:first-child { margin-left: 0; }
.tql-desc {
  margin: 0; padding-top: 12px; border-top: 1px solid var(--border-subtle);
  color: var(--text-soft); font-size: 0.82rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
/* wrap: with three buttons (complete · share · expand) and .tql-btn's flex:1,
   nowrap overflowed the pane and clipped "Expand" at narrow pane-4 widths. */
.tql-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
.tql-btn {
  flex: 1; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-subtle); background: var(--bg-input);
  color: var(--text-primary); font-size: 0.82rem; font-weight: 600;
  transition: background .12s, border-color .12s;
}
.tql-btn:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle)); }
.tql-btn.is-primary { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle)); }
.tql-btn.is-primary:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.tql-btn:disabled { opacity: 0.5; cursor: default; }

/* Pane 3 — editor + file view + empty */
.doc-main { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.doc-main-head {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1rem 1.4rem 0.5rem; flex-shrink: 0;
}
.doc-title-input {
  flex: 1; border: 0; background: transparent; color: var(--text-primary);
  font-size: 1.5rem; font-weight: 700; font-family: inherit; outline: none; padding: 0;
}
.doc-title-input::placeholder { color: var(--text-muted); }
.doc-save-state { font-size: 0.72rem; color: var(--text-muted); min-width: 3.2rem; text-align: right; }
.doc-save-state.is-saved { color: var(--state-success, #16a34a); }
.doc-export { display: inline-flex; gap: 0.3rem; }
.doc-export button {
  border: 1px solid var(--border-subtle); background: var(--bg-input); color: var(--text-soft);
  border-radius: 7px; padding: 0.25rem 0.6rem; font-size: 0.74rem; font-weight: 600; cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.doc-export button:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle)); }

.doc-editor-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0.4rem 1.4rem 3rem; }
.doc-editor-host { max-width: 820px; }
.doc-prose { outline: none; color: var(--text-primary); font-size: 0.95rem; line-height: 1.7; }
.doc-prose:focus { outline: none; }
.doc-prose > * + * { margin-top: 0.7em; }
.doc-prose h1 { font-size: 1.7rem; font-weight: 700; margin-top: 1.4rem; }
.doc-prose h2 { font-size: 1.35rem; font-weight: 700; margin-top: 1.2rem; }
.doc-prose h3 { font-size: 1.12rem; font-weight: 600; margin-top: 1rem; }
.doc-prose ul, .doc-prose ol { padding-left: 1.4rem; }
.doc-prose ul { list-style: disc; }
.doc-prose ol { list-style: decimal; }
.doc-prose li > p { margin: 0; }
.doc-prose blockquote {
  border-left: 3px solid color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  padding-left: 0.9rem; color: var(--text-soft);
}
.doc-prose code {
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  border-radius: 5px; padding: 0.05rem 0.3rem; font-size: 0.86em;
}
.doc-prose pre {
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  border-radius: 9px; padding: 0.8rem 1rem; overflow-x: auto;
}
.doc-prose pre code { background: transparent; border: 0; padding: 0; }
.doc-prose ul[data-type="taskList"] { list-style: none; padding-left: 0.2rem; }
.doc-prose ul[data-type="taskList"] li { display: flex; gap: 0.5rem; align-items: flex-start; }
.doc-prose p.is-editor-empty:first-child::before {
  content: attr(data-placeholder); color: var(--text-muted);
  float: left; height: 0; pointer-events: none;
}

.doc-empty {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 0.5rem; padding: 2rem; color: var(--text-soft);
}
.doc-empty-mark {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent); margin-bottom: 0.4rem;
}
.doc-empty h2 { margin: 0; font-size: 1.1rem; color: var(--text-primary); }
.doc-empty p { margin: 0; max-width: 380px; font-size: 0.86rem; }

.doc-file-view { display: flex; flex-direction: column; gap: 0.8rem; padding: 0.2rem 0 1.4rem; }
.doc-file-stage {
  width: 100%;
  height: calc(100vh - 240px);
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
}
.doc-file-stage > .fp-doc,
.doc-file-stage > .fp-sheet-wrap,
.doc-file-stage > .fp-text-wrap,
.doc-file-stage > .fp-pdf { width: 100%; height: 100%; }
/* A file preview wants width — drop the big document-page side padding for files. */
.doc-page:has(.doc-file-view) { padding: 1.5rem 1.25rem 2rem; }
.doc-file-download {
  align-self: flex-start; display: inline-flex; align-items: center;
  padding: 0.45rem 0.9rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  background: var(--accent); color: var(--accent-contrast); text-decoration: none;
}

/* Pane 4 — details */
.doc-nav { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.2rem 0.1rem; }
.doc-nav-empty { padding: 0.5rem; color: var(--text-muted); font-size: 0.82rem; }
.doc-nav-title { margin: 0; font-size: 0.95rem; font-weight: 700; color: var(--text-primary); word-break: break-word; }
.doc-nav-kind {
  align-self: flex-start; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.1rem 0.45rem; border-radius: 999px; color: var(--text-soft);
  background: var(--bg-input); border: 1px solid var(--border-subtle);
}
.doc-nav-meta { display: grid; gap: 0.5rem; margin: 0.3rem 0; }
.doc-nav-meta div { display: flex; justify-content: space-between; gap: 0.6rem; }
.doc-nav-meta dt { color: var(--text-muted); font-size: 0.78rem; }
.doc-nav-meta dd { margin: 0; color: var(--text-primary); font-size: 0.78rem; text-align: right; word-break: break-word; }
.doc-nav-delete {
  align-self: flex-start; margin-top: 0.4rem; padding: 0.4rem 0.8rem;
  border-radius: 8px; border: 1px solid color-mix(in srgb, var(--state-error) 45%, var(--border-subtle));
  background: transparent; color: var(--state-error); font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.doc-nav-delete:hover:not(:disabled) { background: color-mix(in srgb, var(--state-error) 12%, transparent); }
.doc-nav-delete:disabled { opacity: 0.6; cursor: default; }
.doc-nav-managed { margin-top: 0.4rem; padding: 0.5rem 0.7rem; border-radius: 8px; background: var(--bg-input); border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 0.78rem; line-height: 1.45; }
.doc-nav-share {
  display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.25rem; padding: 0.7rem;
  border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-input);
}
.doc-nav-share strong { color: var(--text-primary); font-size: 0.82rem; }
.doc-nav-share p, .doc-nav-share small, .doc-nav-share > span { margin: 0; color: var(--text-muted); font-size: 0.74rem; line-height: 1.4; }
.doc-nav-share > button, .doc-nav-share-actions button {
  border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-1);
  color: var(--text-primary); padding: 0.42rem 0.65rem; font-size: 0.76rem; font-weight: 650; cursor: pointer;
}
.doc-nav-share-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.doc-nav-share-actions .is-danger { color: var(--state-error); }
.doc-nav-share button:disabled { opacity: 0.55; cursor: default; }

/* ============================================================================
   DOCUMENTS DRIVE — ClickUp-style document canvas + drive home (2026-06-09)
   Supersedes the earlier cramped .doc-main / .doc-editor-scroll editor styles
   (those classes are no longer rendered; these rules come later and win).
   All colours use theme tokens (--bg-*, --text-*, --border-*, --accent) for
   light/dark parity — CLAUDE.md #5.
   ========================================================================== */

/* --- Doc shell (pane 3 when a document is open) --- */
.doc-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.doc-toolbar {
  display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0;
  padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--border-subtle);
}
.doc-toolbar-back {
  border: 0; background: transparent; color: var(--text-muted);
  font-size: 0.82rem; cursor: pointer; padding: 0.25rem 0.45rem; border-radius: 6px;
}
.doc-toolbar-back:hover { color: var(--text-primary); background: var(--bg-input); }
.doc-toolbar-spacer { flex: 1; }
.doc-save-state { font-size: 0.74rem; color: var(--text-muted); min-width: 3.4rem; text-align: right; }
.doc-save-state.is-saved { color: var(--state-success); }
.doc-save-state.is-error {
  border: 0;
  background: transparent;
  color: var(--state-danger, #dc2626);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.74rem;
}

.doc-export { position: relative; display: inline-flex; }
.doc-export-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  border: 1px solid var(--border-subtle); background: var(--bg-input);
  color: var(--text-soft); font-size: 0.8rem; font-weight: 600;
  padding: 0.32rem 0.6rem; border-radius: 8px; cursor: pointer;
}
.doc-export-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.doc-export-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 160px;
  padding: 0.3rem; display: flex; flex-direction: column; gap: 1px;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: var(--shadow-soft);
}
.doc-export-menu button {
  text-align: left; border: 0; background: transparent; color: var(--text-soft);
  font-size: 0.84rem; padding: 0.45rem 0.55rem; border-radius: 7px; cursor: pointer;
}
.doc-export-menu button:hover { background: var(--bg-input); color: var(--text-primary); }

/* --- The canvas + page (Google-Docs-style sheet of paper) --- */
.doc-canvas { flex: 1; min-height: 0; overflow-y: auto; background: var(--bg-elevated); padding: 0; }
.doc-page {
  /* FULL WIDTH — the document fills the whole pane (no centered narrow column,
     no grey margins). Only the INTERNAL text padding scales with width (clamp on
     %) so lines keep comfortable margins whether the pane is narrow or wide. */
  max-width: none; width: 100%; margin: 0; min-height: calc(100vh - 130px);
  background: var(--bg-elevated); border: 0; border-radius: 0; box-shadow: none;
  padding: 2.5rem clamp(1.25rem, 5%, 5rem) 5rem;
}
.doc-page-title {
  width: 100%; border: 0; outline: none; background: transparent; font-family: inherit;
  color: var(--text-primary); font-size: 2.2rem; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15; padding: 0; margin: 0 0 1.1rem;
}
.doc-page-title::placeholder { color: var(--text-muted); opacity: 0.55; }

/* --- Editor body (.doc-prose) --- */
.doc-prose-skeleton { height: 240px; border-radius: 10px; background: var(--bg-input); opacity: 0.5; }
.doc-token-insert { display: flex; align-items: center; gap: 0.45rem; width: max-content; max-width: 100%; margin-bottom: 0.65rem; color: var(--text-muted); font-size: 0.75rem; }
.doc-token-insert-menu { min-height: 32px; width: 150px; }
.doc-prose { outline: none; color: var(--text-primary); font-size: 1.02rem; line-height: 1.75; }
.doc-prose:focus { outline: none; }
.doc-prose > * + * { margin-top: 0.7em; }
.doc-prose h1 { font-size: 1.8rem; font-weight: 700; line-height: 1.25; margin-top: 1.6rem; letter-spacing: -0.01em; }
.doc-prose h2 { font-size: 1.42rem; font-weight: 700; line-height: 1.3; margin-top: 1.4rem; }
.doc-prose h3 { font-size: 1.16rem; font-weight: 650; margin-top: 1.1rem; }
.doc-prose p { margin: 0; }
.doc-prose ul, .doc-prose ol { padding-left: 1.5rem; }
.doc-prose ul { list-style: disc; }
.doc-prose ol { list-style: decimal; }
.doc-prose li { margin: 0.15em 0; }
.doc-prose li > p { margin: 0; }
.doc-prose a, .doc-prose a.doc-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.doc-prose blockquote {
  border-left: 3px solid color-mix(in srgb, var(--accent) 50%, var(--border-strong));
  margin: 0; padding: 0.1rem 0 0.1rem 1rem; color: var(--text-soft);
}
.doc-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em;
  background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 5px; padding: 0.05rem 0.3rem;
}
.doc-prose pre {
  background: var(--bg-input); border: 1px solid var(--border-subtle);
  border-radius: 10px; padding: 0.9rem 1rem; overflow: auto; font-size: 0.9rem;
}
.doc-prose pre code { background: transparent; border: 0; padding: 0; }
.doc-prose hr { border: 0; border-top: 1px solid var(--border-strong); margin: 1.4rem 0; }
.doc-prose img.doc-image { max-width: 100%; border-radius: 10px; margin: 0.3rem 0; }
.doc-prose mark { border-radius: 3px; padding: 0 2px; }
.doc-prose ul[data-type="taskList"] { list-style: none; padding-left: 0.1rem; }
.doc-prose ul[data-type="taskList"] li { display: flex; gap: 0.55rem; align-items: flex-start; }
.doc-prose ul[data-type="taskList"] li > label { margin-top: 0.28rem; }
.doc-prose ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.doc-prose ul[data-type="taskList"] input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.doc-prose p.is-editor-empty:first-child::before,
.doc-prose .is-empty[data-placeholder]::before {
  content: attr(data-placeholder); color: var(--text-muted); opacity: 0.5;
  float: left; height: 0; pointer-events: none;
}

/* --- Selection toolbar (bubble menu) — portaled to <body>, position: fixed --- */
.doc-bubble {
  position: fixed; transform: translate(-50%, calc(-100% - 10px)); z-index: 80;
  display: flex; flex-direction: column; padding: 0.25rem; max-width: min(96vw, 560px);
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 10px; box-shadow: var(--shadow-soft);
}
.doc-bubble-row { display: flex; align-items: center; gap: 0.1rem; flex-wrap: wrap; }
.doc-bubble-group { display: inline-flex; align-items: center; gap: 0.05rem; }
.doc-bubble-sep { width: 1px; align-self: stretch; margin: 0.15rem 0.25rem; background: var(--border-subtle); }
.doc-bubble button {
  min-width: 28px; height: 28px; padding: 0 0.35rem; border: 0; background: transparent;
  color: var(--text-soft); font-size: 0.82rem; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.doc-bubble button:hover { background: var(--bg-input); color: var(--text-primary); }
.doc-bubble button.is-on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.doc-b-bold { font-weight: 800; }
.doc-b-italic { font-style: italic; }
.doc-b-underline { text-decoration: underline; }
.doc-b-strike { text-decoration: line-through; }
.doc-b-code { font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; }
.doc-bubble-palette {
  display: flex; gap: 0.25rem; padding: 0.35rem 0.15rem 0.15rem; margin-top: 0.25rem;
  border-top: 1px solid var(--border-subtle);
}
.doc-swatch {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border-subtle);
  background: transparent; cursor: pointer; font-weight: 800; font-size: 0.8rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.doc-swatch:hover { border-color: var(--border-strong); }
.doc-swatch-hl { color: #222; }

/* --- Slash menu — portaled to <body> --- */
.doc-slash {
  position: fixed; z-index: 80; width: 280px; max-height: 340px; overflow-y: auto; padding: 0.35rem;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow-soft);
}
.doc-slash.is-above { transform: translateY(-100%); }
.doc-slash-head { font-size: 0.64rem; letter-spacing: 0.08em; color: var(--text-muted); padding: 0.3rem 0.5rem 0.2rem; font-weight: 700; }
.doc-slash-empty { padding: 0.5rem; color: var(--text-muted); font-size: 0.82rem; }
.doc-slash-item {
  width: 100%; display: flex; align-items: center; gap: 0.6rem; text-align: left;
  border: 0; background: transparent; color: var(--text-primary);
  padding: 0.45rem 0.5rem; border-radius: 8px; cursor: pointer;
}
.doc-slash-item.is-active, .doc-slash-item:hover { background: var(--bg-input); }
.doc-slash-ico {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px; font-size: 0.78rem; font-weight: 700;
  border: 1px solid var(--border-subtle); background: var(--bg-base); color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center;
}
.doc-slash-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.doc-slash-label { font-size: 0.86rem; font-weight: 600; }
.doc-slash-hint { font-size: 0.74rem; color: var(--text-muted); }

/* --- Drive home (pane 3 when no document is open) --- */
.doc-drive { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 0; }
.doc-drive-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; flex-shrink: 0;
  padding: 1rem 1.4rem 0.8rem; border-bottom: 1px solid var(--border-subtle);
}
.doc-drive-crumbs { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; min-width: 0; }
.doc-crumb {
  display: inline-flex; align-items: center; gap: 0.35rem; border: 0; background: transparent;
  color: var(--text-soft); font-size: 0.92rem; font-weight: 600; cursor: pointer; padding: 0.2rem 0.35rem; border-radius: 6px;
}
.doc-crumb:hover { color: var(--text-primary); background: var(--bg-input); }
.doc-crumb-ico { flex-shrink: 0; }
.doc-crumb-wrap { display: inline-flex; align-items: center; gap: 0.15rem; }
.doc-crumb-sep { flex-shrink: 0; color: var(--text-muted); }
.doc-drive-actions { display: inline-flex; gap: 0.4rem; flex-wrap: wrap; }
.doc-drive-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  border: 1px solid var(--border-subtle); background: var(--bg-input); color: var(--text-soft);
  font-size: 0.82rem; font-weight: 600; padding: 0.4rem 0.7rem; border-radius: 9px; cursor: pointer;
}
.doc-drive-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }
.doc-drive-btn .ui-icon { width: 15px; height: 15px; }
.doc-drive-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.doc-drive-btn.primary:hover { filter: brightness(1.05); color: var(--accent-contrast); }
.doc-drive-btn:disabled { opacity: 0.6; cursor: default; }
.doc-drive-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1.2rem 1.4rem 3rem; }
.doc-drive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 0.9rem; }
.doc-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; text-align: left;
  padding: 1rem; min-height: 128px; cursor: pointer;
  border: 1px solid var(--border-subtle); border-radius: 14px; background: var(--bg-elevated);
  transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s;
}
.doc-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.doc-card-ico { flex-shrink: 0; color: var(--accent); }
.doc-card-folder .doc-card-ico { color: var(--text-soft); }
.doc-card-title {
  font-size: 0.9rem; font-weight: 650; color: var(--text-primary); margin-top: auto;
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.doc-card-meta { font-size: 0.74rem; color: var(--text-muted); }
.doc-drive-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  text-align: center; padding: 4rem 1rem; color: var(--text-muted);
}
.doc-drive-empty-mark {
  width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); margin-bottom: 0.3rem;
}
.doc-drive-empty-mark .ui-icon { width: 26px; height: 26px; }
.doc-drive-empty h3 { margin: 0; font-size: 1.05rem; color: var(--text-primary); }
.doc-drive-empty p { margin: 0 0 0.6rem; max-width: 360px; font-size: 0.86rem; }
.doc-drive.is-dragover .doc-drive-scroll { opacity: 0.4; }
.doc-drive-dropmask {
  position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  margin: 0.5rem; pointer-events: none; border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 2px dashed var(--accent);
}
.doc-drive-dropmask-inner { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--accent); font-weight: 700; }
.doc-drive-dropmask-inner .ui-icon { width: 32px; height: 32px; }

@media (max-width: 768px) {
  .doc-canvas { padding: 0 0 3rem; }
  .doc-page { padding: 1.5rem 1rem 3rem; }
  .doc-page-title { font-size: 1.8rem; }
  .doc-drive-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* --- In-app dialogs (PromptDialog / ConfirmDialog) — replace native popups --- */
.doc-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
}
.doc-modal {
  width: 100%; max-width: 420px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--bg-elevated); border: 1px solid var(--border-strong);
  border-radius: 14px; box-shadow: var(--shadow-soft); padding: 1.3rem 1.4rem 1.1rem;
}
.doc-modal-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.doc-modal-label { font-size: 0.78rem; color: var(--text-muted); }
.doc-modal-msg { margin: 0; font-size: 0.9rem; color: var(--text-soft); line-height: 1.5; }
.doc-modal-input {
  width: 100%; box-sizing: border-box; font-size: 0.95rem; outline: none;
  padding: 0.6rem 0.7rem; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--bg-input); color: var(--text-primary);
}
.doc-modal-input::placeholder { color: var(--text-muted); }
.doc-modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.doc-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.3rem; }
.doc-modal-btn {
  border: 1px solid var(--border-strong); background: var(--bg-input); color: var(--text-soft);
  font-size: 0.85rem; font-weight: 600; padding: 0.45rem 0.95rem; border-radius: 9px; cursor: pointer;
}
.doc-modal-btn:hover { color: var(--text-primary); }
.doc-modal-btn.is-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.doc-modal-btn.is-primary:hover { filter: brightness(1.05); color: var(--accent-contrast); }
.doc-modal-btn.is-danger { background: var(--state-error); border-color: var(--state-error); color: #fff; }
.doc-modal-btn.is-danger:hover { filter: brightness(1.05); color: #fff; }

/* Document link picker — one component, desktop dialog + canonical phone sheet.
   Every colour comes from the active surface's theme tokens. */
.document-composer-overlay.is-desktop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgb(var(--sp3-shadow-color) / 0.5);
}
.document-composer-overlay.is-phone { z-index: 12000; }
.document-composer-picker {
  --document-composer-bg: var(--bg-elevated);
  --document-composer-bg-soft: var(--bg-input);
  --document-composer-text: var(--text-primary);
  --document-composer-muted: var(--text-muted);
  --document-composer-border: var(--border-subtle);
  box-sizing: border-box;
  color: var(--document-composer-text);
}
.document-composer-picker.is-desktop {
  width: min(560px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--document-composer-bg);
  box-shadow: var(--shadow-soft);
}
.document-composer-picker.is-phone {
  --document-composer-bg: var(--ph-surface);
  --document-composer-bg-soft: var(--ph-surface-2);
  --document-composer-text: var(--ph-text);
  --document-composer-muted: var(--ph-text-2);
  --document-composer-border: var(--ph-hairline);
  overflow: hidden auto;
}
.document-composer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--document-composer-border);
}
.document-composer-picker.is-phone .document-composer-head { padding: 4px 4px 14px; }
.document-composer-head-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.document-composer-head > span:nth-child(2) {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
}
.document-composer-head strong { font-size: 0.95rem; }
.document-composer-head small {
  color: var(--document-composer-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}
.document-composer-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--document-composer-bg-soft);
  color: var(--document-composer-muted);
  cursor: pointer;
}
.document-composer-close:hover { color: var(--document-composer-text); }
.document-composer-close:disabled { cursor: wait; opacity: 0.5; }
.document-composer-picker.is-phone .document-composer-close.ph-sheet-close {
  position: static;
  margin: 0;
  align-self: auto;
  background: var(--ph-border);
  color: var(--ph-text-2);
}
.document-composer-for {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--document-composer-border);
  color: var(--document-composer-muted);
  font-size: 0.78rem;
}
.document-composer-picker.is-phone .document-composer-for { padding-inline: 4px; }
.document-composer-for strong { color: var(--document-composer-text); }
.document-composer-for button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.document-composer-for button:disabled { cursor: wait; opacity: 0.5; }
.document-composer-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 18px;
}
.document-composer-picker.is-phone .document-composer-scroll {
  overflow: visible;
  padding: 14px 0 4px;
}
.document-composer-setup {
  display: grid;
  gap: 6px;
  margin: 16px 0 18px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--document-composer-border));
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 6%, var(--document-composer-bg-soft));
}
.document-composer-setup > span {
  color: var(--document-composer-text);
  font-size: 0.75rem;
  font-weight: 750;
}
.document-composer-setup select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--document-composer-border);
  border-radius: 8px;
  background: var(--document-composer-bg);
  color: var(--document-composer-text);
  font: inherit;
  font-size: 0.78rem;
}
.document-composer-setup small {
  color: var(--document-composer-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}
.document-composer-setup select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.document-composer-setup select:disabled { cursor: wait; opacity: 0.62; }
.document-composer-section + .document-composer-section { margin-top: 18px; }
.document-composer-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--document-composer-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.document-composer-section-head small {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--document-composer-bg-soft);
  text-align: center;
}
.document-composer-rows,
.document-composer-contact-list { display: grid; gap: 6px; }
.document-composer-row,
.document-composer-contact {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--document-composer-border);
  border-radius: 11px;
  background: var(--document-composer-bg-soft);
  color: var(--document-composer-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.document-composer-row:hover,
.document-composer-contact:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--document-composer-border));
  background: color-mix(in srgb, var(--accent) 7%, var(--document-composer-bg-soft));
}
.document-composer-row:focus-visible,
.document-composer-contact:focus-visible,
.document-composer-close:focus-visible,
.document-composer-for button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.document-composer-row:disabled { cursor: wait; opacity: 0.62; }
.document-composer-row > svg,
.document-composer-contact > svg {
  flex: 0 0 auto;
  color: var(--accent);
}
.document-composer-row > span:nth-child(2) {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 2px;
}
.document-composer-row strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-composer-row small {
  overflow: hidden;
  color: var(--document-composer-muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.document-composer-row-action {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}
.document-composer-loading,
.document-composer-empty,
.document-composer-contact-step {
  padding: 28px 18px;
  color: var(--document-composer-muted);
}
.document-composer-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
}
.document-composer-empty { display: grid; justify-items: center; gap: 7px; text-align: center; }
.document-composer-empty > svg { color: var(--accent); }
.document-composer-empty strong { color: var(--document-composer-text); font-size: 0.9rem; }
.document-composer-empty p,
.document-composer-contact-step > p,
.document-composer-section-empty { margin: 0; font-size: 0.78rem; line-height: 1.45; }
.document-composer-contact-step > p { margin-bottom: 10px; color: var(--document-composer-text); font-weight: 650; }
.document-composer-contact span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-composer-section-empty {
  padding: 12px;
  border: 1px dashed var(--document-composer-border);
  border-radius: 10px;
  color: var(--document-composer-muted);
  text-align: center;
}
.document-composer-error {
  margin: 0 18px 16px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--state-error) 40%, var(--document-composer-border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--state-error) 8%, transparent);
  color: var(--state-error);
  font-size: 0.76rem;
  line-height: 1.4;
}
.document-composer-picker.is-phone .document-composer-error { margin-inline: 0; }
.document-composer-spin { flex: 0 0 auto; animation: ph-send-spin 0.8s linear infinite; }

@media (max-width: 520px) {
  .document-composer-overlay.is-desktop { align-items: flex-end; padding: 0; }
  .document-composer-picker.is-desktop {
    width: 100%;
    max-height: calc(100% - env(safe-area-inset-top, 0px) - 44px);
    border-radius: 20px 20px 0 0;
  }
  .document-composer-row-action { display: none; }
}

/* ============================================================================
   HEARTY EDITOR — tables, toggles, callouts, code highlighting, drag handle,
   grouped slash menu (2026-06-09). Theme-tokened for light/dark parity.
   ========================================================================== */

/* Bubble + slash icons must not be squished by flex (lucide sizes via prop). */
.doc-bubble button svg, .doc-slash-ico svg { flex-shrink: 0; }

/* --- Slash menu grouping --- */
.doc-slash-group + .doc-slash-group { margin-top: 0.15rem; border-top: 1px solid var(--border-subtle); padding-top: 0.15rem; }
.doc-slash-ico svg { color: var(--text-soft); }

/* --- Table toolbar (text buttons) --- */
.doc-table-menu .doc-tablebtn {
  min-width: auto; padding: 0 0.45rem; font-size: 0.76rem; font-weight: 600; white-space: nowrap;
}

/* --- Tables --- */
.doc-prose .tableWrapper { overflow-x: auto; margin: 0.8rem 0; }
.doc-prose table.doc-table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.doc-prose table.doc-table td, .doc-prose table.doc-table th {
  border: 1px solid var(--border-strong); padding: 0.45rem 0.6rem; vertical-align: top;
  min-width: 3rem; position: relative;
}
.doc-prose table.doc-table th {
  background: var(--bg-input); font-weight: 700; text-align: left;
}
.doc-prose table.doc-table .selectedCell::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.doc-prose table.doc-table .column-resize-handle {
  position: absolute; right: -2px; top: 0; bottom: -2px; width: 4px;
  background: var(--accent); pointer-events: none;
}
.doc-prose .tableWrapper.resize-cursor { cursor: col-resize; }

/* --- Toggle (details) — TipTap renders a div.doc-toggle > button + div(summary
   + detailsContent); the container gets .is-open when expanded. --- */
.doc-prose .doc-toggle { display: flex; gap: 0.4rem; align-items: flex-start; margin: 0.5rem 0; }
.doc-prose .doc-toggle > button {
  flex-shrink: 0; width: 22px; height: 1.7em; padding: 0; border: 0; background: transparent; cursor: pointer;
  color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center;
}
.doc-prose .doc-toggle > button::before { content: "▸"; font-size: 0.85rem; transition: transform .12s; }
.doc-prose .doc-toggle.is-open > button::before { transform: rotate(90deg); }
.doc-prose .doc-toggle > div { flex: 1; min-width: 0; }
.doc-prose .doc-toggle summary { list-style: none; font-weight: 600; outline: none; cursor: text; }
.doc-prose .doc-toggle summary::-webkit-details-marker { display: none; }
.doc-prose .doc-toggle [data-type="detailsContent"] { margin-top: 0.3rem; color: var(--text-soft); }
/* Native <details> (raw-HTML / export contexts) keep a sensible default. */
.doc-prose details.doc-toggle { border: 0; padding: 0; }

/* --- Callout --- */
.doc-prose .doc-callout {
  position: relative; margin: 0.7rem 0; padding: 0.7rem 0.9rem 0.7rem 2.4rem; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
}
.doc-prose .doc-callout::before {
  content: "💡"; position: absolute; left: 0.8rem; top: 0.65rem; font-size: 1rem; line-height: 1.4;
}
.doc-prose .doc-callout > * { margin: 0; }
.doc-prose .doc-callout > * + * { margin-top: 0.4rem; }

/* --- Code block (syntax highlighted via lowlight/highlight.js) --- */
.doc-prose pre.doc-code {
  background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 10px;
  padding: 0.9rem 1rem; overflow-x: auto; font-size: 0.88rem; line-height: 1.55; margin: 0.6rem 0;
}
.doc-prose pre.doc-code code { background: transparent; border: 0; padding: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text-primary); }
/* highlight.js tokens — dark default */
.doc-prose .hljs-comment, .doc-prose .hljs-quote { color: #7b8190; font-style: italic; }
.doc-prose .hljs-keyword, .doc-prose .hljs-selector-tag, .doc-prose .hljs-literal { color: #c678dd; }
.doc-prose .hljs-string, .doc-prose .hljs-attr, .doc-prose .hljs-meta-string { color: #98c379; }
.doc-prose .hljs-number, .doc-prose .hljs-built_in, .doc-prose .hljs-class .hljs-title { color: #d19a66; }
.doc-prose .hljs-title, .doc-prose .hljs-function .hljs-title, .doc-prose .hljs-section { color: #61afef; }
.doc-prose .hljs-tag, .doc-prose .hljs-name, .doc-prose .hljs-selector-id, .doc-prose .hljs-selector-class { color: #e06c75; }
.doc-prose .hljs-attribute, .doc-prose .hljs-variable, .doc-prose .hljs-template-variable { color: #e5c07b; }
.doc-prose .hljs-type, .doc-prose .hljs-symbol, .doc-prose .hljs-bullet { color: #56b6c2; }
/* highlight.js tokens — light overrides */
[data-theme="light"] .doc-prose .hljs-comment, [data-theme="light"] .doc-prose .hljs-quote { color: #6a737d; }
[data-theme="light"] .doc-prose .hljs-keyword, [data-theme="light"] .doc-prose .hljs-selector-tag, [data-theme="light"] .doc-prose .hljs-literal { color: #a626a4; }
[data-theme="light"] .doc-prose .hljs-string, [data-theme="light"] .doc-prose .hljs-attr { color: #50a14f; }
[data-theme="light"] .doc-prose .hljs-number, [data-theme="light"] .doc-prose .hljs-built_in { color: #b76b01; }
[data-theme="light"] .doc-prose .hljs-title, [data-theme="light"] .doc-prose .hljs-section { color: #4078f2; }
[data-theme="light"] .doc-prose .hljs-tag, [data-theme="light"] .doc-prose .hljs-name { color: #e45649; }

/* --- Block drag handle (left gutter, on hover) --- */
.drag-handle {
  position: absolute; z-index: 40;
  width: 20px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab; color: var(--text-muted); background: transparent;
  opacity: 0.55; transition: opacity .12s, background .12s;
}
.drag-handle::before { content: "⠿"; font-size: 15px; line-height: 1; }
.drag-handle:hover { opacity: 1; background: var(--bg-input); color: var(--text-primary); }
.drag-handle:active { cursor: grabbing; }
.drag-handle.hide, .drag-handle.hidden { opacity: 0; pointer-events: none; }

/* Auto-chip dismissal × ("Repeat guest" on list cards) — inherits the chip's
   tone colour; opacity carries rest/hover. */
.workspace-list-tag-x {
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  padding: 0 0 0 2px;
  margin-left: 2px;
  font-size: 0.85em;
  line-height: 1;
  opacity: 0.6;
}
.workspace-list-tag-x:hover,
.workspace-list-tag-x:focus-visible {
  opacity: 1;
}

/* The inbox's contact Details tab fills the conversation area and scrolls
   independently. Reservation details use the canonical reservation object. */
.inbox-details-tab {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 0.9rem;
}

/* Inline activity rows (thread_activity, CRM plan C1) — small centered system
   lines between bubbles, mirroring the Figma's "Reservation created…" rows. */
.inbox-activity-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.3rem 0;
  font-size: 0.72rem;
  color: var(--text-soft);
}
.inbox-activity-row .inbox-activity-meta {
  color: var(--text-muted);
  font-size: 0.68rem;
}
/* Overstay — a guest flagged as NOT checked out. A gentle warning tint (not an
   alarm): the row stays the same small centered system line, just amber so it
   reads as "needs attention". color-mix against the theme's text colour keeps it
   legible in BOTH light and dark (matches the inbox's other --state-warning use). */
.inbox-activity-row.is-overstay {
  color: color-mix(in srgb, var(--state-warning) 90%, var(--text-primary));
  font-weight: 600;
}
.inbox-activity-row.is-overstay .inbox-activity-meta {
  color: color-mix(in srgb, var(--state-warning) 70%, var(--text-soft));
  font-weight: 400;
}

/* Header toggle for the inline activity rows — styled EXACTLY like the
   Inbox|Details tabs beside it (.properties-res-inbox-tab) so the header row
   reads as one coherent control group (Hakim: the old pill "looked too
   different… badly executed"). */
/* Activity control — now a single icon button that reuses .inbox-head-action-btn
   (the wide "Activity: all" text chip is gone — Hakim 2026-06-23). "On" tints the
   glyph accent so the cycling state (all → key → hidden) reads at a glance. */
.inbox-activity-toggle.is-on {
  color: var(--accent);
}

/* Locked transports in the channel switcher menu — visible, greyed, "soon". */
.inbox-channel-switcher-item.is-locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.inbox-channel-switcher-soon {
  margin-left: auto;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}
/* Wave 4: availability-greyed options stack a visible reason line beneath the
   label (mirrors the new-conversation wizard) so the dropdown SAYS why a
   channel is unusable instead of hiding it. */
.inbox-channel-switcher-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.inbox-channel-switcher-reason {
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--text-muted);
  white-space: normal;
}

/* ---- Pane-3 Figma fidelity pass (frame 26002:22953) -------------------- */

/* Compact two-line conversation header. */
.inbox-chat-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  row-gap: 0.35rem;
  flex-wrap: wrap;
  min-width: 0;
}
/* Always-visible applied-tag chips in the conversation header (read-only; the tag trigger manages). */
.inbox-head-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-width: 0;
}
.inbox-chip-static {
  cursor: default;
}
/* Thread-privacy "Private" pill (slice 3) — renders only for visibility='private'.
   Indigo-tinted as a security signal; light/dark parity via accent-token color-mix. */
.inbox-visibility-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  color: var(--accent, #4f46e5);
  background: color-mix(in srgb, var(--accent, #4f46e5) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #4f46e5) 28%, transparent);
}
.inbox-visibility-pill svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.inbox-visibility-error {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--state-negative, #dc2626);
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Slice 3b — Team access section (Details pane) + its private/public hint line. */
.inbox-thread-team-access {
  margin-top: 14px;
  /* Symmetric with the top gap so the section doesn't butt against the CRM
     cards below it (Hakim 2026-07-04: "the gap is too small"). */
  margin-bottom: 14px;
}
.inbox-team-access-hint {
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 4px 0 8px;
}
/* Current-state pill (lock/globe + "Everyone" / "N people"). */
.inbox-team-access-state {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-soft);
}
.inbox-team-access-state.is-private {
  color: var(--accent);
}
.inbox-team-access-state .ui-icon {
  width: 13px;
  height: 13px;
}
/* Inline access control — the actual "Make private / Make public" toggle so you
   never have to hunt in the header ⋯ menu. */
.inbox-team-access-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 8px;
}
.inbox-team-access-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.32rem 0.6rem;
  cursor: pointer;
}
.inbox-team-access-toggle .ui-icon {
  width: 15px;
  height: 15px;
}
.inbox-team-access-toggle:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.inbox-team-access-toggle:disabled {
  opacity: 0.6;
  cursor: default;
}
/* Public → "Make private" reads as the primary move; tint it with the accent. */
.inbox-team-access-toggle:not(.is-open) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  color: var(--accent);
}
.inbox-team-access-error {
  font-size: 0.75rem;
  color: var(--state-danger, #d33a3a);
}
.inbox-chat-title-row .inbox-chat-title {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-chat-sub-channel {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Sent-tick after outbound timestamps. */
.inbox-foot-tick {
  color: color-mix(in srgb, #16a34a 55%, var(--text-muted));
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}
/* Read receipt — WhatsApp-style blue double tick. */
.inbox-foot-tick--read {
  color: #4aa8e0;
}
/* Failed / undelivered. */
.inbox-foot-tick--fail {
  color: var(--state-error);
}

/* WhatsApp template composer — replaces the free-form editor when the 24h
   session window is closed (an approved template is required to send). */
.wa-tpl {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.2rem 0;
}
/* TestFlight #45 — the template panel folds away. Its head carries the fold
   control; folded, the whole thing is one tappable bar. Token-based so both
   themes track; 44px min-height keeps the folded bar a real touch target. */
.wa-tpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.wa-tpl-head-title {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.wa-tpl-fold {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Real touch target on a phone — this is the only way out of the panel. */
  width: 32px;
  height: 32px;
  margin: -4px -6px -4px 0;
  border: none;
  background: transparent;
  color: var(--text-soft);
  border-radius: 8px;
  cursor: pointer;
}
.wa-tpl-fold:hover {
  background: color-mix(in srgb, var(--text-soft) 14%, transparent);
  color: var(--text-primary);
}
.wa-tpl-folded {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.wa-tpl-folded:hover {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
}
/* On the phone the panel is capped and scrolls inside itself, so a template with
   many variables can never push its own Send button off the bottom of the screen
   (TestFlight #45) no matter how tall it gets. */
.phone-app .wa-tpl {
  max-height: 42svh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
/* Inside the phone shell the panel sits on the phone's own surface tokens. */
.phone-app .wa-tpl-head-title {
  color: var(--ph-text-3);
}
.phone-app .wa-tpl-fold {
  color: var(--ph-text-2);
}
.phone-app .wa-tpl-folded {
  border-color: color-mix(in srgb, var(--ph-accent) 30%, transparent);
  background: var(--ph-accent-wash);
  color: var(--ph-text);
}
/* Inbox "email disconnected" warning strip — shown when an email integration is stuck
   at reauth_required (could not self-heal). Token-based for light/dark; flex + min-width:0
   keeps it intact on small screens. */
.inbox-reauth-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0.75rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
  background: color-mix(in srgb, var(--state-warning) 14%, var(--bg-elevated));
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--state-warning) 32%, transparent);
}
.inbox-reauth-banner > svg {
  flex: 0 0 auto;
  color: var(--state-warning);
}
.inbox-reauth-banner-text {
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-reauth-banner-cta {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}
.inbox-reauth-banner-cta:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
/* Calm, dismissible first-connect nudge — shown only when NO email is connected
   (status "disconnected"). Info-tone (accent), deliberately distinct from the WARNING
   reauth banner above. Token-based for light/dark; flex + min-width:0 keeps it intact
   on small screens. */
.inbox-connect-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0.75rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.inbox-connect-banner > svg {
  flex: 0 0 auto;
  color: var(--accent);
}
.inbox-connect-banner-text {
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-connect-banner-cta {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}
.inbox-connect-banner-cta:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.inbox-connect-banner-dismiss {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
  border: none;
  background: transparent;
  color: var(--text-soft);
  border-radius: 6px;
  cursor: pointer;
}
.inbox-connect-banner-dismiss:hover {
  background: color-mix(in srgb, var(--text-soft) 14%, transparent);
  color: var(--text-primary);
}
.wa-tpl-empty {
  font-size: 0.82rem;
  margin: 0.2rem 0;
}
.wa-tpl-context {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.74rem;
  line-height: 1.35;
}
.wa-tpl-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-primary);
}

.wa-tpl-field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wa-tpl-auto {
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.wa-tpl-field .properties-input-text {
  font-weight: 400;
}
.wa-tpl-vars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
}
.wa-tpl-preview {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.wa-tpl-preview-label {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.wa-tpl-preview p {
  margin: 0;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
}
.wa-tpl-actions {
  display: flex;
  justify-content: flex-end;
}

/* Contact metadata hover card (over the conversation header avatar). */
.cmeta-wrap {
  position: relative;
  display: inline-flex;
}
.cmeta-card {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 248px;
  max-width: 320px;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
  pointer-events: none;
}
.cmeta-wrap:hover .cmeta-card,
.cmeta-wrap:focus-within .cmeta-card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.cmeta-title {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.cmeta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cmeta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.4rem;
  font-size: 0.82rem;
  color: var(--text-primary);
}
.cmeta-row.is-active {
  font-weight: 600;
}
.cmeta-icon {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-muted);
}
.cmeta-icon svg {
  width: 14px;
  height: 14px;
}
.cmeta-value {
  flex: 1 1 auto;
  min-width: 0;
  /* Keep the number on ONE line — overflow-wrap:anywhere was breaking it digit-per-
     line when the PRIMARY / THIS THREAD badges squeezed the row (Hakim's screenshot). */
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cmeta-badge {
  flex: 0 0 auto;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.cmeta-badge--active {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
/* Workspace-user badge in the people view — same accent family as --active. */
.cmeta-badge--user {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
/* Multi-person thread card — one block per participant: name row (+User badge)
   above that person's own methods, so nobody's details masquerade as the thread's. */
.cmeta-person {
  display: block;
  padding-top: 0.45rem;
  margin-top: 0.45rem;
  border-top: 1px solid var(--border-subtle);
}
.cmeta-person:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}
.cmeta-person-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}
.cmeta-none {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Composer recipient selector ("To: +44…" picker for multi-number contacts). */
.rcpt {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
}
.rcpt-label {
  color: var(--text-muted);
  font-weight: 600;
}
.rcpt-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.rcpt-trigger:hover {
  border-color: var(--border-strong);
}
.rcpt-caret {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.rcpt-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
}
.rcpt-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 71;
  min-width: 240px;
  padding: 0.3rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.rcpt-opt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.rcpt-opt:hover {
  background: var(--bg-input);
}
.rcpt-opt.is-active {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.rcpt-opt--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.rcpt-opt-icon {
  flex: 0 0 auto;
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}
.rcpt-opt-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.rcpt-opt-badge {
  flex: 0 0 auto;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
.rcpt-opt-badge--active {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

/* Non-image attachment download card (Figma's file card). */
.inbox-file-card {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.3rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  max-width: 100%;
}
.inbox-file-card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-file-card-icon {
  display: inline-flex;
  color: var(--text-soft);
  flex: 0 0 auto;
}


/* ---- Inbox CRM page (Details tab, plan C2) ------------------------------ */
.inbox-crm {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: flex-start;
}
.inbox-crm-main {
  flex: 1.6 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
/* ===========================================================================
   Pane-4 INTERNAL team feed — ClickUp-style activity panel (2026-06-13).
   Chat-like (oldest → newest, newest pinned at the bottom), day separators,
   rich avatar comments vs compact icon-led activity lines, composer pinned at
   the bottom. Replaces the old flat .inbox-crm-feed list. Theme tokens only
   (light/dark parity).
   =========================================================================== */
.inbox-feed {
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Fill pane 4 so the composer pins to the very bottom (Hakim 2026-06-13:
     "the text box is at the bottom of the page not halfway up it"). */
  flex: 1 1 auto;
}
.inbox-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 2px 2px 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.inbox-feed-head-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-primary);
}
.inbox-feed-head-title h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
}
.inbox-feed-head-title svg {
  color: var(--accent);
}
.inbox-feed-head-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.inbox-feed-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 2px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
/* Sparse feed hugs the bottom near the composer (ClickUp); the auto-margin
   collapses to a no-op once content overflows, so scroll-to-top still works. */
.inbox-feed-day:first-child {
  margin-top: auto;
}
.inbox-feed-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inbox-feed-day + .inbox-feed-day {
  margin-top: 4px;
}

/* Day separator — centred pill on a hairline. */
.inbox-feed-daysep {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 4px 0 2px;
}
.inbox-feed-daysep::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--border-subtle);
}
.inbox-feed-daysep span {
  position: relative;
  background: var(--bg-elevated);
  padding: 0 10px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* Comment (note) — avatar + stacked body, the rich item. */
.inbox-feed-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 4px 2px;
}
.inbox-feed-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 1px;
}
.inbox-feed-note-body {
  min-width: 0;
  flex: 1;
}
.inbox-feed-note-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.inbox-feed-note-name {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-primary);
}
.inbox-feed-note-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.inbox-feed-note-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-primary);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 1px;
}
.inbox-feed-mention {
  color: var(--accent);
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0 3px;
  border-radius: 4px;
}

/* Activity line — compact, icon-led, muted. */
.inbox-feed-event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 2px 3px 3px;
  font-size: 0.76rem;
  color: var(--text-soft);
}
.inbox-feed-event-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  color: var(--text-muted);
}
.inbox-feed-event-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.inbox-feed-event-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.inbox-feed-event-detail {
  color: var(--text-muted);
}
.inbox-feed-event-time {
  flex: 0 0 auto;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Empty state. */
.inbox-feed-empty {
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 24px 16px;
  color: var(--text-muted);
}
.inbox-feed-empty svg {
  color: var(--text-soft);
  opacity: 0.7;
}
.inbox-feed-empty p {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-soft);
}
.inbox-feed-empty span {
  font-size: 0.74rem;
  max-width: 230px;
}

/* Composer — pinned at the bottom, ClickUp-style box. */
.inbox-feed-compose {
  position: relative;
  flex: none;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* C8 ·2 — clickable Property block on the Details page → opens the pane-4 support view. */
.inbox-crm-property {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0.5px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  cursor: pointer;
}
.inbox-crm-property:hover {
  border-color: var(--border-strong);
}
.inbox-crm-property-img {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 9px;
  object-fit: cover;
  border: 0.5px solid var(--border-subtle);
}
.inbox-crm-property-img--ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-soft);
}
.inbox-crm-property-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.inbox-crm-property-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inbox-crm-property-addr {
  font-size: 0.78rem;
}
.inbox-crm-property-chevron {
  flex: 0 0 auto;
  font-size: 1.3rem;
  color: var(--text-muted);
}
/* A vertical stack of object cards (owned properties, related objects) — one shared
   list so every association reads as the same clickable object card (Hakim 2026-07-06:
   "we need consistency in design"). */
.inbox-crm-object-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.inbox-crm-object-list > li {
  margin: 0;
}

/* C8 ·2 — the pane-4 SUPPORT view (listing quick-view + actions). */
.inbox-support {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px 12px;
}
.inbox-support-back {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.inbox-support-back:hover {
  color: var(--text-primary);
}
.inbox-support-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 0.5px solid var(--border-subtle);
}
.inbox-support-image--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-soft);
}
.inbox-support-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inbox-support-title {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}
.inbox-support-sub {
  margin: 0;
  font-size: 0.82rem;
}
.inbox-support-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 2px;
}
.inbox-support-status {
  text-transform: capitalize;
}
.inbox-support-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* C8 (Hakim 2026-06-12): the name lives ONCE, in the editable top bar. */
.inbox-chat-title-edit {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.inbox-chat-title-edit input {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  min-width: 180px;
}
.inbox-chat-name-error {
  margin: 0.2rem 0 0;
}
/* Current tags (removable) at the top of the top-bar tag menu. */
.inbox-tag-menu-current {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 0 7px;
  margin-bottom: 7px;
  border-bottom: 0.5px solid var(--border-subtle);
}
/* Small uppercase section label on CRM cards (replaces the repeated name heading). */
.inbox-crm-card-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 0.5rem;
}
/* C8 contrast pass — the CRM/Details surface used very low-contrast greys
   ("contrast is off, hard to read"). Lift muted body text + dt labels + heads
   one step toward primary, both themes (tokens; --text-soft > --text-muted). */
.inbox-details-tab .muted,
.inbox-crm .muted {
  color: var(--text-soft);
}
.inbox-crm h4,
.inbox-crm-card-head h4 {
  color: var(--text-primary);
}
.inbox-crm-card {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 0.85rem 0.95rem;
}
.inbox-thread-participants {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 0.85rem 0.95rem;
}
.inbox-widget-control {
  display: grid;
  gap: 0.7rem;
}
.inbox-widget-control .inbox-thread-participants-head {
  margin-bottom: 0;
}
.inbox-widget-control .inbox-crm-card-label {
  margin-bottom: 0;
}
.inbox-widget-ai-state {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid color-mix(in srgb, var(--state-success) 42%, var(--border-subtle));
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-success) 9%, var(--bg-surface));
  color: var(--text-primary);
  padding: 0.22rem 0.48rem;
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}
.inbox-widget-ai-state.is-paused {
  border-color: color-mix(in srgb, var(--state-warning) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 9%, var(--bg-surface));
}
.inbox-widget-control-facts {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}
.inbox-widget-control-facts > div {
  display: grid;
  grid-template-columns: minmax(72px, 0.35fr) minmax(0, 1fr);
  gap: 0.65rem;
}
.inbox-widget-control-facts dt,
.inbox-widget-control-facts dd {
  margin: 0;
  min-width: 0;
  font-size: 0.8rem;
}
.inbox-widget-control-facts dt {
  color: var(--text-soft);
}
.inbox-widget-control-facts dd {
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-widget-control-actions {
  display: flex;
  justify-content: flex-start;
}
.inbox-widget-control-hint,
.inbox-widget-control-error {
  margin: 0;
  font-size: 0.76rem;
}
.inbox-thread-participants-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.inbox-thread-participant-list {
  display: grid;
  gap: 0.45rem;
}
.inbox-thread-participant {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
  color: var(--text-primary);
  padding: 0.48rem 0.55rem;
  text-align: left;
}
.inbox-thread-participant:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface);
}
.inbox-thread-participant strong,
.inbox-thread-participant small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-thread-participant small {
  color: var(--text-soft);
  font-size: 0.75rem;
}
/* PART B (2026-06-24) — roster row is CLICKABLE → opens the contact in pane-4
   ContactQuickView. When clickable the row drops from 3 grid cols
   (avatar|meta|actions) to 2 (the avatar+name button | actions); the button
   lays out the avatar + name itself with flex. */
.inbox-thread-participant-editor .inbox-thread-participant.is-clickable {
  grid-template-columns: minmax(0, 1fr) auto;
}
.inbox-thread-participant-open {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
}
.inbox-thread-participant-open .inbox-thread-participant-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-thread-participant-open:hover .inbox-thread-participant-meta strong {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.inbox-thread-participant-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* PART B — ContactQuickView (pane-4): add-method form + full-contact link.
   The deleted "Contact" identity card's actions live here now. */
.inbox-cqv-add-input {
  height: 32px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.82rem;
  padding: 0 0.5rem;
  min-width: 0;
}
.inbox-cqv-add-select {
  flex: 0 0 auto;
}
.inbox-cqv-add-input {
  flex: 1 1 8rem;
}
.inbox-cqv-add-input:focus {
  outline: none;
  border-color: var(--accent);
}
.inbox-cqv-add-btn {
  height: 32px;
  padding: 0 0.8rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.inbox-cqv-add-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.inbox-cqv-add-error {
  margin: 0.15rem 0 0;
}
.inbox-cqv-full-link {
  margin-top: 0.85rem;
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  /* Now a <button> (router.push, no full reload) — strip the native chrome. */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.inbox-cqv-full-link:hover {
  text-decoration: underline;
}
.inbox-crm-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
/* Details-pane consistency (Hakim 2026-07-04): card heads match the small-caps
   label family (.inbox-crm-card-label / .properties-res-section-head h4) so the
   pane doesn't alternate between two header styles. 0.75rem = the 12px floor. */
.inbox-crm-card-head h4 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.inbox-crm-card-summary {
  font-size: 0.72rem;
  line-height: 1.25;
}
.inbox-crm-identity {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
}
.inbox-crm-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}
.inbox-crm-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elevated));
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.95rem;
}
.inbox-crm-identity-text h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

/* Provisional (unidentified) contact flag in the CRM identity card. */
.inbox-crm-provisional-chip {
  align-self: flex-start;
  margin: 0 0 0.2rem;
  padding: 1px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 14%, transparent);
}
/* Hero badge: this contact IS a workspace user (staff who sign in). Accent
   sibling of the provisional chip. */
.inbox-cid-user-chip {
  align-self: flex-start;
  margin: 0 0 0.2rem;
  padding: 1px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
/* Kind chip ("Business" / "Group") beside the name — muted, so the accent
   User chip stays the loudest thing in the hero-meta row. */
.inbox-cid-kind-chip {
  align-self: flex-start;
  margin: 0 0 0.2rem;
  padding: 1px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
}

/* Contact profile photo: wrap + 64px avatar + camera/remove overlay buttons. */
.inbox-crm-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
}
.inbox-crm-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.inbox-crm-avatar-fallback.inbox-crm-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
/* Photo controls — both pinned to the avatar's own right edge (camera bottom,
   remove top). They must stay INSIDE the 64px wrap: `remove` used to sit at
   right:-28px, which cleared the wrap AND the hero's 0.75rem gap and landed on
   the text column — on the phone contact sheet it covered the "Added <date>"
   line outright (Hakim 2026-07-26). Same CSS drives the desktop pane-4 card. */
.inbox-crm-avatar-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-soft);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, color 0.15s;
}
.inbox-crm-avatar-btn:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.inbox-crm-avatar-btn:disabled,
.inbox-crm-avatar-btn.is-busy {
  opacity: 0.5;
  cursor: default;
}
.inbox-crm-avatar-camera {
  bottom: -2px;
  right: -2px;
}
.inbox-crm-avatar-remove {
  top: -2px;
  right: -2px;
}
/* Hidden file input — never visible */
.inbox-crm-avatar-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.inbox-contact-draft {
  margin: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.inbox-contact-draft-head h2 {
  margin: 0 0 0.25rem;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.25;
}
.inbox-contact-draft-head p {
  margin: 0 0 0.9rem;
  max-width: 46rem;
  font-size: 0.8rem;
}
.inbox-contact-draft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
/* The grid is a <fieldset> (locks all fields during save) — strip UA chrome. */
fieldset.inbox-contact-draft-grid {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: auto;
}
fieldset.inbox-contact-draft-grid:disabled {
  opacity: 0.65;
}
.inbox-contact-draft-field {
  display: grid;
  gap: 0.32rem;
}
.inbox-contact-draft-field > span {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Inline invalid-number feedback — sentence case, overrides the label styling above. */
.inbox-contact-draft-field > .inbox-contact-draft-field-error {
  color: var(--state-error, #ef4444);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}
/* No `select` here: this form has none, and a picker added later should wear the
   trigger class explicitly rather than rely on an element rule that a button
   would silently miss. */
.inbox-contact-draft-field input,
.inbox-contact-draft-field .selectmenu-trigger,
.inbox-contact-draft-field textarea {
  min-height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 0 0.65rem;
  font: inherit;
  font-size: 0.84rem;
}
/* Notes (and any future long field) spans the whole grid; a textarea needs its
   padding on both axes and manual resize kept vertical. */
.inbox-contact-draft-field.is-full {
  grid-column: 1 / -1;
}
.inbox-contact-draft-field textarea {
  padding: 0.5rem 0.65rem;
  resize: vertical;
  min-height: 72px;
}
.inbox-contact-draft-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
/* Standalone New Contact has a fixed-height workspace host. Keep the useful
   chrome (form heading + actions) outside the scrollport and let only the field
   grid consume/scroll the remaining height. The old block-flow form sat inside
   `.inbox-chat { overflow:hidden }`, so a short window clipped all three actions
   with no scrollbar even though the Retina display had ample physical pixels. */
.inbox-shell--new-contact .inbox-contact-record > .inbox-contact-draft {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.inbox-shell--new-contact .inbox-contact-draft-head,
.inbox-shell--new-contact .inbox-contact-draft-actions {
  flex: 0 0 auto;
}
.inbox-shell--new-contact fieldset.inbox-contact-draft-grid {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 0.35rem;
}
.inbox-shell--new-contact .inbox-contact-draft-actions {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.inbox-crm-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.inbox-crm-role {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 650;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  color: var(--text-soft);
  text-transform: capitalize;
}
.inbox-crm-role.is-primary {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  color: var(--text-primary);
}
/* Built-in "User" type chip — filled accent tint, no remove ×: workspace users
   carry it automatically, it isn't an editable relationship type. */
.inbox-crm-role.is-user {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.inbox-crm-role em {
  font-style: normal;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 70%, var(--text-primary));
}
.inbox-crm-mini-badge {
  margin-left: 0.4rem;
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.02rem 0.35rem;
}
.inbox-crm-empty {
  font-size: 0.8rem;
  margin: 0.2rem 0 0;
}
/* Per-property Charges — Financials tab pane 4 (PropertiesFinancialsChargesNav).
   Tokens only → light/dark parity (CLAUDE.md §5); mirrors the .inbox-crm-card rail. */
.charges-total {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.charges-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.charges-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-subtle);
}
.charges-item:first-child {
  border-top: none;
}
.charges-item-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 12rem;
  gap: 0.1rem;
  min-width: 0;
}
.charges-item-title {
  font-size: 0.82rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.charges-item-meta {
  font-size: 0.72rem;
}
.charges-item-amount {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Credits render as negative money-back lines (token → light/dark parity). */
.charges-item-amount.is-credit {
  color: var(--state-success);
}
.charges-item-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
}
.charges-item-edit,
.charges-item-delete,
.charges-account-default {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
}
.charges-item-edit:hover:not(:disabled),
.charges-item-delete:hover:not(:disabled),
.charges-account-default:hover:not(:disabled) {
  color: var(--accent-primary);
}
.charges-item-delete:hover:not(:disabled) {
  color: var(--state-error);
}
.charges-item-edit:disabled,
.charges-item-delete:disabled {
  cursor: default;
  opacity: 0.55;
}
.charges-delete-confirm {
  flex: 1 0 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0 0.1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.charges-delete-confirm button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.2rem;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
  white-space: nowrap;
}
.charges-delete-confirm button:first-of-type {
  color: var(--state-error);
  font-weight: 600;
}
.charges-delete-confirm button:disabled {
  cursor: default;
  opacity: 0.55;
}
.charges-delete-error {
  flex: 1 0 100%;
  color: var(--state-error);
  font-size: 0.72rem;
}
.charges-account-default:disabled {
  cursor: default;
  opacity: 0.72;
}
/* Period chips row: the pane follows the waterfall's month via ?finPeriod=. */
.charges-period-row {
  margin-top: 0.5rem;
}
.charges-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.2rem;
}
.charges-finalised-warning {
  margin-top: 0;
  color: color-mix(in srgb, var(--state-warning) 82%, var(--text-main));
  border: 1px solid color-mix(in srgb, var(--state-warning) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 7%, var(--surface-1));
}
.charges-finalised-warning strong {
  display: block;
  color: var(--text-main);
  font-size: 0.78rem;
}
.charges-finalised-warning p {
  margin: 0.15rem 0 0;
}
.charges-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.charges-field > span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
/* No `select` here any more: the charges pickers are SelectMenu triggers wearing
   properties-input-text, which is their box. */
.charges-field input {
  width: 100%;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-main);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
}
.charges-field input:focus {
  outline: none;
  border-color: var(--accent-primary);
}
.charges-field-row {
  display: flex;
  gap: 0.55rem;
}
.charges-field-row .charges-field {
  flex: 1;
}
.charges-error {
  font-size: 0.74rem;
  color: var(--accent-danger);
  margin: 0;
}
/* List-first rework (2026-07-19). The pane reads at rest; adding is a disclosure.
   All tokens → light/dark parity for free (CLAUDE.md §5). */
.charges-head-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}
.charges-add-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.2rem 0.5rem 0.2rem 0.4rem;
  cursor: pointer;
}
.charges-add-toggle:hover {
  border-color: var(--accent-primary);
  background: var(--surface-1);
}
/* The destination — the consequence of adding a charge, stated once. */
.charges-destination {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  line-height: 1.4;
}
.charges-destination strong {
  color: var(--text-main);
  font-weight: 600;
}
.charges-saved-notice,
.charges-finalised-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.6rem 0.65rem;
  border-radius: 10px;
  font-size: 0.75rem;
  line-height: 1.45;
}
.charges-saved-notice {
  color: color-mix(in srgb, var(--state-success) 78%, var(--text-primary));
  border: 1px solid color-mix(in srgb, var(--state-success) 36%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-success) 8%, var(--surface-1));
}
.charges-saved-notice svg,
.charges-finalised-warning svg {
  flex: none;
  margin-top: 0.05rem;
}
.charges-form .charges-finalised-warning {
  margin-top: 0;
}
.charges-pending {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.65rem;
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--state-warning) 40%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--state-warning) 6%, var(--surface-1));
}
.charges-pending-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}
.charges-pending-head h5,
.charges-pending-head p {
  margin: 0;
}
.charges-pending-head h5 {
  color: var(--text-main);
  font-size: 0.8rem;
}
.charges-pending-head p {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}
.charges-pending-head > span {
  flex: none;
  color: color-mix(in srgb, var(--state-warning) 80%, var(--text-main));
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.charges-pending-list {
  margin-top: 0.25rem;
}
.charges-item.is-pending-correction {
  border-color: color-mix(in srgb, var(--state-warning) 24%, var(--border-subtle));
}
.charges-item-correction {
  color: color-mix(in srgb, var(--state-warning) 82%, var(--text-main));
  font-size: 0.7rem;
  font-weight: 650;
}
/* Empty state — what a charge is + where it goes, with a clear first action. */
.charges-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 1.4rem 0.75rem 0.5rem;
}
.charges-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--text-muted);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  margin-bottom: 0.15rem;
}
.charges-empty-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  margin: 0;
}
.charges-empty-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 26ch;
  margin: 0;
}
.charges-empty-cta {
  margin-top: 0.6rem;
}
/* The add form is now its own card, only when open. */
.charges-add-card {
  animation: charges-add-in 0.14s ease-out;
}
@keyframes charges-add-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* VAT disclosure — collapsed to a single summary row; the common charge skips it. */
.charges-vat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.charges-vat-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  font: inherit;
  font-size: 0.78rem;
  color: var(--text-main);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  cursor: pointer;
}
.charges-vat-summary:hover {
  border-color: var(--accent-primary);
}
.charges-vat-summary > span:first-child {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.charges-vat-current {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.charges-vat-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.charges-vat-chip {
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}
.charges-vat-chip:hover {
  border-color: var(--accent-primary);
}
.charges-vat-chip.is-active {
  color: var(--accent-contrast, #fff);
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
/* Destination reminder inside the form. */
.charges-form-dest {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  margin: 0;
}
.charges-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.1rem;
}
/* Invoice-grade charge fields (slice 1): description + AI draft, invoice ref, account
   picker, VAT rate. Tokens only → light/dark parity (CLAUDE.md §5). */
.charges-item-desc {
  font-size: 0.76rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.charges-item-ref {
  display: inline-block;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
  font-size: 0.68rem;
  padding: 0.02rem 0.32rem;
  margin-right: 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  background: var(--surface-1);
}
.charges-desc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.charges-desc-head > span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.charges-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  cursor: pointer;
}
.charges-ai-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
}
.charges-ai-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.charges-ai-note {
  font-size: 0.72rem;
  margin: 0.2rem 0 0;
}
.charges-textarea {
  width: 100%;
  resize: vertical;
  min-height: 2.8rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-main);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
}
.charges-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}
.charges-account-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.charges-account-row .sw-amount-picker-trigger {
  flex: 1 1 auto;
  min-width: 0;
}
.charges-account-default {
  min-height: 1.9rem;
  padding: 0 0.25rem;
}
.charges-account-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 auto;
  color: var(--text-muted);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
}
.charges-account-clear:hover {
  border-color: var(--accent-primary);
  color: var(--text-main);
}
.charges-vat-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.charges-vat-rate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.charges-vat-rate-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.charges-vat-rate-input {
  width: 4.5rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-main);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.3rem 0.45rem;
}
.charges-vat-rate-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}
/* Invoice-standard composer (2026-07-30): each draft LINE is a bordered group;
   the totals block reads like an invoice footer. Tokens only → light/dark parity. */
.charges-lines {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.charges-line {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-1);
}
.charges-line-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.charges-line-no {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.charges-line-remove {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.charges-line-remove:hover {
  background: var(--surface-2);
  color: var(--text-main);
}
.charges-line-title {
  flex: 1;
}
.charges-line-money {
  margin: 0;
  font-size: 0.75rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.charges-add-line {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  border: 1px dashed var(--border-subtle);
  border-radius: 9px;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
}
.charges-add-line:hover {
  background: var(--surface-2);
}
.charges-totals {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--border-subtle);
}
.charges-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.charges-totals-net {
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text-main);
}
.fin-adj-subtotal {
  border-top: 1px solid var(--border-subtle);
  font-weight: 600;
}
/* #61 — Attachments section: a thumbnail/file-row grid (2-up; single column on
   the narrowest rails). Tokens only → light/dark parity for free. */
.inbox-crm-attachments {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}
@media (min-width: 360px) {
  .inbox-crm-attachments {
    grid-template-columns: 1fr 1fr;
  }
}
.inbox-crm-attachment {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.inbox-crm-attachment:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface));
}
.inbox-crm-attachment-thumb {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-surface));
  border: 1px solid var(--border-subtle);
}
.inbox-crm-attachment-thumb--file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
}
.inbox-crm-attachment-name {
  min-width: 0;
  font-size: 0.78rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* #27 — a recording row's call date/time reads secondary to the kind+length. */
.inbox-crm-attachment-when { color: var(--text-muted); }
.inbox-crm-stays,
.inbox-crm-convos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.inbox-crm-stays li {
  min-width: 0;
}
/* A stay is a clickable object card — opens the property quick view (pane 4),
   matching the owned-property card. Flex so a missing payout still keeps the
   chevron flush right. */
.inbox-crm-stay {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  min-width: 0;
  appearance: none;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.3rem 0.4rem;
  margin: -0.3rem -0.4rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.inbox-crm-stay:hover {
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-surface));
  border-color: var(--border-subtle);
}
.inbox-crm-stay:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.inbox-crm-stay .inbox-crm-stay-main {
  flex: 1 1 auto;
}
.inbox-crm-stay-thumb {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-surface));
  border: 1px solid var(--border-subtle);
}
.inbox-crm-stay-thumb--ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-soft);
  font-weight: 700;
}
.inbox-crm-stay-main {
  min-width: 0;
  display: grid;
  gap: 0.1rem;
}
.inbox-crm-stay-main .muted {
  font-size: 0.74rem;
}
.inbox-crm-stay-listing {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-crm-stay-amt {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.inbox-crm-convos a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
}
.inbox-crm-convos a:hover {
  text-decoration: underline;
}
/* (old flat .inbox-crm-feed list/compose styles removed 2026-06-13 — replaced
   by the ClickUp-style .inbox-feed* block above.) */

/* ---- Inbox CRM: merge & split + archetype blocks (C4, plan §8) ---- */
.inbox-crm-merge {
  margin-top: 0.6rem;
}
.inbox-crm-merge-toggle {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--text-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.inbox-crm-merge-toggle:hover {
  color: var(--text-primary);
}
.inbox-crm-merge-panel {
  margin-top: 0.45rem;
  padding: 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.inbox-crm-merge-hint {
  margin: 0;
  font-size: 0.74rem;
}
.inbox-crm-merge-search {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.65rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
}
.inbox-crm-merge-search:focus-within {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 12%, transparent);
}
.inbox-crm-merge-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
}
.inbox-crm-merge-search input::placeholder {
  color: var(--text-muted);
}
.inbox-crm-merge-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.7rem;
}
.inbox-crm-merge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.inbox-crm-merge-targets {
  max-height: min(42vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-surface);
}
.inbox-crm-merge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}
.inbox-crm-merge-targets .inbox-crm-merge-row {
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}
.inbox-crm-merge-targets .inbox-crm-merge-row:last-child {
  border-bottom: 0;
}
.inbox-crm-merge-who {
  display: flex;
  flex-direction: column;
  flex: 1 1 180px;
  min-width: 0;
  font-size: 0.82rem;
}
.inbox-crm-merge-who > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-crm-merge-who .muted {
  font-size: 0.72rem;
}
.inbox-crm-merge-name {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.inbox-crm-merge-suggested {
  flex: 0 0 auto;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.35;
}
.inbox-crm-merge-actions {
  display: flex;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.inbox-crm-merge-more {
  margin: 0;
  font-size: 0.7rem;
}
.inbox-crm-merge-history {
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.inbox-crm-merge-history > .muted {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
@media (hover: none) {
  .inbox-crm-merge-targets .btn {
    min-height: 40px;
  }
}

/* Associated tasks (InboxCrmDetails 3c) — linked task rows + an add control.
   All colour via theme tokens → light/dark parity for free. */
.inbox-crm-tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.inbox-crm-task-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.3rem 0.4rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 0.82rem;
}
.inbox-crm-task-row:hover {
  background: var(--surface-muted);
}
.inbox-crm-task-dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--accent-contrast);
}
.inbox-crm-task-dot.is-done {
  background: var(--accent);
  border-color: var(--accent);
}
.inbox-crm-task-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-crm-task-title.is-done {
  text-decoration: line-through;
  color: var(--text-muted);
}
.inbox-crm-task-meta {
  flex: 0 0 auto;
  font-size: 0.72rem;
}
.inbox-crm-task-add {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  align-items: center;
}
.inbox-crm-task-add .inbox-cqv-tag-input {
  flex: 1 1 auto;
  min-width: 0;
}
.inbox-crm-task-add-btn {
  flex: 0 0 auto;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}
.inbox-crm-task-add + .task-tag-requirement-field {
  margin-top: 0.45rem;
}
.inbox-crm-task-create-error {
  margin: 0.35rem 0 0;
  color: var(--state-danger);
  font-size: 0.75rem;
}

/* Existing tasks matching what is being typed, offered for linking rather than
   re-creating (Hakim: "I should also be able to link existing tasks which creates a
   relationship between the task and the thread"). Same row metrics as
   .inbox-crm-task-row above so the two lists read as one card, not a popup. */
.inbox-crm-task-matches {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--border-subtle);
}
.inbox-crm-task-matches-head {
  margin: 0 0 0.25rem;
  padding: 0 0.4rem;
  font-size: 0.72rem;
}
.inbox-crm-task-matches ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.inbox-crm-task-match {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  /* padding: 0 is load-bearing — see the global `button svg` note at the top of this
     file. Without it the 16px link glyph is squeezed by the global button padding. */
  padding: 0.3rem 0.4rem;
  border: none;
  border-radius: 8px;
  background: none;
  color: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}
.inbox-crm-task-match:hover:not(:disabled) {
  background: var(--surface-muted);
}
.inbox-crm-task-match:disabled {
  opacity: 0.6;
  cursor: default;
}
.inbox-crm-task-match > svg {
  flex: 0 0 auto;
  color: var(--text-muted);
}
.inbox-crm-task-match-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-crm-task-match-meta {
  flex: 0 0 auto;
  font-size: 0.72rem;
}
/* The full task creator, rendered inside this card only where the host has nowhere
   else for it (the phone's details sheet — see onCreateDetailedTask). */
.inbox-crm-task-detailed-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
}
/* Touch: this card is the SAME component inside the phone's details sheet, where a
   29px row is a mean target for a thumb. 44px is the standing minimum here. */
@media (hover: none) {
  .inbox-crm-task-match {
    min-height: 44px;
    font-size: 0.86rem;
  }
  .inbox-crm-task-matches-head {
    font-size: 0.76rem;
  }
  .inbox-crm-task-detailed-btn {
    min-height: 44px;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   Home "Today / Command Center" dashboard (app/HomeClient.tsx)
   Pane-3 content for "/". All colour via theme tokens → light/dark for free.
   ────────────────────────────────────────────────────────────────────────── */
.home-wrap {
  /* width:100% + min-width:0 pin the wrap to the main pane: without them the
     flex item sizes to its content's max-content (the long no-wrap message
     previews) and overflows on narrow panes. */
  width: 100%;
  min-width: 0;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
/* Every nesting level must be able to shrink below its content's intrinsic
   width, else the no-wrap message/property text blows the grid out on narrow
   panes (flex/grid items default to min-width:auto = min-content). */
.home-wrap > *,
.home-cols > *,
.home-side > * {
  min-width: 0;
}
.home-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home-greeting {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
/* Stavros's read of the day in place of the clock greeting. His glyph sits on
   the first line so it reads as him speaking, and the text can run to two lines
   without the mark drifting to the middle. Mood tints the mark only — the words
   stay at full contrast in both themes. */
.home-greeting--brief {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 1.32rem;
  line-height: 1.35;
  text-wrap: balance;
}
.home-greeting--brief > svg {
  flex: none;
  margin-top: 2px;
  color: var(--accent);
}
/* Moods are exactly calm | busy | attention (lib/ai/blocks CanvasMood). */
.home-greeting--brief.is-attention > svg {
  color: var(--state-error);
}
.home-greeting--brief.is-busy > svg {
  color: var(--state-warning);
}
.home-subline {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.home-error {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--state-error);
}

.home-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.home-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--sp3-radius, 16px);
  box-shadow: var(--sp3-shadow-md);
  padding: 18px;
}

/* Zone 1 — Today */
.home-today-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.home-today-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-today-ic {
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.home-today-ic[data-tone="warn"] {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 15%, transparent);
}
.home-today-ic[data-tone="success"] {
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 15%, transparent);
}
.home-today-ic[data-tone="neutral"] {
  color: var(--text-soft);
  background: var(--surface-muted);
}
.home-metric-num {
  font-size: 1.85rem;
  font-weight: 680;
  line-height: 1.05;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.home-metric-lbl {
  margin-top: 2px;
  font-size: 0.82rem;
  font-weight: 550;
  color: var(--text-soft);
}
.home-metric-sub {
  min-height: 1em;
  font-size: 0.72rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Zones 2 + 3/4 */
.home-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.home-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Zone 2 — needs attention */
.home-attn-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
.home-count-pill {
  min-width: 20px;
  padding: 1px 9px;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 999px;
}
.home-attn-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.home-attn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: background 120ms ease;
}
.home-attn-row:hover {
  background: var(--surface-muted);
}
.home-attn-ic {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.home-attn-ic[data-kind="task"] {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 14%, transparent);
}
.home-attn-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}
.home-attn-row-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.home-attn-row-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-attn-time {
  flex: 0 0 auto;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.home-attn-chev {
  flex: 0 0 auto;
  display: inline-flex;
  color: var(--text-muted);
}
.home-prio {
  padding: 1px 6px;
  font-size: 0.64rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 5px;
  color: var(--text-soft);
  background: var(--surface-muted);
}
.home-prio[data-p="urgent"] {
  color: var(--state-error);
  background: color-mix(in srgb, var(--state-error) 14%, transparent);
}
.home-prio[data-p="high"] {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 14%, transparent);
}
.home-attn-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.home-attn-foot button {
  padding: 2px 0;
  font-size: 0.76rem;
  font-weight: 550;
  color: var(--accent);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.home-attn-foot button:hover {
  text-decoration: underline;
}
.home-attn-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: auto 0;
  padding: 28px 10px;
  text-align: center;
  color: var(--state-success);
}
.home-attn-empty-title {
  margin: 4px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}
.home-attn-empty-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Zone 3 — pulse */
.home-pulse-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Shown INSTEAD of the revenue/ADR rows when the viewer only holds some of the
   properties: those figures are the whole business's, so they are withheld
   rather than filtered into a number that would look like theirs. */
.home-pulse-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.home-pulse-list {
  display: flex;
  flex-direction: column;
}
/* The earnings row is a disclosure button; it must not look like one until
   hovered, because it sits in a column of plain rows. */
.home-pulse-tap {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
  border-radius: 8px;
}
.home-pulse-tap:hover { background: var(--bg-input); }
.home-pulse-break {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}
.home-pulse-break-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 2px 0;
}
.home-pulse-break-row.is-headline {
  color: var(--text-primary);
  font-weight: 700;
}
.home-pulse-break .home-pulse-note { margin-top: 6px; }
.home-pulse-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 0;
  border-top: 1px solid var(--border-subtle);
}
.home-pulse-row:first-child {
  border-top: 0;
  padding-top: 2px;
}
.home-pulse-lbl {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.home-pulse-val {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 1.4rem;
  font-weight: 680;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.home-delta {
  font-size: 0.74rem;
  font-weight: 600;
}
.home-delta[data-dir="up"] {
  color: var(--state-success);
}
.home-delta[data-dir="down"] {
  color: var(--state-error);
}

/* Zone 4 — jump back in */
.home-recent-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-recent {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.home-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: background 120ms ease;
}
.home-chip:hover {
  background: var(--surface-muted);
}
.home-chip-mark {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.home-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.home-chip-name {
  font-size: 0.83rem;
  font-weight: 550;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-chip-city {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.home-browse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 550;
  color: var(--accent);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: gap 120ms ease;
}
.home-browse:hover {
  gap: 9px;
}

/* skeletons */
.home-skel {
  display: inline-block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--surface-muted) 25%,
    var(--bg-input) 50%,
    var(--surface-muted) 75%
  );
  background-size: 200% 100%;
  animation: home-shimmer 1.3s ease-in-out infinite;
}
.home-skel-num {
  width: 52px;
  height: 1.5rem;
}
.home-skel-line {
  height: 0.7rem;
  margin: 2px 0;
}
.home-skel-ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.home-skel-chip {
  width: 100%;
  height: 30px;
  border-radius: 8px;
}
.home-attn-row-skel {
  pointer-events: none;
}
@keyframes home-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@media (max-width: 940px) {
  .home-cols {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .home-wrap {
    padding: 18px 16px 40px;
    gap: 20px;
  }
  .home-today-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-greeting {
    font-size: 1.3rem;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
   AI Ops pane (pane 5) — premium rebuild (2026-06-17).
   Calm + flat: no orb glow, no breathing. One indigo accent; all colour via
   theme tokens (#5) so light/dark parity is automatic. The only motion is a
   restrained "thinking" shimmer + typing dots, both off under reduced-motion.
   The collapsed rail keeps its class names (WorkspaceShell markup) but is
   retuned to a quiet static mark.
   ────────────────────────────────────────────────────────────────────────── */

/* Collapsed rail — quiet, no glow / no breathing. */
/* Collapsed AI pane — premium rail (redesigned 2026-07-02: "generic and uninspired… badge is
   useless" — the 9px corner dot became two legible counter chips, and hovering the approvals
   counter peeks the actual items). Stays in the 5-pane grid; AiOpsPane renders this when
   `collapsed`. Top-anchored so the mark lines up with the other panes' headers. */
.aiops-rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  width: 100%;
  padding: 14px 0 12px;
  /* Faint accent wash settling into the surface — reads intentional, not leftover. */
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 6%, var(--bg-elevated)) 0%,
    var(--bg-elevated) 42%
  );
  border-left: 1px solid var(--border-subtle);
  /* The whole rail expands the pane (every inner action ends in onExpand too). */
  cursor: pointer;
  transition: background 0.16s ease;
}
.aiops-rail:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 10%, var(--bg-elevated)) 0%,
    color-mix(in srgb, var(--accent) 3%, var(--bg-elevated)) 60%
  );
}
/* Brand gradient hairline hugging the pane edge — the rail's one flourish,
   echoing the wordmark's violet→pink→indigo chip. Static: no glow, no motion. */
.aiops-rail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -1px;
  width: 2px;
  background: linear-gradient(180deg, #7c3aed 0%, #ec4899 52%, #3730a3 100%);
  opacity: 0.55;
  pointer-events: none;
}
.aiops-rail:hover::before {
  opacity: 0.85;
}
.aiops-rail-open {
  display: inline-flex;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.aiops-rail-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 60%, #3730a3 125%);
  color: #fff;
  box-shadow:
    0 2px 10px color-mix(in srgb, var(--accent) 28%, transparent),
    inset 0 0 0 1px rgb(255 255 255 / 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.aiops-rail:hover .aiops-rail-mark {
  transform: translateY(-1px);
  box-shadow:
    0 6px 18px color-mix(in srgb, var(--accent) 42%, transparent),
    inset 0 0 0 1px rgb(255 255 255 / 0.24);
}
/* Split counters — unread chat replies (accent) vs pending approvals (warning). Legible on
   purpose: 11px/700 tabular digits, not a 9px corner dot. */
.aiops-rail-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  height: 26px;
  padding: 0 9px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.aiops-rail-chip:hover {
  transform: translateY(-1px);
}
.aiops-rail-chip.is-mentions {
  background: color-mix(in srgb, var(--accent) 13%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  color: var(--accent);
}
.aiops-rail-chip.is-mentions:hover {
  background: color-mix(in srgb, var(--accent) 20%, var(--bg-elevated));
}
.aiops-rail-chip.is-approvals {
  background: color-mix(in srgb, var(--state-warning) 15%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-warning) 38%, transparent);
  color: color-mix(in srgb, var(--state-warning) 82%, var(--text-primary));
}
.aiops-rail-chip.is-approvals:hover {
  background: color-mix(in srgb, var(--state-warning) 24%, var(--bg-elevated));
}
/* The gradient thread — a 2px fading vertical line that fills the rail's middle so the
   column reads composed instead of empty (replaces the rotated "ASSISTANT" word,
   killed 2026-07-13). */
.aiops-rail-thread {
  flex: 1;
  width: 2px;
  margin-block: 16px;
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    color-mix(in srgb, #7c3aed 34%, transparent) 30%,
    color-mix(in srgb, #ec4899 26%, transparent) 62%,
    transparent 100%
  );
  pointer-events: none;
}
.aiops-rail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.aiops-rail-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.aiops-rail-act:hover {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-muted));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-1px);
}
/* Hover peek — what the approvals counter is actually counting. Portaled to <body> (the slim
   pane is `contain: content`, which clips even fixed-position descendants) and positioned from
   the counter's rect, opening leftward off the rail. */
.aiops-rail-peek {
  position: fixed;
  z-index: 200;
  width: 268px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 14px 36px rgb(15 23 42 / 0.18);
}
.aiops-rail-peek-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
}
.aiops-rail-peek-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.aiops-rail-peek-count {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-warning) 16%, transparent);
  color: color-mix(in srgb, var(--state-warning) 82%, var(--text-primary));
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.aiops-rail-peek-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aiops-rail-peek-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  text-decoration: none;
  transition: background 0.12s ease;
}
.aiops-rail-peek-row:hover {
  background: var(--surface-muted);
}
.aiops-rail-peek-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}
.aiops-rail-peek-dot.tone-good {
  background: var(--state-success);
}
.aiops-rail-peek-dot.tone-warm,
.aiops-rail-peek-dot.tone-warn {
  background: var(--state-warning);
}
.aiops-rail-peek-dot.tone-bad {
  background: var(--state-danger);
}
.aiops-rail-peek-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.aiops-rail-peek-row-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aiops-rail-peek-row-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aiops-rail-peek-all {
  width: 100%;
  margin-top: 8px;
  padding: 7px 0;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.12s ease;
}
.aiops-rail-peek-all:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
/* Pane shell */
.aiops {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  min-width: 0;
  background: var(--bg-elevated);
}
.aiops-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex: none;
}
.aiops-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  flex: none;
}
.aiops-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
/* Notification pill — small accent gradient with real depth (the flat soft-tint
   version read as "flat and doesn't look right", Hakim 2026-07-02). */
.aiops-notify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 84%, #fff), var(--accent));
  color: var(--accent-contrast, #fff);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border: none;
  box-shadow:
    0 1px 3px color-mix(in srgb, var(--accent) 45%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 30%, transparent);
}
.aiops-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.aiops-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.aiops-iconbtn:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.aiops-iconbtn.on {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}
.aiops-tools-trigger {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.aiops-tools-trigger:hover {
  border-color: var(--border-subtle);
  background: var(--surface-muted);
  color: var(--text-primary);
}
.aiops-tools-trigger.is-active {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}
.aiops-tools-trigger.is-active .selectmenu-label.is-placeholder {
  color: var(--accent);
}
/* Without this the 18px icons get shrunk by the header flex row to ~8px wide — unrecognisable
   (the original "ridiculously small, can't see them" complaint). Matches .aiops-prompt svg. */
.aiops-iconbtn svg {
  flex: none;
}

/* Calm "thinking" shimmer — a hairline under the header, invisible at rest. */
.aiops-pulse {
  height: 2px;
  flex: none;
  background: transparent;
  overflow: hidden;
}
.aiops-pulse.on {
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: aiops-shimmer 1.1s ease-in-out infinite;
}
@keyframes aiops-shimmer {
  0% {
    background-position: -40% 0;
  }
  100% {
    background-position: 140% 0;
  }
}

/* Compact Stavros navigation. Ask, Rules and Needs you stay one tap away;
   Updates and lower-frequency surfaces use the canonical themed picker in the fourth
   equal slot. Long labels can never force the pane wider or disappear off its
   right edge. The phone sheet uses the exact same component and information
   hierarchy with phone tokens and larger touch targets below. */
.aiops-section-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
  margin: 8px 10px 7px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  flex: none;
}
.aiops-section-tab {
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 5px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.aiops-section-tab:hover {
  color: var(--text-primary);
}
.aiops-section-tab.on {
  background: var(--bg-elevated);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.aiops-section-label,
.aiops-section-more .selectmenu-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aiops-section-nav .aiops-section-more {
  width: 100%;
  justify-content: center;
}
.aiops-section-more > svg {
  width: 13px;
  height: 13px;
}
.aiops-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 84%, #fff), var(--accent));
  color: var(--accent-contrast, #fff);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent);
}
/* On the INACTIVE tab the solid accent pill shouts; soften it so the count reads as
   secondary until you're on the Approvals view (refined, not garish). */
.aiops-section-tab:not(.on) .aiops-section-count {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  box-shadow: none;
}
.aiops-section-nav.is-phone {
  margin: 0;
  padding: 8px 14px 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.aiops-section-nav.is-phone .aiops-section-tab {
  min-height: 38px;
  padding-inline: 7px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.08));
  border-radius: 19px;
  background: var(--ph-card, rgba(255, 255, 255, 0.04));
  color: var(--ph-text-2, #8a8a93);
  font-size: 12px;
}
.aiops-section-nav.is-phone .aiops-section-tab.on {
  border-color: transparent;
  background: var(--ph-accent-strong, #6366f1);
  color: #fff;
  box-shadow: none;
}
.aiops-section-nav.is-phone .aiops-section-tab.on > svg {
  color: currentColor;
}
.aiops-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   Stavros Agents. Shared unchanged between pane 5 and phone: the
   narrow surface is the product, not a cut-down afterthought.
   ============================================================ */
.agents {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  overflow: hidden;
}
.agents-intro {
  display: flex;
  gap: 10px;
  margin: 10px 12px 4px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border-subtle));
  border-radius: 13px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--bg-elevated)), var(--bg-elevated));
}
.agents-intro-mark,
.agent-card-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.agents-intro strong { display: block; font-size: 13px; }
.agents-intro p {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.45;
}
.agents-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}
.agents-bar button,
.agents-empty button,
.agents-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 11px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.agents-list {
  flex: 1;
  min-height: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0;
  padding: 2px 10px 16px;
  overflow-y: auto;
}
.agent-card {
  flex: none;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.agent-card.is-on {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 8%, transparent);
}
.agent-card-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 12px 8px;
}
.agent-card-avatar { width: 32px; height: 32px; border-radius: 9px; }
.agent-card-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.agent-card-copy strong { font-size: 13.5px; line-height: 1.3; }
.agent-card-copy span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.agent-card-copy:disabled { cursor: default; }
.agent-card-meta {
  display: grid;
  gap: 3px;
  padding: 0 12px 10px 53px;
  color: var(--text-muted);
  font-size: 10.5px;
}
.agent-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-muted) 45%, transparent);
}
.agent-run-status {
  min-width: 0;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 650;
  text-transform: capitalize;
}
.agent-run-status.tone-completed { color: #16a34a; }
.agent-run-status.tone-failed { color: #dc2626; }
.agent-run-status.tone-running,
.agent-run-status.tone-pending { color: var(--accent); }
.agent-run-status.tone-awaiting_review { color: #d97706; }
.agent-card-actions { display: flex; gap: 5px; }
.agent-card-actions button,
.agents-iconbtn,
.agents-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.agent-card-actions button.is-primary {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  color: var(--accent);
}
.agent-card-actions button:disabled,
.agents-save:disabled { cursor: default; opacity: .58; }
.agent-card-error {
  padding: 8px 12px;
  border-top: 1px solid color-mix(in srgb, #dc2626 22%, var(--border-subtle));
  color: #dc2626;
  font-size: 11px;
  line-height: 1.4;
}
.agent-card-warning {
  padding: 8px 12px;
  border-top: 1px solid color-mix(in srgb, #d97706 24%, var(--border-subtle));
  color: #d97706;
  font-size: 11px;
  line-height: 1.4;
}
.agent-card-backtest {
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-muted) 35%, transparent);
}
.agent-card-backtest > summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}
.agent-card-backtest > summary::-webkit-details-marker { display: none; }
.agent-card-backtest > summary > span { display: grid; gap: 2px; min-width: 0; }
.agent-card-backtest > summary strong { font-size: 11px; }
.agent-card-backtest > summary small { color: var(--text-muted); font-size: 9px; }
.agent-card-backtest > summary button {
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  color: var(--text-soft);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 9px;
  cursor: pointer;
}
.agent-card-backtest.tone-ready > summary strong { color: #16a34a; }
.agent-card-backtest.tone-needs_attention > summary strong { color: #d97706; }
.agent-card-backtest.tone-blocked > summary strong { color: #dc2626; }
.agent-card-backtest > div { display: grid; gap: 6px; padding: 0 12px 12px; }
.agent-card-backtest article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 7px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
}
.agent-card-backtest article > span { color: var(--text-muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.agent-card-backtest article > strong { font-size: 10px; }
.agent-card-backtest article > p,
.agent-card-backtest article > small { grid-column: 1 / -1; margin: 0; color: var(--text-soft); font-size: 9px; line-height: 1.4; }
.agents-loading,
.agents-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
}
.agents-empty {
  flex-direction: column;
  padding: 28px;
  text-align: center;
}
.agents-empty svg { color: var(--accent); }
.agents-empty strong { color: var(--text-primary); font-size: 14px; }
.agents-empty p { max-width: 320px; margin: 0 0 6px; line-height: 1.5; }
.agents-error {
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, #dc2626 25%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, #dc2626 8%, transparent);
  color: #dc2626;
  font-size: 11.5px;
  line-height: 1.4;
}
.agents-error.is-list { margin: 2px 10px 8px; }
.agents-editor { overflow-y: auto; }
.agents-editor-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(14px);
}
.agents-kicker {
  display: block;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.agents-editor-head h3 { margin: 2px 0 0; font-size: 15px; }
.agents-iconbtn { width: 34px; padding: 0; }
.agents-form { display: flex; flex-direction: column; gap: 14px; padding: 14px 12px 20px; }
.agents-field { display: flex; flex-direction: column; gap: 6px; }
.agents-field > span,
.agents-capabilities legend {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
/* The thread picker is a SelectMenu trigger (a <button>), so it must be listed
   here to wear the same box as the inputs beside it — the global button rule
   would otherwise make it bold and shrink-to-fit. `font: inherit` below is what
   gives the weight back. */
.agents-field input,
.agents-field textarea,
.agents-field .selectmenu-trigger {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  outline: none;
  background: var(--surface-muted);
  color: var(--text-primary);
  font: inherit;
  font-size: 12.5px;
}
.agents-field textarea { resize: vertical; line-height: 1.45; }
.agents-field-help {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.agents-field input:focus,
.agents-field textarea:focus,
.agents-field .selectmenu-trigger:focus { border-color: color-mix(in srgb, var(--accent) 68%, var(--border-subtle)); }
.agents-conversation-picker {
  display: grid;
  gap: 4px;
  max-height: 176px;
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.agents-conversation-picker > strong {
  position: sticky;
  top: -7px;
  z-index: 1;
  padding: 4px 2px 6px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 10px;
}
.agents-conversation-picker label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  min-height: 44px;
  padding: 7px 6px;
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 11px;
  cursor: pointer;
}
.agents-conversation-picker label:hover,
.agents-conversation-picker label.on { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--text-primary); }
.agents-conversation-picker input { width: 15px; min-height: 15px; margin-top: 2px; padding: 0; accent-color: var(--accent); }
.agents-conversation-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.agents-conversation-copy strong,
.agents-conversation-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agents-conversation-copy strong { color: inherit; font-size: 11px; font-weight: 700; }
.agents-conversation-copy small { color: var(--text-muted); font-size: 9.5px; font-weight: 500; }
.agents-conversation-picker.is-exclusions label.on { background: color-mix(in srgb, #d97706 10%, transparent); }
.agents-conversation-empty {
  padding: 7px 6px;
  color: var(--text-muted);
  font-size: 10.5px;
}
.agents-delay-field { display: flex; align-items: center; gap: 8px; }
.agents-delay-field input { width: 92px; }
.agents-delay-field span { color: var(--text-muted); font-size: 11px; }
.agents-schedule-runs { display: flex; flex-direction: column; gap: 7px; }
.agents-schedule-run {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
  align-items: end;
  gap: 7px;
}
.agents-schedule-run > label { display: flex; flex-direction: column; gap: 4px; }
.agents-schedule-run small { color: var(--text-muted); font-size: 9.5px; font-weight: 650; }
.agents-schedule-remove { width: 34px; min-height: 38px; padding: 0; color: var(--text-muted); }
.agents-add-run {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 9px;
  color: var(--accent);
}
.agents-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.agents-days button {
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.agents-days button.on {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-muted));
  color: var(--accent);
}
.agents-safety-callout {
  padding: 10px;
  border: 1px solid color-mix(in srgb, #d97706 34%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, #d97706 7%, var(--bg-elevated));
}
.agents-safety-callout strong { display: block; color: #b45309; font-size: 11.5px; }
.agents-safety-callout p { margin: 4px 0 0; color: var(--text-soft); font-size: 10.5px; line-height: 1.45; }
.agents-workflow-builder {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-elevated));
}
.agents-workflow-heading,
.agents-workflow-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.agents-workflow-heading > div { display: grid; gap: 2px; }
.agents-workflow-heading strong { font-size: 12.5px; }
.agents-workflow-heading small,
.agents-workflow-authority small { color: var(--text-muted); font-size: 9.5px; line-height: 1.4; }
.agents-workflow-heading > span {
  padding: 3px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
}
.agents-workflow-step {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.agents-workflow-step-head { justify-content: flex-start; }
.agents-workflow-step-head > span {
  display: inline-flex;
  flex: none;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}
.agents-workflow-step-head > strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agents-workflow-step-head > div { display: flex; gap: 3px; }
.agents-workflow-step-head button {
  display: inline-flex;
  width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-muted);
}
.agents-workflow-step-head button:disabled { opacity: .3; }
.agents-workflow-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
  padding: 0;
  border: 0;
}
.agents-workflow-sources legend {
  width: 100%;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
}
.agents-workflow-sources label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 9.5px;
  cursor: pointer;
}
.agents-workflow-sources label.on {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent);
}
.agents-workflow-sources input { width: 13px; height: 13px; accent-color: var(--accent); }
.agents-workflow-temporal {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface-muted));
}
.agents-workflow-temporal legend {
  padding: 0 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}
.agents-workflow-temporal-toggle {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
}
.agents-workflow-temporal-toggle > input {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: var(--accent);
}
.agents-workflow-temporal-toggle > span { display: grid; gap: 2px; }
.agents-workflow-temporal-toggle strong { font-size: 10.5px; }
.agents-workflow-temporal-toggle small,
.agents-workflow-runtime p { margin: 0; color: var(--text-muted); font-size: 9.5px; line-height: 1.4; }
.agents-workflow-temporal-controls { display: grid; gap: 8px; padding-top: 7px; border-top: 1px solid var(--border-subtle); }
.agents-workflow-temporal-kinds { display: flex; flex-wrap: wrap; gap: 5px; }
.agents-workflow-temporal-kinds label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 9.5px;
  cursor: pointer;
}
.agents-workflow-temporal-kinds label.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle)); }
.agents-workflow-temporal-kinds input { accent-color: var(--accent); }
.agents-workflow-clean {
  border-color: color-mix(in srgb, var(--state-success) 28%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-success) 4%, var(--surface-muted));
}
.agents-workflow-clean > legend { color: var(--state-success); }
.agents-workflow-clean-numbers,
.agents-workflow-clean-hours {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.agents-workflow-clean-numbers .agents-inline-number input { width: min(100%, 96px); }
.agents-workflow-clean-hours input[type="time"] {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  font: inherit;
  color-scheme: light dark;
}
.agents-workflow-clean-note {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.agents-workflow-clean-roster {
  max-height: 180px;
  overflow: auto;
  padding: 2px;
  scrollbar-width: thin;
}
.agents-workflow-clean-capacity {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
}
.agents-workflow-clean-capacity > strong {
  grid-column: 1 / -1;
  color: var(--text-soft);
  font-size: 10px;
}
.agents-inline-number { display: flex; align-items: center; gap: 7px; }
.agents-inline-number input { width: 96px; }
.agents-inline-number > span { color: var(--text-muted); font-size: 10px; }
.agents-workflow-runtime {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
}
.agents-workflow-runtime summary { cursor: pointer; color: var(--text-primary); font-size: 10.5px; font-weight: 800; }
.agents-workflow-runtime[open] summary { margin-bottom: 2px; }
.agents-workflow-authority { display: grid; gap: 6px; }
.agents-workflow-authority > div { display: grid; gap: 2px; }
.agents-workflow-authority strong { font-size: 10.5px; }
.agents-workflow-authority > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, .8fr);
  align-items: center;
  gap: 8px;
}
.agents-workflow-authority > label > span { color: var(--text-soft); font-size: 10px; }
.agents-workflow-authority .selectmenu-trigger { min-height: 32px; font-size: 10px; }
.agents-workflow-wait > div { display: flex; align-items: center; gap: 7px; }
.agents-workflow-wait input { width: 92px; }
.agents-workflow-wait div span { color: var(--text-muted); font-size: 10px; }
.agents-add-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  color: var(--accent);
}
.agents-capabilities {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}
.agents-capabilities legend { margin-bottom: 5px; }
.agents-capabilities label,
.agents-followup {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  cursor: pointer;
}
.agents-capabilities label.on { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle)); }
.agents-capabilities input { position: absolute; opacity: 0; pointer-events: none; }
.agents-cap-check {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: #fff;
}
.agents-capabilities label.on .agents-cap-check { border-color: var(--accent); background: var(--accent); }
.agents-capabilities strong,
.agents-followup strong { display: block; font-size: 12px; }
.agents-capabilities small,
.agents-followup small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 10.5px; line-height: 1.35; }
.agents-followup input { margin-top: 3px; accent-color: var(--accent); }
.agents-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 3px; }
.agents-delete { color: #dc2626; }
.agents-delete.is-confirming {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
.agents-save { min-height: 38px; }

/* A responder draft is an intervention surface, not another chat bubble. The
   source, reason, editable outcome and hard stop all remain visible together
   on desktop and phone so review never becomes a blind Approve button. */
.agent-review-section { border-color: color-mix(in srgb, #d97706 28%, var(--border-subtle)); }
.agent-review-list { display: grid; gap: 9px; }
.agent-review-card {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, #d97706 30%, var(--border-subtle));
  border-radius: 13px;
  background: var(--bg-elevated);
}
.agent-review-card > header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, #d97706 7%, var(--bg-elevated));
}
.agent-review-icon {
  display: inline-flex;
  flex: none;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #d97706;
  background: color-mix(in srgb, #d97706 13%, transparent);
}
.agent-review-title { min-width: 0; flex: 1; display: grid; gap: 2px; }
.agent-review-title strong { font-size: 12.5px; }
.agent-review-title small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-review-risk {
  flex: none;
  padding: 4px 6px;
  border-radius: 999px;
  color: #b45309;
  background: color-mix(in srgb, #d97706 12%, transparent);
  font-size: 8.5px;
  font-weight: 750;
  text-transform: uppercase;
}
.agent-review-risk.is-critical,
.agent-review-risk.is-high { color: #dc2626; background: color-mix(in srgb, #dc2626 10%, transparent); }
.agent-review-source,
.agent-review-why,
.agent-review-draft,
.agent-review-evidence { margin: 10px; }
.agent-review-source,
.agent-review-why {
  padding: 9px;
  border-radius: 9px;
  background: var(--surface-muted);
}
.agent-review-source strong,
.agent-review-why strong,
.agent-review-draft > span { display: block; color: var(--text-soft); font-size: 9.5px; font-weight: 750; }
.agent-review-source p,
.agent-review-why p { margin: 4px 0 0; color: var(--text-primary); font-size: 11px; line-height: 1.45; }
.agent-review-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.agent-review-flags span {
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, #d97706 24%, var(--border-subtle));
  border-radius: 999px;
  color: #b45309;
  font-size: 8.5px;
  font-weight: 650;
}
.agent-review-draft { display: grid; gap: 5px; }
.agent-review-draft textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  outline: none;
  background: var(--surface-muted);
  color: var(--text-primary);
  font: inherit;
  font-size: 11.5px;
  line-height: 1.45;
}
.agent-review-draft textarea:focus { border-color: color-mix(in srgb, var(--accent) 68%, var(--border-subtle)); }
.agent-review-card > .agent-review-translation { margin: -2px 10px 10px; }
.agent-review-card > .agent-review-translation.is-translated > p { font-size: 11px; }
.agent-review-card > .agent-review-translation.is-unavailable button { border-radius: 8px; }
.agent-review-evidence summary { cursor: pointer; color: var(--text-muted); font-size: 9.5px; font-weight: 700; }
.agent-review-evidence ul { margin: 7px 0 0; padding-left: 18px; color: var(--text-soft); font-size: 9.5px; line-height: 1.45; }
.agent-review-error { margin: 10px; color: #dc2626; font-size: 10px; line-height: 1.4; }
.agent-review-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-top: 1px solid var(--border-subtle);
}
.agent-review-links > a,
.agent-review-actions button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 9.5px;
  font-weight: 700;
  text-decoration: none;
}
.agent-review-actions { display: flex; gap: 5px; }
.agent-review-actions button { cursor: pointer; }
.agent-review-actions button.is-pause { color: #d97706; }
.agent-review-actions button.is-approve { border-color: var(--accent); color: var(--accent-contrast, #fff); background: var(--accent); }
.agent-review-actions button:disabled { cursor: default; opacity: .55; }

@media (max-width: 700px) {
  .agents-intro { margin-top: 6px; }
  .agents-bar button,
  .agents-empty button,
  .agents-save,
  .agent-card-actions button,
  .agents-iconbtn,
  .agents-delete { min-height: 42px; }
  .agent-card-foot { align-items: flex-start; flex-direction: column; }
  .agent-card-actions { align-self: stretch; }
  .agent-card-actions button { flex: 1; }
  .agent-card-backtest > summary { align-items: flex-start; flex-direction: column; }
  .agent-card-backtest > summary button { min-height: 40px; }
  .agents-field input,
  .agents-field textarea,
  .agents-field .selectmenu-trigger,
  .agents-days button { min-height: 44px; font-size: 14px; }
  .agents-conversation-picker input { width: 17px; min-height: 17px; }
  .agents-capabilities label,
  .agents-followup { padding: 11px; }
  .agents-workflow-step-head button { width: 42px; min-height: 42px; }
  .agents-workflow-sources label { min-height: 42px; padding: 8px 10px; font-size: 12px; }
  .agents-workflow-sources input { width: 17px; height: 17px; }
  .agents-workflow-temporal { padding: 11px; }
  .agents-workflow-temporal-toggle strong,
  .agents-workflow-runtime summary { font-size: 13px; }
  .agents-workflow-temporal-toggle small,
  .agents-workflow-runtime p { font-size: 11px; }
  .agents-workflow-temporal-kinds label { min-height: 42px; padding: 8px 10px; font-size: 12px; }
  .agents-workflow-temporal-kinds input,
  .agents-workflow-temporal-toggle > input { width: 17px; height: 17px; }
  .agents-workflow-clean-numbers,
  .agents-workflow-clean-hours,
  .agents-workflow-clean-capacity { grid-template-columns: 1fr; }
  .agents-workflow-clean-capacity > strong { grid-column: auto; font-size: 12px; }
  .agents-workflow-clean-roster { max-height: 250px; }
  .agents-workflow-clean-hours input[type="time"] { min-height: 44px; font-size: 14px; }
  .agents-workflow-authority > label { grid-template-columns: 1fr; gap: 4px; }
  .agents-workflow-authority > label > span { font-size: 12px; }
  .agent-review-card > footer { align-items: stretch; flex-direction: column; }
  .agent-review-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .agent-review-actions button { min-height: 44px; }
  .agent-review-actions button.is-pause { grid-column: 1 / -1; }
  .agent-review-translation.is-unavailable button { min-height: 42px; }
  .agent-review-draft textarea { min-height: 138px; font-size: 14px; }
}

/* ============================================================
   Automations (pane 5, third segment) + the builder overlay.
   Uses the same tokens as the rest of AI Ops → light/dark free.
   ============================================================ */
.automations {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.automations-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 10px;
  flex: none;
}
.automations-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.automations-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  color: var(--accent-contrast, #fff);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 26%, transparent);
  transition: filter 0.12s ease, transform 0.06s ease;
}
.automations-new:hover { filter: brightness(1.05); }
.automations-new:active { transform: translateY(0.5px); }
.automations-new svg { flex: none; }
.automations-new.is-cta { padding: 9px 15px; font-size: 13px; }

.automations-list {
  list-style: none;
  margin: 0;
  padding: 0 10px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Every row in these lists keeps its natural height — DO NOT REMOVE.
   Both lists are column flex containers inside a pane of definite height
   (.aiops-pane > .workflow-hub > .automations), and the rows themselves set
   overflow:hidden (.automation-card / .shortcut-card), which zeroes a flex item's
   automatic minimum size. Without flex:none the browser satisfies the overflow by
   CRUSHING every row instead of scrolling: with ~23 rules each card collapsed to a
   ~20px sliver with the name clipped mid-glyph and the on/off switch invisible
   (reported 2026-08-05). Applies to the flat list, the grouped list, Shortcuts and
   Runs — all four render through these two containers. */
.automations-list > li,
.automation-group-items > li {
  flex: none;
}

/* ---- Group-by (pane 5 Automations tab + builder Group picker) ---- */
.autobuild-grouprow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 2px;
}
.autobuild-grouprow .autobuild-fieldlabel {
  flex: none;
}
.autobuild-groupcancel {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.autobuild-groupcancel:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.automations-list-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 8px;
  flex: none;
}
.automations-list-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 155px;
  min-width: 0;
}
.automations-list-control > span {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
/* Group by / Sort by are SelectMenu triggers, i.e. <button>s — the global button
   rule would make them bold and shrink-to-fit, so the weight and the flex sizing
   are set here to match the control they replaced. */
.automations-list-control > .selectmenu-trigger {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
}
.automation-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.automation-group-headrow {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.automation-group-head {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 5px 2px;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.automation-group-chev {
  flex: none;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.automation-group-chev.closed {
  transform: rotate(-90deg);
}
.automation-group-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.automation-group-count {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-radius: 999px;
  padding: 1px 8px;
}
.automation-group-iconbtn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.automation-group-iconbtn:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.automation-group-iconbtn:disabled {
  opacity: 0.6;
  cursor: default;
}
.automation-group-renamerow {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: 4px;
}
.automation-group-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
}
.automation-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.automation-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.automation-card-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}
.automation-card.is-on {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  box-shadow: 0 1px 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.automation-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 11px 12px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}
.automation-card-main:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.automation-card-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.automation-card-summary {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft);
}
.automation-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.automation-run-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
}
.automation-run-chip.tone-sent { background: color-mix(in srgb, #16a34a 16%, transparent); color: #16a34a; }
.automation-run-chip.tone-failed { background: color-mix(in srgb, #dc2626 15%, transparent); color: #dc2626; }
.automation-run-chip.tone-skipped { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--text-muted); }
.automation-run-chip.tone-shortcut {
  gap: 5px;
  background: color-mix(in srgb, var(--accent) 13%, var(--surface-muted));
  color: var(--accent);
}
.automation-run-chip.tone-shortcut svg { flex: none; }

.automation-linked-shortcut-toggle {
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-muted) 38%, transparent);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.automation-linked-shortcut-toggle:hover:not(:disabled),
.automation-linked-shortcut-toggle.on {
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-muted));
  color: var(--accent);
}
.automation-linked-shortcut-toggle:disabled { opacity: 0.55; cursor: default; }
.automation-linked-shortcut-toggle svg { flex: none; }

.automation-history-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.automation-history-btn:hover,
.automation-history-btn.on { color: var(--accent); }

.automation-runlog {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border-subtle);
  padding: 8px 12px 10px;
  background: color-mix(in srgb, var(--surface-muted) 40%, transparent);
}
.automation-runlog-loading,
.automation-runlog-empty,
.automation-runlog-error {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft);
}
.automation-runlog-error { color: #dc2626; }
.automation-runlog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
/* Expand + Replay sit side by side; the line keeps the whole remaining width so
   the row still reads as one target on a narrow pane. */
.automation-runlog-main {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}
.automation-runlog-line {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 5px 0;
}
.automation-runlog-replay {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* The app's base button padding would squeeze the 16px glyph to 6px wide. */
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
/* Same trap as .automation-runlog-chev: an svg inside a flex box shrinks. Without
   this the 16px glyph renders 6px wide in the slim pane. */
.automation-runlog-replay svg { flex: none; }
.automation-runlog-replay:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.automation-runlog-replay:disabled { opacity: 0.5; cursor: default; }
.automation-runlog-flash {
  margin: 0 0 4px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-soft);
}
.automation-runlog-line.as-btn {
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}
.automation-runlog-line.as-btn:hover .automation-runlog-head { color: var(--text-primary); }
.automation-runlog-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 5px;
  background: var(--text-muted);
}
.automation-runlog-dot.tone-sent { background: #16a34a; }
.automation-runlog-dot.tone-failed { background: #dc2626; }
.automation-runlog-dot.tone-pending { background: var(--accent); }
.automation-runlog-what {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.automation-runlog-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}
.automation-runlog-sub {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.automation-runlog-when {
  flex: none;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.automation-runlog-chev {
  flex: none;
  color: var(--text-muted);
  margin-top: 1px;
  transition: transform 0.12s ease;
}
.automation-runlog-chev.open { transform: rotate(180deg); }
.automation-runlog-more {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 0 6px 14px;
}
.automation-runlog-reason,
.automation-runlog-step {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.automation-runlog-older {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 2px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  font-family: inherit;
}
.automation-runlog-older:disabled { opacity: 0.6; cursor: default; }

/* Reservation automation timeline. One shared body is hosted by the canonical
   reservation object and /reservations; token-only colours preserve light and
   dark parity, while rows collapse cleanly in slim pane 4 and phone sheets. */
.reservation-auto {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.reservation-auto-intro,
.reservation-auto-empty,
.reservation-auto-flash,
.reservation-auto-error,
.reservation-auto-loading {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
}
.reservation-auto-loading > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.reservation-auto-flash {
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-muted));
  color: var(--text-primary);
}
.reservation-auto-error { color: #dc2626; }
.reservation-auto-scheduled,
.reservation-auto-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reservation-auto-rule {
  padding: 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 55%, transparent);
}
.reservation-auto-rule.is-off { border-style: dashed; }
.reservation-auto-rule.is-shortcut {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 5%, var(--surface-muted));
}
.reservation-auto-rule-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}
.reservation-auto-icon {
  flex: none;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface-muted));
}
.reservation-auto-rule-copy,
.reservation-auto-history-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.reservation-auto-rule-copy strong,
.reservation-auto-history-copy strong {
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}
.reservation-auto-rule-copy > span,
.reservation-auto-history-copy > span,
.reservation-auto-history-copy small {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.reservation-auto-switch { margin: 1px 0 0 4px; }
.reservation-auto-switch:has(input:disabled) { cursor: default; opacity: 0.55; }
.reservation-auto-switch input:disabled { cursor: default; }
.reservation-auto-summary {
  margin: 8px 0 0 39px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-soft);
}
.reservation-auto-rule-actions {
  margin: 9px 0 0 39px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.reservation-auto-state {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.reservation-auto-state.is-on { color: #16a34a; }
.reservation-auto-state.is-shortcut { color: var(--accent); }
.reservation-auto-branch {
  margin: 9px 0 0 39px;
  display: grid;
  gap: 5px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}
.reservation-auto-shortcuts-head { margin-top: 2px; }
.reservation-auto-action,
.reservation-auto-replay {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.reservation-auto-action {
  min-height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
}
.reservation-auto-action:hover:not(:disabled),
.reservation-auto-replay:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.reservation-auto-action:disabled,
.reservation-auto-replay:disabled { opacity: 0.5; cursor: default; }
.reservation-auto-history-head {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.reservation-auto-history-head h4 {
  margin: 0;
  font-size: 12px;
  color: var(--text-primary);
}
.reservation-auto-history-head > span {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
}
.reservation-auto-history { gap: 0; }
.reservation-auto-history-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 70%, transparent);
}
.reservation-auto-history-row:last-child { border-bottom: 0; }
.reservation-auto-dot {
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}
.reservation-auto-dot.tone-sent { background: #16a34a; }
.reservation-auto-dot.tone-failed { background: #dc2626; }
.reservation-auto-dot.tone-pending,
.reservation-auto-dot.tone-awaiting_approval { background: var(--accent); }
.reservation-auto-history-row time {
  flex: none;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--text-muted);
}
.reservation-auto-replay {
  flex: none;
  width: 32px;
  height: 32px;
  margin-top: -2px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.reservation-auto-action svg,
.reservation-auto-replay svg { flex: none; }
@media (max-width: 640px) {
  .reservation-auto-summary,
  .reservation-auto-rule-actions,
  .reservation-auto-branch { margin-left: 0; }
  .reservation-auto-rule-actions { align-items: flex-start; }
}

.automation-switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  cursor: pointer;
}
.automation-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.automation-switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.automation-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.automation-switch.on .automation-switch-track { background: var(--accent); border-color: var(--accent); }
.automation-switch.on .automation-switch-thumb { transform: translateX(14px); }
.automation-switch.busy { opacity: 0.55; }

.automations-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 26px;
  gap: 7px;
}
.automations-empty-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  margin-bottom: 4px;
}
.automations-empty-title { font-size: 15px; font-weight: 650; color: var(--text-primary); }
.automations-empty-sub { font-size: 12.5px; line-height: 1.5; color: var(--text-soft); max-width: 260px; margin: 0 0 6px; }
.automations-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.automations-error {
  margin: 0 12px 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #dc2626 12%, transparent);
  color: #dc2626;
  font-size: 12px;
}

/* Saved manual workflows share the Automations home, action engine and card
   language. The inner tabs keep the top-level Stavros navigation calm. */
.workflow-hub {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.workflow-hub-tabs {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 8px 10px 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-muted);
}
.workflow-hub-tabs button {
  min-width: 0;
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.workflow-hub-tabs button.on {
  background: var(--bg-elevated);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
}
.shortcut-card .automation-card-row {
  align-items: center;
}
.shortcut-section {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 10px;
}
.shortcut-section + .shortcut-section {
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.shortcuts { overflow-y: auto; }
.shortcut-section .automations-list {
  flex: none;
  padding: 0;
  overflow: visible;
}
.shortcut-section-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
}
.shortcut-section-head small {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
}
.shortcut-run-btn {
  align-self: center;
  margin-right: 8px;
  padding: 7px 10px;
}
.automations-new:disabled,
.autobuild-testbtn:disabled {
  opacity: 0.5;
  cursor: default;
  filter: none;
}
.shortcut-runner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-muted) 35%, transparent);
}
.shortcut-runner-head,
.shortcut-batch-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.shortcut-runner-head > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shortcut-runner-head strong,
.shortcut-result-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}
.shortcut-runner-head small {
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.4;
}
.shortcut-inputs {
  display: grid;
  gap: 9px;
}
.shortcut-inputs label {
  display: grid;
  gap: 5px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
}
.linked-shortcut-field-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.linked-shortcut-field-label svg { flex: none; color: var(--accent); }
/* No `select` here any more: the contact picker is a SelectMenu trigger wearing
   autobuild-select grow, which already gives it the full width. */
.shortcut-inputs input {
  width: 100%;
  min-width: 0;
}
.shortcut-preview-btn {
  align-self: flex-start;
}
.shortcut-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.shortcut-counts span {
  border-radius: 999px;
  padding: 3px 7px;
  background: color-mix(in srgb, #f59e0b 13%, transparent);
  color: color-mix(in srgb, #f59e0b 82%, var(--text-primary));
  font-size: 10.5px;
  font-weight: 700;
}
.shortcut-counts span.is-ready {
  background: color-mix(in srgb, #16a34a 14%, transparent);
  color: #16a34a;
}
.shortcut-resend {
  align-items: flex-start;
}
.shortcut-targets {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.shortcut-target {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
}
.shortcut-target-mark {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  color: #d97706;
}
.shortcut-target.is-ready .shortcut-target-mark,
.shortcut-target.is-sent .shortcut-target-mark,
.shortcut-batch.is-completed .shortcut-target-mark {
  background: color-mix(in srgb, #16a34a 14%, transparent);
  color: #16a34a;
}
.shortcut-target.is-failed .shortcut-target-mark,
.shortcut-batch.is-failed .shortcut-target-mark {
  background: color-mix(in srgb, #dc2626 13%, transparent);
  color: #dc2626;
}
.shortcut-target-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shortcut-target-main strong {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
}
.shortcut-target-main small {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.shortcut-target-status {
  flex: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 650;
}
.shortcut-message-preview {
  flex: 1 0 100%;
  width: 100%;
  margin-top: 4px;
  margin-left: 27px;
  color: var(--text-muted);
  font-size: 10.5px;
}
.shortcut-message-preview strong {
  display: block;
  margin: 6px 0;
  color: var(--text-primary);
}
.shortcut-message-preview iframe {
  display: block;
  width: calc(100% - 27px);
  min-height: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.shortcut-run-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.linked-shortcut-review {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 10px;
  background: var(--bg-elevated);
}
.linked-shortcut-review-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.linked-shortcut-review-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--surface-muted));
}
.linked-shortcut-review-head > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.linked-shortcut-review-head strong { color: var(--text-primary); font-size: 12.5px; }
.linked-shortcut-review-head small { color: var(--text-muted); font-size: 11.5px; }
.linked-shortcut-review > p {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
}
.linked-shortcut-review ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
}
.linked-shortcut-note,
.linked-shortcut-warning {
  padding: 8px 9px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.45;
}
.linked-shortcut-warning {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: color-mix(in srgb, #f59e0b 9%, var(--surface-muted));
  color: color-mix(in srgb, #f59e0b 68%, var(--text-primary));
}
.linked-shortcut-warning.is-repeat {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-muted));
  color: var(--text-primary);
}
.linked-shortcut-warning svg { flex: none; margin-top: 1px; }
.shortcut-run-actions .danger,
.automations-new.danger {
  background: #b91c1c;
  color: #fff;
}
.shortcut-result {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, #16a34a 30%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, #16a34a 7%, transparent);
}
.shortcut-result.is-partial,
.shortcut-result.is-failed {
  border-color: color-mix(in srgb, #f59e0b 35%, var(--border-subtle));
  background: color-mix(in srgb, #f59e0b 7%, transparent);
}
.shortcut-result-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.shortcut-result p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11.5px;
}
.shortcut-batch {
  padding: 11px;
  overflow: visible;
}
.shortcut-batch-head {
  align-items: center;
}
.shortcut-batch-head .autobuild-testbtn {
  flex: none;
}
.automation-run-chip.tone-completed {
  background: color-mix(in srgb, #16a34a 16%, transparent);
  color: #16a34a;
}
.automation-run-chip.tone-partial {
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: #d97706;
}

/* --- builder overlay --- */
.autobuild-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 14100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in srgb, #000 58%, transparent);
  backdrop-filter: blur(4px);
}
.autobuild-dialog {
  width: min(1120px, calc(100vw - 48px));
  height: min(900px, calc(100dvh - 48px));
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}
.autobuild {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.autobuild-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
.autobuild-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px 9px 8px;
  border-bottom: 1px solid var(--border-subtle);
  flex: none;
}
.autobuild-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: none;
}
.autobuild-x:hover { background: var(--surface-muted); color: var(--text-primary); }
.autobuild-title { flex: 1; font-size: 13.5px; font-weight: 650; color: var(--text-primary); }
.autobuild-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  color: var(--accent-contrast, #fff);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--accent) 40%, transparent);
}
.autobuild-save:hover { filter: brightness(1.05); }
.autobuild-save:disabled { opacity: 0.6; cursor: default; }
.autobuild-save svg { flex: none; }

.autobuild-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.autobuild-dialog .autobuild-body {
  padding: 20px 28px 28px;
}
.autobuild-dialog .autobuild-body > * {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  box-sizing: border-box;
}
.autobuild-name {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}
.autobuild-name:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.autobuild-name::placeholder { color: var(--text-muted); font-weight: 500; }

.autobuild-block { display: flex; flex-direction: column; gap: 8px; }
.autobuild-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.autobuild-block-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.autobuild-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.autobuild-dot.when { background: var(--accent); }
.autobuild-dot.if { background: #f59e0b; }
.autobuild-dot.then { background: #16a34a; }
.autobuild-addaction {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, #16a34a 48%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, #16a34a 6%, transparent);
  color: #16a34a;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.autobuild-addaction:hover {
  background: color-mix(in srgb, #16a34a 12%, transparent);
}

.autobuild-triggers { display: flex; flex-direction: column; gap: 6px; }
.autobuild-trigger {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.autobuild-trigger:hover:not(.soon) { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle)); }
.autobuild-trigger.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
  box-shadow: inset 0 0 0 1px var(--accent);
}
.autobuild-trigger.soon { opacity: 0.5; cursor: not-allowed; }
.autobuild-trigger-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.autobuild-trigger-sub { font-size: 11.5px; color: var(--text-muted); }

.autobuild-anybooking {
  padding: 10px 12px;
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-soft);
  background: var(--surface-muted);
}
.autobuild-conds { display: flex; flex-direction: column; gap: 6px; }
.autobuild-cond-wrap { display: flex; flex-direction: column; gap: 6px; }
.autobuild-combinator {
  align-self: flex-start;
  padding: 2px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
}
.autobuild-cond {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.autobuild-select,
.autobuild-text,
.autobuild-num {
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
}
.autobuild-select { cursor: pointer; }
.autobuild-select.sm { max-width: 128px; }
.autobuild-text { flex: 1; min-width: 90px; }
.autobuild-num { width: 66px; }
.autobuild-op-fixed { font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
.autobuild-between { display: inline-flex; align-items: center; gap: 6px; }
.autobuild-and { font-size: 11px; color: var(--text-muted); }
.autobuild-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.autobuild-chip {
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s ease, color 0.1s ease, border-color 0.1s ease;
}
.autobuild-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast, #fff);
  font-weight: 600;
}
.autobuild-auto-relation {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, #16a34a 32%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, #16a34a 7%, var(--bg-elevated));
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}
.autobuild-auto-relation svg { color: #16a34a; flex: none; }
.autobuild-cond-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-soft);
  cursor: pointer;
  flex: none;
}
.autobuild-cond-x:hover {
  background: color-mix(in srgb, #dc2626 12%, transparent);
  border-color: color-mix(in srgb, #dc2626 40%, transparent);
  color: #dc2626;
}
.autobuild-addcond {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.autobuild-addcond:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

.autobuild-step-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.autobuild-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: color-mix(in srgb, #16a34a 14%, var(--bg-elevated));
  color: #16a34a;
  font-size: 12px;
  font-weight: 800;
  flex: none;
}
.autobuild-step-heading > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.autobuild-step-heading strong {
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 700;
}
.autobuild-step-heading small {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 500;
}
.autobuild-step {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 45%, var(--bg-elevated));
}
.autobuild-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.autobuild-step-actions {
  display: inline-flex;
  gap: 4px;
  flex: none;
}
.autobuild-step-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  cursor: pointer;
}
.autobuild-step-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.autobuild-step-actions button:last-child:hover { border-color: #dc2626; color: #dc2626; }
.autobuild-step-actions button:disabled { opacity: 0.35; cursor: default; }
.autobuild-step-type {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}
.autobuild-addstep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px dashed color-mix(in srgb, #16a34a 55%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, #16a34a 5%, transparent);
  color: #16a34a;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.autobuild-addstep:hover { background: color-mix(in srgb, #16a34a 10%, transparent); }

.autobuild-channels { display: flex; flex-wrap: wrap; gap: 6px; }
.autobuild-channel {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.autobuild-channel.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  color: var(--accent);
  font-weight: 600;
}
.autobuild-channel.soon { opacity: 0.55; cursor: not-allowed; }
.autobuild-channel-soon {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
}
.autobuild-msg {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
  min-height: 84px;
}
.autobuild-msg:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.autobuild-msg::placeholder { color: var(--text-muted); }
/* Variable field + "/" menu — the Slack-style token picker. A field wraps the
   input/textarea and a {} button; the menu itself is portaled to <body>. */
.varfield { position: relative; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.varfield-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.varfield-btn svg { color: var(--accent); }
.varfield-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.varmenu-anchor { position: fixed; z-index: 14150; max-width: calc(100vw - 16px); }
.varmenu-anchor.is-above { transform: translateY(-100%); }
.varmenu-anchor .varmenu { max-height: inherit; }
.varmenu {
  max-height: 300px;
  min-width: 260px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--bg-elevated);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}
.varmenu-group + .varmenu-group { margin-top: 4px; }
.varmenu-grouplabel {
  padding: 6px 10px 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.varmenu-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.varmenu-item.is-active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.varmenu-item-label { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.varmenu-item-token {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 11px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  padding: 1px 5px;
  border-radius: 5px;
}
.varmenu-item-hint { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 560px) {
  .varmenu-item-hint { display: none; }
  .varmenu { min-width: 200px; }
}

/* Email composer — one canonical HTML body edited two ways (Visual WYSIWYG / raw HTML) */
.autobuild-email { display: flex; flex-direction: column; gap: 9px; }
.autobuild-email-modes {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-muted);
}
.autobuild-email-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.autobuild-email-mode.on {
  background: var(--bg-elevated);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.autobuild-wysiwyg {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.autobuild-wysiwyg:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.autobuild-wysiwyg-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-muted);
}
.autobuild-fmtbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}
.autobuild-fmtbtn:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text-primary);
}
.autobuild-fmtbtn.on {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.autobuild-wysiwyg-body .ProseMirror {
  min-height: 96px;
  padding: 11px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  outline: none;
}
.autobuild-wysiwyg-body .ProseMirror p { margin: 0 0 8px; }
.autobuild-wysiwyg-body .ProseMirror p:last-child { margin-bottom: 0; }
.autobuild-wysiwyg-body .ProseMirror ul,
.autobuild-wysiwyg-body .ProseMirror ol { margin: 0 0 8px; padding-left: 20px; }
.autobuild-wysiwyg-body .ProseMirror a { color: var(--accent); text-decoration: underline; }
.autobuild-wysiwyg-body .ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  height: 0;
  pointer-events: none;
  color: var(--text-muted);
}

.autobuild-htmlsrc {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  min-height: 120px;
}
.autobuild-htmlsrc:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.autobuild-htmlsrc::placeholder { color: var(--text-muted); }

.autobuild-email-preview { display: flex; flex-direction: column; gap: 5px; }
.autobuild-email-preview-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.autobuild-email-preview .inbox-email-frame {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
}
.autobuild-email-preview-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Which workspace letterhead the email goes out in, + the finished-email
   preview tab. Theme tokens only — both render in light and dark (CLAUDE.md §5).
   The email frame itself stays white in both, because that is what the
   recipient's mail client shows. */
.autobuild-emailtpl { display: flex; flex-direction: column; gap: 5px; }
.autobuild-emailtpl-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.autobuild-email-final { display: flex; flex-direction: column; gap: 8px; }
.autobuild-email-final-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.autobuild-email-final-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.autobuild-email-final-meta { font-size: 12px; color: var(--text-muted); }
.autobuild-email-final-subject {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-2, var(--surface));
  font-size: 13px;
  color: var(--text);
}
.autobuild-email-final-subject span {
  flex: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.autobuild-email-final-subject strong { font-weight: 600; min-width: 0; word-break: break-word; }
.autobuild-email-final-warning {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--warning, #d97706) 40%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--warning, #d97706) 12%, transparent);
  font-size: 12px;
  color: var(--text);
}
.autobuild-email-final .inbox-email-frame {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: #fff;
}

/* Channel option: the email-fallback sub-section under the plain chat message */
.autobuild-fallback {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 2px;
  padding: 12px;
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 50%, transparent);
}
.autobuild-fallback-head {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.autobuild-fallback-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft);
}

.autobuild-test { display: flex; flex-direction: column; gap: 8px; }
.autobuild-testbtn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.autobuild-testbtn:hover { border-color: var(--accent); color: var(--accent); }
.autobuild-testbtn:disabled { opacity: 0.6; cursor: default; }
/* Run-now's two-tap confirm state — reads as "this one sends for real". */
.autobuild-testbtn.danger,
.autobuild-testbtn.danger:hover { border-color: #dc2626; color: #dc2626; }
.autobuild-preview {
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-elevated);
}
.autobuild-preview.ok { border-color: color-mix(in srgb, #16a34a 45%, var(--border-subtle)); background: color-mix(in srgb, #16a34a 6%, var(--bg-elevated)); }
.autobuild-preview.no { border-color: color-mix(in srgb, #f59e0b 45%, var(--border-subtle)); background: color-mix(in srgb, #f59e0b 6%, var(--bg-elevated)); }
.autobuild-preview-verdict {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.autobuild-preview.ok .autobuild-preview-verdict svg { color: #16a34a; }
.autobuild-preview-meta { font-size: 11px; color: var(--text-muted); }
.autobuild-preview-msg {
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--surface-muted);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-soft);
  white-space: pre-wrap;
}
.autobuild-preview-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.autobuild-preview-fields > span {
  display: inline-flex;
  gap: 5px;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 11px;
}
.autobuild-preview-fields strong { color: var(--text-primary); font-weight: 700; }
.autobuild-preview-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.autobuild-preview-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-muted);
}
.autobuild-preview-step.skipped { border-color: color-mix(in srgb, #f59e0b 38%, var(--border-subtle)); }
.autobuild-preview-step-main {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.4;
}
.autobuild-preview-step-main strong { color: var(--text-primary); font-size: 12px; }
.autobuild-preview-step-main small { color: var(--text-muted); font-size: 10.5px; }
.autobuild-preview-step-main em {
  margin-top: 3px;
  padding: 6px 7px;
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-style: normal;
  white-space: pre-wrap;
}

.autobuild-error {
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  background: color-mix(in srgb, #dc2626 12%, transparent);
  color: #dc2626;
}
.autobuild-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.autobuild-active { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.autobuild-active input { position: absolute; opacity: 0; width: 0; height: 0; }
.autobuild-active-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  flex: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.autobuild-active-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.autobuild-active.on .autobuild-active-track { background: #16a34a; border-color: #16a34a; }
.autobuild-active.on .autobuild-active-thumb { transform: translateX(16px); }
.autobuild-active-label { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.autobuild-active.on .autobuild-active-label { color: #16a34a; }
.autobuild-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  flex: none;
}
.autobuild-delete:hover { border-color: color-mix(in srgb, #dc2626 40%, var(--border-subtle)); color: #dc2626; }
.autobuild-delete:disabled { opacity: 0.6; }

.automations .spin,
.autobuild .spin { animation: aut-spin 0.8s linear infinite; }
@keyframes aut-spin { to { transform: rotate(360deg); } }

/* Icons never shrink — keeps every glyph at its intrinsic size in a slim pane. */
.autobuild svg { flex: none; }

/* v2 — When taxonomy tiles, trigger pills, channel panels, Test picker */
.autobuild-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.autobuild-cat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: left;
}
.autobuild-cat svg { color: var(--text-muted); }
.autobuild-cat:hover:not(.soon):not(.on) { border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle)); }
.autobuild-cat.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated)); }
.autobuild-cat.on svg, .autobuild-cat.on .autobuild-cat-label { color: var(--accent); }
.autobuild-cat.soon { opacity: 0.7; cursor: not-allowed; }
.autobuild-cat-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.autobuild-cat-sub { font-size: 11px; color: var(--text-muted); line-height: 1.3; }
.autobuild-soon {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 5px; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted);
}
.autobuild-cat .autobuild-soon { position: absolute; top: 8px; right: 8px; }

.autobuild-trigpills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.autobuild-trigpill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--border-subtle); border-radius: 999px;
  background: var(--surface-muted); color: var(--text-soft);
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.autobuild-trigpill.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font-weight: 600; }
.autobuild-trigpill.soon { opacity: 0.6; cursor: not-allowed; }

.autobuild-select.grow, .autobuild-text.grow { flex: 1; min-width: 0; width: 100%; box-sizing: border-box; }

.autobuild-panel {
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated);
}
.autobuild-fieldlabel { font-size: 11.5px; font-weight: 600; color: var(--text-soft); }
.autobuild-notemplate { display: flex; flex-direction: column; gap: 8px; }
.autobuild-notemplate p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.autobuild-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; }
.autobuild-link:hover { text-decoration: underline; }
.autobuild-templatebody {
  padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 9px;
  background: var(--surface-muted); font-size: 12.5px; line-height: 1.5; color: var(--text-primary); white-space: pre-wrap;
}
.autobuild-varmap { display: flex; flex-direction: column; gap: 7px; }
.autobuild-varmap-row { display: flex; align-items: center; gap: 8px; }
.autobuild-varmap-pos { font-family: ui-monospace, "SF Mono", monospace; font-size: 11.5px; font-weight: 600; color: var(--accent); min-width: 34px; flex: none; }

.autobuild-testrow { display: flex; align-items: center; gap: 8px; }
.autobuild-preview-subject { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }

/* v3 — schedule controls, portal-event row, Channel panel hint, contact test note */
.autobuild-schedule {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.autobuild-inlinerow {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.autobuild-channelhint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
}
.autobuild-testnote {
  flex: 1;
  font-size: 12px;
  color: var(--text-soft);
}

/* Webhook trigger setup — source, URL, live sample and fields stay inside the
   rule builder on both desktop and the shared phone sheet. */
.autobuild-webhook-setup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.autobuild-webhook-head,
.autobuild-webhook-listen,
.autobuild-webhook-create,
.autobuild-webhook-url {
  display: flex;
  align-items: center;
  gap: 9px;
}
.autobuild-webhook-head,
.autobuild-webhook-listen { justify-content: space-between; }
.autobuild-webhook-head > div,
.autobuild-webhook-listen > div { min-width: 0; }
.autobuild-webhook-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
}
.autobuild-webhook-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}
.autobuild-webhook-copy:hover { border-color: var(--accent); color: var(--accent); }
.autobuild-webhook-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.autobuild-webhook-manage {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}
.autobuild-webhook-manage:hover { color: var(--accent); }
.autobuild-webhook-control-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.autobuild-webhook-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.autobuild-webhook-control-row > div:first-child {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.autobuild-webhook-control-row strong {
  color: var(--text-primary);
  font-size: 11.5px;
}
.autobuild-webhook-control-row span {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.4;
}
.autobuild-webhook-control-action,
.autobuild-webhook-danger,
.autobuild-webhook-confirm > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.autobuild-webhook-control-action {
  flex: 1.35;
  min-width: 0;
}
.autobuild-webhook-danger {
  justify-content: flex-end;
  padding-top: 9px;
  border-top: 1px solid var(--border-subtle);
}
.autobuild-dangerbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, #ef4444 48%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, #ef4444 7%, var(--bg-elevated));
  color: #ef4444;
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}
.autobuild-dangerbtn:hover { background: color-mix(in srgb, #ef4444 13%, var(--bg-elevated)); }
.autobuild-dangerbtn:disabled { cursor: not-allowed; opacity: 0.55; }
.autobuild-webhook-confirm {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}
.autobuild-webhook-confirm p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.45;
}
.autobuild-webhook-disabled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, #f59e0b 38%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, #f59e0b 7%, var(--bg-elevated));
  color: var(--text-soft);
  font-size: 11.5px;
}
.autobuild-webhook-capture {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, #16a34a 35%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, #16a34a 6%, var(--bg-elevated));
}
.autobuild-webhook-captured {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #16a34a;
  font-size: 11.5px;
  font-weight: 700;
}
.autobuild-webhook-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.autobuild-webhook-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--surface-muted);
}
.autobuild-webhook-field span,
.autobuild-webhook-field strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.autobuild-webhook-field span { color: var(--text-muted); font-size: 10.5px; }
.autobuild-webhook-field strong { color: var(--text-primary); font-size: 11.5px; font-weight: 600; }
@media (max-width: 560px) {
  .autobuild-webhook-head,
  .autobuild-webhook-listen,
  .autobuild-webhook-disabled,
  .autobuild-webhook-create,
  .autobuild-webhook-url,
  .autobuild-webhook-control-row,
  .autobuild-webhook-control-action,
  .autobuild-webhook-danger {
    align-items: stretch;
    flex-direction: column;
  }
  .autobuild-webhook-head .autobuild-addcond,
  .autobuild-webhook-listen .autobuild-testbtn,
  .autobuild-webhook-disabled .autobuild-testbtn,
  .autobuild-webhook-create .autobuild-testbtn,
  .autobuild-webhook-copy { align-self: stretch; justify-content: center; }
  .autobuild-webhook-manage { align-self: stretch; justify-content: center; }
  .autobuild-webhook-control-row > .autobuild-testbtn,
  .autobuild-webhook-control-action .autobuild-testbtn,
  .autobuild-webhook-danger > .autobuild-testbtn,
  .autobuild-webhook-danger > .autobuild-dangerbtn,
  .autobuild-webhook-confirm > div > button { width: 100%; }
  .autobuild-webhook-confirm > div { align-items: stretch; flex-direction: column; }
  .autobuild-webhook-fields { grid-template-columns: minmax(0, 1fr); }
}

/* v4 — grouped field picker, recipient, event delay, match-mode, Yes/No, searchable multi-select */
.autobuild-delayrow {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated);
}
.autobuild-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-soft); cursor: pointer; }
.autobuild-check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.autobuild-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.autobuild-muted { font-size: 12px; color: var(--text-muted); }

.autobuild-matchmode { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.autobuild-seg { display: inline-flex; border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; }
.autobuild-seg button { padding: 4px 12px; border: none; background: var(--surface-muted); color: var(--text-soft); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.autobuild-seg button.on { background: var(--accent); color: var(--accent-contrast, #fff); }
.autobuild-connector { align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); padding: 0 4px; }

.autobuild-recipient { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.autobuild-recipient-opts { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.autobuild-recipient-opt {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--border-subtle); border-radius: 9px; background: var(--bg-elevated);
  color: var(--text-soft); font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.autobuild-recipient-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated)); color: var(--accent); font-weight: 600; }

.autobuild-fieldpicker { position: relative; min-width: 150px; }
.autobuild-fieldpicker-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--surface-muted);
  color: var(--text-primary); font-size: 12px; font-family: inherit; font-weight: 600; cursor: pointer;
}
.autobuild-fieldpicker-btn svg { color: var(--text-muted); flex: none; }
.autobuild-fieldmenu {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 264px; max-width: 78vw;
  border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22); overflow: hidden;
}
.autobuild-fieldmenu-search { width: 100%; box-sizing: border-box; padding: 9px 11px; border: none; border-bottom: 1px solid var(--border-subtle); background: transparent; color: var(--text-primary); font-size: 12.5px; font-family: inherit; }
.autobuild-fieldmenu-search:focus { outline: none; }
.autobuild-fieldmenu-list { max-height: 300px; overflow-y: auto; padding: 6px; }
.autobuild-fieldmenu-group { margin-bottom: 4px; }
.autobuild-fieldmenu-grouplabel { padding: 6px 8px 3px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.autobuild-fieldmenu-item {
  display: flex; flex-direction: column; gap: 1px; align-items: flex-start; width: 100%;
  padding: 7px 8px; border: none; border-radius: 7px; background: transparent; color: var(--text-primary);
  font-size: 12.5px; font-family: inherit; text-align: left; cursor: pointer;
}
.autobuild-fieldmenu-item:hover { background: var(--surface-muted); }
.autobuild-fieldmenu-item.on { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; }
.autobuild-fieldmenu-hint { font-size: 10.5px; color: var(--text-muted); line-height: 1.3; }

.autobuild-yesno { display: inline-flex; border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; }
.autobuild-yesno button { padding: 6px 14px; border: none; background: var(--surface-muted); color: var(--text-soft); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; }
.autobuild-yesno button.on { background: var(--accent); color: var(--accent-contrast, #fff); }

.autobuild-numwrap { display: inline-flex; align-items: center; gap: 4px; }
.autobuild-money { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.autobuild-value-none { font-size: 11.5px; color: var(--text-muted); font-style: italic; }

.autobuild-msearch { position: relative; min-width: 150px; }
.autobuild-msearch.grow { flex: 1; }
.autobuild-msearch-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; box-sizing: border-box;
  padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--surface-muted);
  color: var(--text-primary); font-size: 12px; font-family: inherit; cursor: pointer;
}
.autobuild-msearch-btn .muted { color: var(--text-muted); }
.autobuild-msearch-btn svg { color: var(--text-muted); flex: none; }
.autobuild-msearch-menu {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; width: 264px; max-width: 78vw;
  border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22); overflow: hidden;
}
.autobuild-msearch-input { width: 100%; box-sizing: border-box; padding: 9px 11px; border: none; border-bottom: 1px solid var(--border-subtle); background: transparent; color: var(--text-primary); font-size: 12.5px; font-family: inherit; }
.autobuild-msearch-input:focus { outline: none; }
.autobuild-msearch-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.autobuild-msearch-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; font-size: 12.5px; color: var(--text-primary); cursor: pointer; }
.autobuild-msearch-opt:hover { background: var(--surface-muted); }
.autobuild-msearch-opt input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; flex: none; }
.autobuild-msearch-empty { padding: 10px; font-size: 12px; color: var(--text-muted); text-align: center; }

.autobuild-preview-to { font-size: 12px; color: var(--text-soft); }
.autobuild-preview-to strong { color: var(--text-primary); font-weight: 600; }

/* Recipient — "Someone else" contact picker (v5) */
.autobuild-recipient-panel { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; margin-bottom: 2px; border-bottom: 1px dashed var(--border-subtle); }
.autobuild-contact-search { position: relative; }
.autobuild-contact-searchbar { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-muted); color: var(--text-muted); }
.autobuild-contact-searchbar:focus-within { border-color: var(--accent); }
.autobuild-contact-input { flex: 1; min-width: 0; border: none; background: transparent; color: var(--text-primary); font-size: 13px; font-family: inherit; }
.autobuild-contact-input:focus { outline: none; }
.autobuild-contact-menu { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22); overflow-y: auto; max-height: 260px; padding: 6px; }
.autobuild-contact-empty { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; font-size: 12px; color: var(--text-muted); }
.autobuild-contact-opt { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: none; border-radius: 8px; background: transparent; color: var(--text-primary); font-family: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.autobuild-contact-opt:hover { background: var(--surface-muted); }
.autobuild-contact-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.autobuild-contact-av { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.autobuild-contact-badge { flex: none; padding: 2px 7px; border: 1px solid var(--border-subtle); border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.autobuild-contact-chip { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--bg-elevated); }
.autobuild-contact-chip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; color: var(--text-primary); }
.autobuild-contact-chip-clear { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: none; border-radius: 7px; background: transparent; color: var(--text-muted); cursor: pointer; }
.autobuild-contact-chip-clear:hover { background: var(--surface-muted); color: var(--text-primary); }
.autobuild-reach { display: flex; flex-direction: column; gap: 6px; }
.autobuild-reach-seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; }
.autobuild-reach-seg button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border: none; background: var(--surface-muted); color: var(--text-soft); font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; }
.autobuild-reach-seg button + button { border-left: 1px solid var(--border-subtle); }
.autobuild-reach-seg button.on { background: var(--accent); color: var(--accent-contrast, #fff); }
.autobuild-reach-seg button.on svg { color: var(--accent-contrast, #fff); }
.autobuild-reach-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.autobuild-reach-note svg { flex: none; color: var(--text-muted); }
.autobuild-reach-warn { margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--danger, #dc2626); }
.autobuild-raw-toggle { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 3px 2px; border: none; background: transparent; color: var(--accent); font-size: 11.5px; font-weight: 600; font-family: inherit; cursor: pointer; }
.autobuild-raw-toggle:hover { text-decoration: underline; }
.autobuild-raw-toggle svg { flex: none; }

/* Email composer (v6) — Booking-Platform email fallback + standalone Email */
.autobuild-emailfallback { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--border-subtle); }
.autobuild-email { display: flex; flex-direction: column; gap: 8px; }
.autobuild-email-from, .autobuild-email-format { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-soft); }
.autobuild-email-from .autobuild-select, .autobuild-email-format .autobuild-select { flex: 1; min-width: 0; }
.autobuild-optional { color: var(--text-muted); font-weight: 400; font-size: 11px; }
.autobuild-email-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.autobuild-email-fmtbtns { display: inline-flex; gap: 4px; }
.autobuild-email-fmtbtns button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--surface-muted); color: var(--text-soft); cursor: pointer; }
.autobuild-email-fmtbtns button:hover { color: var(--text-primary); border-color: var(--accent); }
.autobuild-email-fmtbtns button svg { flex: none; }
.autobuild-email-preview { display: flex; flex-direction: column; gap: 5px; }
.autobuild-email-preview-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.autobuild-email-preview-empty { margin: 0; padding: 12px; font-size: 12px; color: var(--text-muted); border: 1px dashed var(--border-subtle); border-radius: 8px; }
.autobuild-email-preview .inbox-email-frame { width: 100%; max-height: 320px; border: 1px solid var(--border-subtle); border-radius: 8px; background: #fff; }

/* Test reservation picker (v6) — search any reservation to dry-run against */
.autobuild-testpick { position: relative; display: flex; align-items: center; min-width: 0; }
.autobuild-testpick.grow { flex: 1; }
.autobuild-testpick-icon { position: absolute; left: 10px; color: var(--text-muted); pointer-events: none; }
.autobuild-testpick-input { width: 100%; height: 32px; padding: 0 10px 0 32px; font-size: 12.5px; color: var(--text-primary); background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 8px; }
.autobuild-testpick-input:focus { outline: none; border-color: var(--accent); }
.autobuild-testpick-input::placeholder { color: var(--text-muted); }
/* Opens UPWARD — the Test row sits at the bottom of the pane. */
.autobuild-testpick-list { position: absolute; bottom: calc(100% + 4px); left: 0; right: 0; z-index: 30; max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; padding: 4px; background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14); }
.autobuild-testpick-row { display: block; width: 100%; padding: 7px 9px; font-size: 12.5px; text-align: left; color: var(--text-primary); background: none; border: none; border-radius: 7px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.autobuild-testpick-row:hover { background: var(--surface-muted); }
.autobuild-testpick-empty { display: flex; align-items: center; gap: 7px; padding: 10px; font-size: 12px; color: var(--text-muted); }
.autobuild-testpick-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; padding: 5px 6px 5px 11px; font-size: 12.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated)); border: 1px solid var(--accent); border-radius: 8px; }
.autobuild-testpick-chiplabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autobuild-testpick-chip button { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: inherit; background: none; border: none; border-radius: 6px; cursor: pointer; }
.autobuild-testpick-chip button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* Chat */
.aiops-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.aiops-scope {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 13px 8px;
  color: var(--text-muted);
  flex: none;
}
.aiops-scope-label {
  font-size: 12px;
  color: var(--text-soft);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aiops-scope-switch {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
  flex: none;
}
.aiops-scope-switch:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.aiops-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-padding-block: 8px 18px;
  -webkit-overflow-scrolling: touch;
  padding: 6px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aiops-brief {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 6px;
  /* Breathing room so the suggestion card + prompt chips don't crowd the composer below (Hakim 2026-06-27). */
  padding-bottom: 14px;
}
.aiops-brief-hi {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
/* Stavros greets an empty chat in person (fold: the sparkle icon era is over). */
.aiops-brief-face {
  display: flex;
  align-items: center;
  gap: 12px;
}
.aiops-brief-face .aiops-brief-hi {
  font-size: 15px;
}
/* ── Composer "/" commands + "@" references (ported from Stavros's original
   app): a compact pop anchored above the input; rows are tappable on the phone
   sheet and arrow-key navigable on desktop. ── */
.aiops-cmd-pop {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 6px);
  z-index: 30;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated, var(--bg-input));
  box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--text-primary) 26%, transparent);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.aiops-cmd-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 9px;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  cursor: pointer;
}
.aiops-cmd-row.is-active,
.aiops-cmd-row:hover {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.aiops-cmd-ic {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
}
.aiops-cmd-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.aiops-cmd-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aiops-cmd-hint {
  font-size: 11.5px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aiops-cmd-empty {
  padding: 10px 9px;
  font-size: 12.5px;
  color: var(--text-soft);
}
.aiops-brief-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-soft);
}
.aiops-brief-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aiops-brief-list li {
  font-size: 12.5px;
  color: var(--text-soft);
}
.aiops-brief-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.aiops-brief-list a:hover {
  text-decoration: underline;
}
/* #38 — the grounding "thread read" card in pane 5's empty state: the SAME insight the
   pane-3 strip shows, surfaced here so the operator sees the AI's read before typing, with
   a one-tap next-step → draft hand-off. Tone hues mirror the inbox sentiment chip. */
.aiops-brief-read {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--bg-elevated);
  animation: aiops-rise 0.3s ease backwards;
}
.aiops-brief-read-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.aiops-brief-read-head svg {
  color: var(--accent);
  flex: none;
}
.aiops-brief-mood {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11.5px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.aiops-brief-mood[data-tone="good"] { color: #16a34a; }
.aiops-brief-mood[data-tone="warm"] { color: #65a30d; }
.aiops-brief-mood[data-tone="neutral"] { color: #64748b; }
.aiops-brief-mood[data-tone="warn"] { color: #d97706; }
.aiops-brief-mood[data-tone="bad"] { color: #dc2626; }
.aiops-brief-read-summary {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
}
.aiops-brief-read-fairness {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft);
}
.aiops-brief-read-fairness-badge {
  font-weight: 600;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 14%, transparent);
  color: var(--text-soft);
}
.aiops-brief-read-fairness[data-fairness="justified"] .aiops-brief-read-fairness-badge {
  color: #dc2626;
  background: color-mix(in srgb, #dc2626 12%, transparent);
}
.aiops-brief-read-fairness[data-fairness="mixed"] .aiops-brief-read-fairness-badge {
  color: #d97706;
  background: color-mix(in srgb, #d97706 12%, transparent);
}
.aiops-brief-read-fairness[data-fairness="overstated"] .aiops-brief-read-fairness-badge {
  color: #64748b;
  background: color-mix(in srgb, #64748b 14%, transparent);
}
.aiops-brief-next {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--border-subtle);
}
.aiops-brief-next-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
}
.aiops-brief-next-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-primary);
}
.aiops-brief-next-why {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
}
.aiops-brief-next-btn {
  align-self: flex-start;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.aiops-brief-next-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elevated));
}
.aiops-brief-next-btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.aiops-brief-next-btn svg {
  flex: none;
}
.aiops-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}
.aiops-prompt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  animation: aiops-rise 0.3s ease backwards;
}
.aiops-prompt:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.aiops-prompt.primary {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  color: var(--accent);
}
.aiops-prompt.primary:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
}
.aiops-prompt svg {
  color: var(--accent);
  flex: none;
}
.aiops-prompts .aiops-prompt:nth-child(2) {
  animation-delay: 0.05s;
}
.aiops-prompts .aiops-prompt:nth-child(3) {
  animation-delay: 0.1s;
}
.aiops-prompts .aiops-prompt:nth-child(4) {
  animation-delay: 0.15s;
}
.aiops-draft {
  animation: aiops-rise 0.34s ease;
}
@keyframes aiops-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.aiops-prompts-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.aiops-turn {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.aiops-bubble {
  max-width: 92%;
  padding: 9px 12px;
  font-size: 15px;
  line-height: 1.55;
  border-radius: 13px;
}
/* A grounded answer is a card of the business's own numbers, not a chat aside, so
   it gets the full width of the pane. The inherited 92% cap left a dead gutter
   down the entire right-hand side on the phone — TestFlight #55, "a bunch of
   wasted space here on the right" — and, because .aiops-turn-tools anchors to the
   full-width turn, it also stranded the actions button out in that gutter,
   detached from the card it acts on (#56, "clunky and out of place"). One change
   fixes both. HIS OWN messages keep the 92% cap and stay right-aligned: that
   asymmetry is what makes the thing read as a conversation. */
.aiops-bubble.assistant {
  align-self: flex-start;
  max-width: 100%;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: 4px;
  color: var(--text-primary);
}
/* Room for the actions button in the answer card's own top-right corner (see
   .aiops-turn-tools below) so it can never sit on top of the verified chip. */
.aiops-bubble.assistant .ai-rich-response-head {
  padding-right: 40px;
}
.aiops-bubble.user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}
.aiops-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.aiops-bubble-retry {
  margin-top: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
  padding: 5px 9px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 650;
}
.aiops-bubble-retry:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
}
/* Draft-and-apply card */
.aiops-draft {
  align-self: stretch;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border-subtle));
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aiops-draft-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}
.aiops-draft-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
/* The exact words an approved card will send to someone outside the company.
   Set apart from the summary on purpose: this is the bit to actually read
   before clicking, so it must not look like more explanatory copy. Theme tokens
   only, so it holds up in light and dark alike. */
.aiops-draft-quote {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 8px 10px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 0 7px 7px 0;
  background: color-mix(in srgb, var(--text-primary) 5%, var(--bg-elevated));
}
/* Where it is going. Quieter than the message, but never hidden — the channel
   is the part that can surprise someone. */
.aiops-draft-meta {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  word-break: break-word;
}
.aiops-draft-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.aiops-draft-apply {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.aiops-draft-apply:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
}
.aiops-draft-tweak {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.aiops-draft-tweak:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.aiops-draft-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.aiops-draft-dismiss:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.aiops-draft-stale {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--state-danger) 10%, transparent);
  color: var(--state-danger);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.aiops-draft-stale svg {
  margin-top: 1px;
  flex: none;
}

/* Typing dots */
.aiops-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.aiops-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: aiops-dot 1s ease-in-out infinite;
}
.aiops-typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.aiops-typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes aiops-dot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* Memory-confirm (asks-first) */
.aiops-memconfirm {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 12px 8px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.aiops-memconfirm-head {
  display: flex;
  align-items: center;
  gap: 7px;
}
.aiops-memconfirm-ic {
  color: var(--accent);
  flex: none;
  display: inline-flex;
}
.aiops-memconfirm-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.aiops-memconfirm-text {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}
.aiops-memscope {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 1px;
}
.aiops-memscope-opt {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  transition:
    background 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}
.aiops-memscope-opt:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong));
}
.aiops-memscope-opt.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.aiops-memscope-hint {
  font-size: 11px;
  color: var(--text-muted);
}
.aiops-memconfirm-actions {
  display: inline-flex;
  gap: 5px;
  flex: none;
  align-self: flex-end;
}
.aiops-memconfirm-yes,
.aiops-memconfirm-no {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.aiops-memconfirm-yes {
  background: var(--accent);
  color: #fff;
  border: none;
}
.aiops-memconfirm-no {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-strong);
}
.aiops-memconfirm-no:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

/* Composer — premium container (2026-07-02 overhaul): one elevated box, borderless
   auto-growing textarea, action row (attach · think · send) beneath. */
.aiops-composebox {
  flex: none;
  position: relative; /* anchors the "/" command + "@" mention pops */
  display: flex;
  flex-direction: column;
  margin: 8px 10px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-input);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--text-primary) 6%, transparent);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.aiops-composebox:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  box-shadow:
    0 0 0 3px var(--ring),
    0 1px 2px color-mix(in srgb, var(--text-primary) 6%, transparent);
}
.aiops-composebox.dragging {
  border-color: var(--accent);
  border-style: dashed;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-input));
}
.aiops-compose-input {
  border: none;
  outline: none;
  background: transparent;
  resize: none;
  width: 100%;
  min-height: 40px;
  /* Auto-grows with content (JS sets height from scrollHeight) up to ~6 lines,
     then scrolls — §8 "input auto-grows / wraps like any normal text input". */
  max-height: 140px;
  overflow-y: auto;
  padding: 11px 12px 2px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.45;
}
.aiops-compose-input::placeholder {
  color: var(--text-muted);
}
.aiops-compose-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px 8px;
}
.aiops-compose-spacer {
  flex: 1;
}
.aiops-compose-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.aiops-compose-btn:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.aiops-compose-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.aiops-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent));
  color: var(--accent-contrast, #fff);
  cursor: pointer;
  flex: none;
  box-shadow:
    0 1px 3px color-mix(in srgb, var(--accent) 40%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent);
  transition: transform 0.1s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.aiops-send:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 3px 8px color-mix(in srgb, var(--accent) 35%, transparent),
    inset 0 1px 0 color-mix(in srgb, #fff 28%, transparent);
}
.aiops-send:active:not(:disabled) {
  transform: translateY(0);
}
.aiops-send:disabled {
  opacity: 0.4;
  cursor: default;
  box-shadow: none;
}

/* Staged attachments (composer) + sent-message attachment chips */
.aiops-attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 0;
}
.aiops-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 12px;
}
.aiops-attach-chip img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.aiops-attach-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aiops-attach-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.aiops-attach-remove:hover {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  color: var(--text-primary);
}
.aiops-attach-uploading {
  font-size: 12px;
  color: var(--text-muted);
}
.aiops-attach-err {
  font-size: 12px;
  color: #dc2626;
}
[data-theme="dark"] .aiops-attach-err {
  color: #f87171;
}
.aiops-msg-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.aiops-msg-att {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
  border-radius: 9px;
  font-size: 12px;
  opacity: 0.95;
}
.aiops-msg-att img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.aiops-msg-att-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Source-backed operational context. Shared by Stavros and the phone thread so
   the verdict, wording and references cannot drift between surfaces. */
.ops-evidence {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 34%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--state-warning) 7%, var(--bg-elevated));
  color: var(--text-primary);
}
.ops-evidence[data-verdict="available"] {
  border-color: color-mix(in srgb, var(--state-success) 34%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-success) 7%, var(--bg-elevated));
}
.ops-evidence-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ops-evidence-icon {
  width: 29px;
  height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 15%, transparent);
  flex: none;
}
.ops-evidence[data-verdict="available"] .ops-evidence-icon {
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 15%, transparent);
}
.ops-evidence-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.ops-evidence-title strong {
  font-size: 12.5px;
  font-weight: 700;
}
.ops-evidence-title small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10.5px;
}
.ops-evidence-verdict {
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-warning) 15%, transparent);
  color: var(--state-warning);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.ops-evidence[data-verdict="available"] .ops-evidence-verdict {
  background: color-mix(in srgb, var(--state-success) 15%, transparent);
  color: var(--state-success);
}
.ops-evidence-summary {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-soft);
}
.ops-evidence-sources {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ops-evidence-sources-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
}
.ops-evidence-source {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--text-primary) 3%, var(--bg-elevated));
  color: var(--text-primary);
  text-decoration: none;
}
.ops-evidence-source:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}
.ops-evidence-source:focus-visible,
.ph-convo-staylink:focus-visible,
.ph-stavros-context-open:focus-visible,
.ph-stavros-context-dismiss:focus-visible,
.ph-stavros-context-draft:focus-visible {
  outline: 2px solid var(--focus-ring, var(--accent));
  outline-offset: 2px;
}
.ops-evidence-source > span {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}
.ops-evidence-source strong {
  overflow: hidden;
  color: inherit;
  font-size: 11.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-evidence-source small {
  margin-top: 1px;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ops-evidence-source > svg {
  color: var(--text-muted);
  flex: none;
}
.ops-evidence.is-compact {
  padding: 10px;
}
/* Live variant inside the thinking bubble: same muted look (theme tokens →
   light/dark for free), on its own line under the typing dots, fading in as
   each tool label lands. */
.aiops-live-activity {
  display: flex;
  margin-top: 8px;
  animation: aiopsActivityIn 220ms ease-out;
}
@keyframes aiopsActivityIn {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Markdown inside assistant bubbles */
.aiops-md {
  font-size: 15px;
  line-height: 1.55;
}
.aiops-md p {
  margin: 0 0 8px;
  white-space: pre-wrap;
}
.aiops-md p:last-child,
.aiops-md ul:last-child,
.aiops-md ol:last-child,
.aiops-md blockquote:last-child,
.aiops-md pre:last-child {
  margin-bottom: 0;
}
.aiops-md .aiops-md-head {
  font-weight: 700;
  margin: 2px 0 6px;
}
.aiops-md ul,
.aiops-md ol {
  margin: 0 0 8px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.aiops-md li {
  margin: 0;
}
.aiops-md strong {
  font-weight: 650;
  color: var(--text-primary);
}
.aiops-md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
  border-radius: 5px;
  padding: 1px 5px;
}
.aiops-md pre {
  margin: 0 0 8px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow-x: auto;
}
.aiops-md pre code {
  background: none;
  padding: 0;
  font-size: 12px;
}
.aiops-md a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.aiops-md blockquote {
  margin: 0 0 8px;
  padding: 9px 11px;
  border-left: 3px solid var(--accent);
  border-radius: 0 9px 9px 0;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-muted));
  white-space: pre-wrap;
}
/* History overlay */
.aiops-history {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px 10px 12px;
}
.aiops-newchat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px;
  margin-bottom: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
}
.aiops-newchat svg {
  color: var(--accent);
}
.aiops-newchat:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}
.aiops-history-empty {
  padding: 24px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.aiops-history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aiops-hrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
}
.aiops-hrow:hover {
  background: var(--surface-muted);
}
.aiops-htile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  flex: none;
}
.aiops-hmain {
  flex: 1;
  min-width: 0;
}
.aiops-htitle {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aiops-hsub {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aiops-hdel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: none;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.aiops-hrow:hover .aiops-hdel {
  opacity: 1;
}
.aiops-hdel:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

/* Approvals feed */
.aiops-loading {
  padding: 22px 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}
.aiops-empty {
  padding: 28px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.aiops-empty-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--state-success) 14%, transparent);
  color: var(--state-success);
}
.aiops-empty-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.aiops-empty-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 240px;
}
.aiops-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.aiops-card {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aiops-card.kind-awaiting_reply {
  border-left-color: var(--accent);
}
.aiops-card.kind-overdue_task {
  border-left-color: var(--state-warning);
}
.aiops-card.kind-underpriced {
  border-left-color: var(--state-warning);
}
.aiops-card.kind-demand_spike {
  border-left-color: var(--state-success);
}
/* Lost inventory reads as a loss; an unsold gap is an opportunity, not an alarm —
   so it borrows the calm accent rather than a warning colour. Both are theme
   tokens with light overrides, so light/dark parity comes free. */
.aiops-card.kind-cancelled_stay {
  border-left-color: var(--state-error);
}
.aiops-card.kind-orphan_gap {
  border-left-color: var(--accent);
}
.aiops-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.aiops-card-icon {
  display: inline-flex;
  color: var(--text-muted);
}
.aiops-card-kind {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
}
.aiops-card-time {
  font-size: 11px;
  color: var(--text-muted);
}
/* Severity tone overrides the kind colour of the card's left accent, so AI-triaged
   pressing items (which also sort to the top) read at a glance. Placed AFTER the kind-*
   rules so equal-specificity source order lets tone win. */
.aiops-card.tone-warn {
  border-left-color: var(--state-warning);
}
.aiops-card.tone-bad {
  border-left-color: var(--state-danger);
}
/* Triage badges — small context chips under the head (sentiment / "Raised an issue" /
   waiting time). `.sev` (severity / time-pressure) ones get a tinted treatment. */
.aiops-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.aiops-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  background: var(--surface-muted);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.aiops-badge.sev {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 14%, transparent);
}
.aiops-card.tone-bad .aiops-badge.sev {
  color: var(--state-danger);
  background: color-mix(in srgb, var(--state-danger) 15%, transparent);
}
.aiops-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.aiops-card-avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.aiops-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.aiops-card-headtext {
  min-width: 0;
  flex: 1;
}
.aiops-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aiops-card-sub {
  margin: 1px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aiops-card-detail {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.aiops-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.aiops-card-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.aiops-card-act:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
}
.aiops-card-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.aiops-card-ghost:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Memory overlay */
.aiops-memory {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.aiops-memory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex: none;
}
.aiops-memory-head h3 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.aiops-memory-head h3 svg {
  color: var(--accent);
}
/* 🔴 padding:0 and flex:0 0 auto are LOAD-BEARING, not tidying. The global
   `button` rule sets padding: 0.58rem 0.7rem, which left this box 5.6px of
   content width — so the 20px X was flex-squeezed to about a sixth of its size
   and read as a speck. That is what "icons are way too tiny" was about
   (TestFlight #52). A later rule now makes the box 44px, which hides the squeeze
   behind 1.6px of slack; killing the padding is what actually makes the glyph
   its stated size. Same trap, twice before: the pane-4 reply box (#539) and the
   waterfall remove button (#684). Verify the svg's rendered rect, never the size
   prop. */
.aiops-memory-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.aiops-memory-done > svg {
  flex: 0 0 auto;
}
.aiops-memory-done:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.aiops-mem-list {
  list-style: none;
  margin: 0;
  padding: 8px 10px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aiops-mem-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
}
.aiops-mem-item.pinned {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.aiops-mem-scope {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
}
.aiops-mem-scope.org {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.aiops-mem-scope.user {
  background: var(--surface-muted);
  color: var(--text-soft);
}
.aiops-mem-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-primary);
}
.aiops-mem-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: none;
}
.aiops-mem-icon:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

/* Respect reduced-motion. */
/* Context wheel + compaction + per-message rewind/branch (Hakim, 2026-06-17) */
.aiops-wheel-wrap {
  position: relative;
  margin-left: auto;
  display: inline-flex;
}
.aiops-wheel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}
.aiops-wheel:hover {
  background: var(--surface-muted);
}
.aiops-wheel-track {
  /* --border-strong is rgba(255,255,255,.14): at 15px across that reads as a
     smudge, not a gauge. The track has to be visible for the fill arc to mean
     anything. TestFlight feedback, build 5: "Context wheel is too small". */
  stroke: var(--text-muted);
  opacity: 0.45;
}
.aiops-wheel-fill {
  stroke: var(--accent);
  transition: stroke-dasharray 0.4s ease;
}
/* Touch: the wheel is the only way into "what does he still remember?", and at
   28px next to a text label it read as a stray dot. Give it a real target and a
   ring big enough to read the fill on. */
@media (hover: none) {
  .aiops-wheel {
    width: 40px;
    height: 40px;
  }
  .aiops-wheel svg {
    width: 26px;
    height: 26px;
  }
}
.aiops-wheel-pop {
  position: absolute;
  top: 34px;
  right: 0;
  z-index: 20;
  width: 230px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--bg-elevated);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Must come AFTER the base rule: a media query adds no specificity, so the
   later declaration wins regardless of the query. */
@media (hover: none) {
  .aiops-wheel-pop {
    top: 46px;
  }
}
.aiops-wheel-pop-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-soft);
}
.aiops-wheel-pop-row strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.aiops-wheel-pop-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-muted);
}
.aiops-wheel-compact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease;
}
.aiops-wheel-compact:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-elevated));
}
.aiops-wheel-compact:disabled {
  opacity: 0.55;
  cursor: default;
}
.aiops-summary-pill {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 11px;
}
.aiops-summary-pill svg {
  flex: none;
  color: var(--accent);
}
.aiops-turn {
  position: relative;
}
.aiops-turn-tools {
  position: absolute;
  top: -2px;
  right: 0;
  z-index: 5;
  opacity: 0;
  /* Part of the tap-to-reveal contract, not an optimisation: hidden controls
     must not be tappable, so the FIRST tap reveals and the second acts. Without
     this the invisible button swallows a tap on the message underneath. */
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.aiops-turn:hover .aiops-turn-tools,
.aiops-turn-tools:focus-within {
  opacity: 1;
  pointer-events: auto;
}
/* 🔴 An OPEN menu is never hidden, whatever hover and focus are doing. Without
   this, tapping away dropped focus, the reveal rule stopped matching, and the
   still-open menu went invisible AND untappable while its state said open — so it
   looked dismissed and then reappeared when you touched that message again.
   TestFlight #56, "there is no clear way to dismiss this menu". ONE :has(), never
   nested inside another one (a nested :has() silently kills the whole rule —
   see the warning at .inbox-voice-card). */
.aiops-turn-tools:has(.aiops-turn-pop) {
  opacity: 1;
  pointer-events: auto;
  /* 🔴 And it must out-rank the dismiss backdrop. .aiops-turn-tools carries
     z-index: 5, which makes it a STACKING CONTEXT — so .aiops-turn-pop's own
     z-index: 21 is resolved INSIDE it and counts for nothing against a sibling of
     .aiops-chat. Left at 5 the backdrop (20) painted over the open menu and ate
     every tap on it: the menu closed instead of doing what you pressed. Raising
     the context itself is what actually lifts the menu. Proven with
     elementFromPoint over a menu row, which is the only check that catches this. */
  z-index: 21;
}
/* An answer fills the pane (see .aiops-bubble.assistant), so the turn's right
   edge IS the card's right edge — put the button on the card's own top-right
   corner. It used to float above the card in the 12px inter-turn gap, where a
   34px control cannot fit without lying on the message above it. His own
   messages are short and fit their content, so theirs stays above the bubble:
   padding one out to clear a button would re-create the wasted space #55 was
   about. */
.aiops-turn:has(> .aiops-bubble.assistant) .aiops-turn-tools {
  top: 6px;
  right: 6px;
}
.aiops-turn-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
}
/* Touch: 24px is a mouse target. WebKit's sticky :hover fires the reveal rule
   above on the first tap, so the control is reachable — it just has to be big
   enough to hit once it is there. Always-visible ghosts are banned (rejected
   twice); this is the settled pattern. TestFlight feedback, build 5:
   "Button too small for rewind and branch". */
@media (hover: none) {
  .aiops-turn-menu {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
}
.aiops-turn-menu:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
/* Tap anywhere else to close — the repo's settled popover dismiss, copied from
   .property-calendar-cell-menu-backdrop. Full viewport and transparent, so any
   press outside the menu lands here first; the menu's own z-index (21) is higher,
   so its rows never reach it. Lives OUTSIDE .aiops-turn-tools on purpose: inside,
   the reveal rule's pointer-events:none would make the backdrop dead. */
.aiops-turn-pop-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: transparent;
  cursor: default;
}
.aiops-turn-pop {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 21;
  min-width: 168px;
  padding: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.aiops-turn-pop button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
/* After the base rule, same reason as the wheel popover above. 12.5px text in a
   7px-padded row is a ~28px target; a menu you had to reveal first should not
   then be hard to hit. */
@media (hover: none) {
  .aiops-turn-pop button {
    min-height: 44px;
    font-size: 14px;
    padding: 10px 12px;
  }
}
.aiops-turn-pop button:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.aiops-turn-pop svg {
  flex: none;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .aiops-pulse.on {
    animation: none;
    background: color-mix(in srgb, var(--accent) 40%, transparent);
  }
  .aiops-typing i {
    animation: none;
    opacity: 0.6;
  }
  .aiops-prompt,
  .aiops-draft {
    animation: none;
  }
}

/* ── Comms settings (Settings → Comms) ─────────────────────────────────────── */
.comms-page {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.comms-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.comms-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
}
.comms-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.comms-number {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.comms-row-sub {
  font-size: 0.74rem;
}
.comms-caps {
  display: inline-flex;
  gap: 0.3rem;
  flex: 0 0 auto;
}
.comms-cap {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.12rem 0.36rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
  color: var(--accent);
}
.comms-subblock {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border-subtle);
}
/* "Which number does this go out from" — the whole row is the target, so picking a
   default is one comfortable click rather than a hunt for the radio. */
.comms-default-pick {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
}
.comms-default-pick input[type="radio"] {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  cursor: pointer;
}
.comms-subhead {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.comms-telnyx-block {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.comms-telnyx-copy {
  font-size: 0.8rem;
  margin: 0;
  max-width: 68rem;
}
.comms-telnyx-action,
.comms-telnyx-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
}
.comms-telnyx-rcs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}
.comms-telnyx-rcs-grid .properties-input-text {
  width: 100%;
}
.comms-telnyx-warning {
  color: var(--state-warning);
  font-size: 0.76rem;
  margin: 0;
}
.comms-telnyx-notice {
  color: var(--state-success);
  font-size: 0.8rem;
  margin: 0;
}
.comms-cap.is-on {
  background: color-mix(in srgb, var(--state-success) 14%, var(--bg-elevated));
  color: var(--state-success);
}
.comms-cap.is-off {
  background: var(--bg-input);
  color: var(--text-muted);
}
@container settings-main (max-width: 640px) {
  .comms-telnyx-action {
    align-items: flex-end;
    flex-direction: column;
  }
}
.comms-buy-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  align-items: center;
}
.comms-buy-row .properties-input-text {
  max-width: 190px;
}
.comms-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.6rem;
}
textarea.comms-textarea {
  min-height: 76px;
  height: auto;
  resize: vertical;
  line-height: 1.45;
  font-family: inherit;
}
.comms-notice {
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  font-size: 0.8rem;
  background: color-mix(in srgb, var(--state-success) 14%, var(--bg-elevated));
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--state-success) 35%, transparent);
}
.comms-tpl {
  list-style: none;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.comms-tpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.comms-tpl-name {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-primary);
}
.comms-tpl-body {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.comms-tpl-meta {
  display: flex;
  gap: 0.6rem;
  font-size: 0.72rem;
  text-transform: capitalize;
}
/* Which of our WhatsApp senders offers this template. A pressed chip = offered.
   Deliberately toggle buttons rather than checkboxes: the row is already dense, and
   the on/off state has to read at a glance across ten templates. Tokens only, so both
   themes track (globals rule: light + dark parity). */
.comms-tpl-senders {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.72rem;
}
.comms-tpl-senders > .muted {
  margin-right: 0.15rem;
}
.comms-tpl-sender {
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.comms-tpl-sender:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.comms-tpl-sender.is-on {
  background: color-mix(in srgb, var(--state-success) 18%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-success) 45%, transparent);
  color: var(--state-success);
}
.comms-tpl-sender:disabled {
  cursor: default;
  opacity: 0.6;
}
.comms-status {
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  flex: 0 0 auto;
}
.comms-status--ok {
  background: color-mix(in srgb, var(--state-success) 18%, var(--bg-elevated));
  color: var(--state-success);
}
.comms-status--pending {
  background: color-mix(in srgb, var(--state-warning) 18%, var(--bg-elevated));
  color: var(--state-warning);
}
.comms-status--bad {
  background: color-mix(in srgb, var(--state-error) 18%, var(--bg-elevated));
  color: var(--state-error);
}
.comms-status--muted {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}
/* ---------------------------------------------------------------------------
   Voice line control panel (item 10 V2) — Settings → Comms → Voice. Token-based
   (light/dark parity), small-screen first-class (min-width:0; stacks <768px).
   Scoped to .vp-* so it never collides with the messaging .comms-* rules.
--------------------------------------------------------------------------- */
.btn-xs { font-size: 0.7rem; padding: 0.18rem 0.5rem; min-height: 24px; }

/* Ring groups (teams) */
.vp-teams {
  margin: 0.2rem 0 0.9rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
}
.vp-teams-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  width: 100%; padding: 0.6rem 0.8rem; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-primary);
}
.vp-teams-body { padding: 0 0.8rem 0.8rem; display: flex; flex-direction: column; gap: 0.7rem; }
.vp-team-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.vp-team-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-width: 0;
  padding: 0.45rem 0.55rem; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-input);
}
.vp-team-info { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; }
.vp-team-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-team-count { font-size: 0.74rem; flex: 0 0 auto; }
.vp-team-actions { display: flex; gap: 0.3rem; flex: 0 0 auto; }
.vp-team-edit { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.6rem; border-top: 1px dashed var(--border-subtle); }
.vp-team-edit-foot { display: flex; gap: 0.5rem; }
.vp-danger { color: var(--state-error); }

/* Number cards */
.vp-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.vp-line { border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-elevated); overflow: hidden; }
.vp-line-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; min-width: 0;
  width: 100%; padding: 0.7rem 0.85rem; background: none; border: none; cursor: pointer; font: inherit; text-align: left;
}
.vp-line-title { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.vp-line-num { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.vp-line-sub { font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-line-meta { display: flex; align-items: center; gap: 0.55rem; flex: 0 0 auto; }
.vp-badge {
  font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem; border-radius: 999px; border: 1px solid var(--border-subtle); white-space: nowrap;
}
.vp-badge--live { background: color-mix(in srgb, var(--state-success) 16%, var(--bg-elevated)); color: var(--state-success); border-color: color-mix(in srgb, var(--state-success) 38%, transparent); }
.vp-badge--pending { background: color-mix(in srgb, var(--state-warning) 13%, var(--bg-elevated)); color: var(--state-warning); border-color: color-mix(in srgb, var(--state-warning) 38%, transparent); }
.vp-badge--elsewhere,
.vp-badge--unknown { background: var(--bg-input); color: var(--text-muted); }
.vp-badge--missing { background: color-mix(in srgb, var(--state-error) 11%, var(--bg-elevated)); color: var(--state-error); border-color: color-mix(in srgb, var(--state-error) 34%, transparent); }
.vp-chevron { font-size: 1rem; color: var(--text-muted); transition: transform 0.15s ease; transform: rotate(90deg); }
.vp-chevron[data-open="true"] { transform: rotate(-90deg); }

.vp-line-body { padding: 0.2rem 0.85rem 0.95rem; display: flex; flex-direction: column; gap: 1rem; border-top: 1px solid var(--border-subtle); }
.vp-label-field { margin-top: 0.7rem; }
.vp-hint { font-size: 0.76rem; line-height: 1.45; padding: 0.5rem 0.6rem; border: 1px dashed var(--border-subtle); border-radius: 8px; }
.vp-block { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.vp-block-head { font-size: 0.78rem; font-weight: 600; color: var(--text-primary); }
.vp-note { font-size: 0.73rem; margin: 0; }

/* Segmented control */
.vp-seg { display: inline-flex; padding: 0.2rem; gap: 0.2rem; background: var(--bg-input); border: 1px solid var(--border-subtle); border-radius: 9px; flex-wrap: wrap; }
.vp-seg-btn { font: inherit; font-size: 0.76rem; padding: 0.3rem 0.7rem; border: none; border-radius: 7px; background: none; color: var(--text-muted); cursor: pointer; }
.vp-seg-btn.is-active { background: var(--bg-elevated); color: var(--text-primary); box-shadow: 0 1px 2px rgba(0,0,0,0.12); }

/* People chips */
.vp-people { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vp-person {
  display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0;
  padding: 0.28rem 0.6rem 0.28rem 0.32rem; border: 1px solid var(--border-subtle); border-radius: 999px;
  background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 0.78rem; cursor: pointer;
}
.vp-person.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated)); }
.vp-person-copy { display: grid; min-width: 0; gap: 0.04rem; }
.vp-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 11rem; }
.vp-person-readiness { color: var(--text-muted); font-size: 0.62rem; line-height: 1.2; white-space: nowrap; }
.vp-person-readiness.is-ready { color: var(--state-success); }
.vp-person-readiness.is-backup { color: var(--accent); }
.vp-person-readiness.is-quiet,
.vp-person-readiness.is-busy { color: var(--state-warning); }

/* Outbound dial policy (per-number allow-list + call-length cap) */
.vp-dial-custom { display: flex; flex-direction: column; gap: 0.55rem; }
.vp-region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.3rem 0.6rem; }
.vp-region-check { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-primary); cursor: pointer; min-width: 0; }
.vp-region-check input[type="checkbox"] { width: 16px; height: 16px; flex: 0 0 auto; border-radius: 4px; }
.vp-region-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-region-extras { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.vp-region-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.24rem 0.28rem 0.24rem 0.6rem; border: 1px solid var(--border-subtle); border-radius: 999px; background: var(--bg-input); color: var(--text-primary); font-size: 0.76rem; }
.vp-region-chip-x { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: none; border-radius: 999px; background: none; color: var(--text-muted); font-size: 1rem; line-height: 1; cursor: pointer; }
.vp-region-chip-x:hover { color: var(--text-primary); background: var(--bg-elevated); }
.vp-dial-add { display: flex; flex-direction: column; gap: 0.25rem; max-width: 320px; }
.vp-dial-cap { margin-top: 0.15rem; max-width: 320px; }
.vp-dial-warn { font-size: 0.76rem; margin: 0; color: color-mix(in srgb, #f59e0b 82%, var(--text-primary)); }
.vp-av {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border-radius: 999px; background: var(--accent); color: var(--accent-contrast);
  font-size: 0.7rem; font-weight: 600; background-position: center; overflow: hidden;
}
.vp-team-pick { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; min-width: 0; }
.vp-team-pick .selectmenu-trigger { min-width: 0; flex: 1 1 12rem; }
.vp-empty { font-size: 0.76rem; }

/* Greeting tabs + editor */
.vp-tabs { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.vp-tab { font: inherit; font-size: 0.76rem; padding: 0.3rem 0.7rem; border: 1px solid var(--border-subtle); border-radius: 999px; background: var(--bg-input); color: var(--text-muted); cursor: pointer; }
.vp-tab.is-active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated)); }

/* Per-line section tabs (Ringing / Caller experience / Voicemail / Recording) —
   groups the old single scroll of blocks; reuses .vp-tab pills under a divider. */
.vp-secnav { display: flex; gap: 0.3rem; flex-wrap: wrap; padding-bottom: 0.65rem; margin-bottom: 0.35rem; border-bottom: 1px solid var(--border-subtle); }

/* Collapsed-row config summary chips (derived from the SAVED config) */
.vp-line-sum { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.3rem; }
.vp-sum-chip { font-size: 0.66rem; padding: 0.12rem 0.5rem; border-radius: 999px; background: var(--bg-input); color: var(--text-muted); border: 1px solid var(--border-subtle); white-space: nowrap; }
.vp-sum-chip--warn { color: var(--state-warning); border-color: color-mix(in srgb, var(--state-warning) 40%, transparent); background: color-mix(in srgb, var(--state-warning) 10%, var(--bg-input)); }

/* "Looking for call settings?" pointer card on the Messaging page */
.comms-voice-pointer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.vp-greet { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
/* In the column-flex greeting block the voice field's `flex: 1 1 12rem` (meant for
   the ROW layout) turned into a 12rem-tall stretched box around a small select.
   Pin it to content height when it's a direct child of the column. */
.vp-greet > .vp-voice-field { flex: 0 0 auto; }
.vp-greet-row { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; min-width: 0; }
.vp-voice-field { min-width: 0; flex: 1 1 12rem; }
.vp-file { display: none; }
.vp-audio { width: 100%; height: 36px; margin-top: 0.2rem; }

/* Hours */
.vp-hours { display: flex; flex-direction: column; gap: 0.35rem; }
.vp-hour-row { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex-wrap: wrap; }
.vp-hour-row.is-off { opacity: 0.7; }
.vp-hour-day { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 4.5rem; font-size: 0.8rem; color: var(--text-primary); cursor: pointer; }
.vp-hour-times { display: inline-flex; align-items: center; gap: 0.45rem; }
.vp-time { width: auto; min-width: 0; padding: 0.25rem 0.4rem; }
.vp-hour-closed { font-size: 0.76rem; }

/* Toggles + options */
.vp-options { display: flex; flex-direction: column; gap: 0.45rem; }
.vp-toggle { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; color: var(--text-primary); cursor: pointer; }
.vp-ring { gap: 0.4rem; }
.vp-ring-input { width: 4rem; padding: 0.25rem 0.4rem; }

/* Footer */
.vp-foot { display: flex; align-items: center; gap: 0.7rem; padding-top: 0.3rem; flex-wrap: wrap; }
.vp-saved { font-size: 0.78rem; font-weight: 600; color: var(--state-success); }
.vp-save-error { margin: 0; }

/* IVR builder + voicemail extras */
.vp-ivr { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.vp-ivr-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.vp-ivr-row { display: flex; align-items: center; gap: 0.4rem; min-width: 0; flex-wrap: wrap; }
.vp-ivr-digit { width: 3.4rem; flex: 0 0 auto; text-align: center; padding: 0.3rem 0.4rem; }
.vp-ivr-label { flex: 1 1 8rem; min-width: 0; padding: 0.3rem 0.5rem; }
.vp-ivr-action { flex: 0 0 auto; width: auto; padding: 0.3rem 0.5rem; }
.vp-ivr-target, .vp-ivr-msg { flex: 1 1 9rem; min-width: 0; padding: 0.3rem 0.5rem; }
.vp-ivr-adv { display: flex; gap: 0.9rem; align-items: flex-end; flex-wrap: wrap; }
.vp-vm-extra { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.5rem 0 0.2rem 1.6rem; }

/* Missed-call auto-reply (V5): the SMS body editor + char-count row (theming inherited from
   .properties-input-text / .muted, so light + dark are automatic). */
.vp-mcr-text { width: 100%; min-width: 0; min-height: 3.2em; resize: vertical; line-height: 1.45; font: inherit; }
.vp-mcr-foot { display: flex; justify-content: flex-end; }
.vp-mcr-foot .muted { font-size: 0.7rem; }

@container settings-main (max-width: 768px) {
  .vp-line-head { padding: 0.6rem 0.7rem; }
  .vp-line-body { padding-left: 0.7rem; padding-right: 0.7rem; }
  .vp-line-meta { gap: 0.4rem; }
  .vp-badge { font-size: 0.6rem; }
  .vp-greet-row { align-items: stretch; }
  .vp-person-name { max-width: 8rem; }
  .vp-ivr-row { gap: 0.3rem; }
  .vp-ivr-label, .vp-ivr-target, .vp-ivr-msg { flex-basis: 6rem; }
  .vp-vm-extra { padding-left: 0.4rem; }
}

/* ---------------------------------------------------------------------------
   New-contact draft: searchable contact-type combobox + inline create modal.
   Token-based (light/dark parity via the same tokens); small-screen first-class
   (min-width:0 everywhere; modal width:min(420px,92vw)). Scoped to .inbox-ctype-*
   so it never touches the shared .inbox-tmpl-* / segment rules.
--------------------------------------------------------------------------- */
.inbox-ctype-combo {
  position: relative;
  min-width: 0;
}
.inbox-ctype-combo-input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 0 1.9rem 0 0.65rem;
  font: inherit;
  font-size: 0.84rem;
}
.inbox-ctype-combo-input:focus {
  outline: none;
  border-color: var(--accent);
}
.inbox-ctype-combo-input:disabled {
  opacity: 0.6;
}
.inbox-ctype-combo-clear {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  padding: 0 0.2rem;
}
.inbox-ctype-combo-clear:hover {
  color: var(--text-primary);
}
.inbox-ctype-combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 0.25rem;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}
.inbox-ctype-combo-option,
.inbox-ctype-combo-create {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-primary);
  padding: 0.4rem 0.5rem;
  border-radius: 7px;
}
.inbox-ctype-combo-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}
.inbox-ctype-combo-option > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-ctype-combo-option > small {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 650;
}
.inbox-ctype-combo-option:hover,
.inbox-ctype-combo-create:hover {
  background: var(--bg-input);
}
.inbox-ctype-combo-create {
  color: var(--accent);
  font-weight: 650;
}
.inbox-ctype-combo-empty {
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Inline create-type modal (mirrors .inbox-tmpl-* a11y/markup). */
.inbox-ctype-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.inbox-ctype-modal {
  width: min(420px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.inbox-ctype-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}
.inbox-ctype-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.inbox-ctype-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-muted);
  padding: 0 4px;
}
.inbox-ctype-close:hover {
  color: var(--text-primary);
}
.inbox-ctype-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem;
}
.inbox-ctype-intro,
.inbox-ctype-system-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}
.inbox-ctype-system-note {
  padding: 0.65rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-soft);
}
.inbox-ctype-field {
  display: grid;
  gap: 0.32rem;
  min-width: 0;
}
.inbox-ctype-field > span {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.inbox-ctype-input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  font: inherit;
  font-size: 0.84rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0 0.65rem;
}
.inbox-ctype-input:focus {
  outline: none;
  border-color: var(--accent);
}
.inbox-ctype-help {
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}
.inbox-ctype-error {
  margin: 0;
  font-size: 0.75rem;
  color: var(--state-error);
}
.inbox-ctype-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* Wide variant — hosts a whole form (the canonical contact grid in
   NameContactModal) rather than two fields. Same shell, same tokens, so light /
   dark parity and the chrome stay identical; only the box grows and scrolls.
   Capped at 88vh so a long form never runs off a laptop or a phone screen. */
.inbox-ctype-modal.is-wide {
  width: min(560px, 94vw);
  max-height: 88vh;
  position: relative;
}
.inbox-namecontact-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}
/* The hosted form carries its own card chrome — drop the doubled border and
   radius so the modal reads as ONE surface, not a card inside a card. */
.inbox-namecontact-body .inbox-contact-draft {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  margin: 0;
}
.inbox-namecontact-close {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.inbox-namecontact-close:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Read-only identity value inside the contact form (the phone a contact is
   being named BY). Looks like the inputs beside it, minus the affordances —
   it is information, not a field. */
.inbox-contact-draft-locked {
  margin: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 0.65rem;
  font-size: 0.84rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
}
/* Helper sentences under a field. `.inbox-contact-draft-field > span` is the
   FIELD LABEL style (uppercase, bold, tracked) and these are direct children of
   the same wrapper, so every property of it has to be undone — otherwise a
   sentence renders as A SHOUTED LABEL. */
.inbox-contact-draft-field > span.inbox-contact-draft-hint {
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text-muted);
}

/* Confirmation dialog for destructive actions — a real, on-brand modal that
   replaces the native window.confirm (which read as an off-brand "system"
   prompt). Token-driven ⇒ automatic light/dark parity. */
.inbox-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.inbox-confirm-modal {
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  padding: 1.15rem 1.2rem 1rem;
}
.inbox-confirm-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}
.inbox-confirm-message {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-soft);
}
.inbox-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.inbox-confirm-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  min-height: 36px;
  padding: 0 0.95rem;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.inbox-confirm-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.inbox-confirm-btn.is-cancel {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.inbox-confirm-btn.is-cancel:hover:not(:disabled) {
  background: color-mix(in srgb, var(--border-subtle) 40%, transparent);
}
.inbox-confirm-btn.is-confirm {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
}
.inbox-confirm-btn.is-confirm:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 88%, #000);
}
.inbox-confirm-btn.is-danger {
  background: var(--state-error);
  color: #fff;
}
.inbox-confirm-btn.is-danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--state-error) 86%, #000);
}
.inbox-confirm-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 2px;
}

/* One global confirmation/text-dialog service for desktop and phone. The
   native dialog top layer owns focus containment and makes the page behind it
   inert; UOS owns every visible word and style. */
.action-dialog {
  width: min(420px, calc(100vw - 2rem));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  color: var(--text-primary);
  border: 0;
  background: transparent;
}
.action-dialog::backdrop {
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(4px);
}
.action-dialog-card {
  display: grid;
  gap: 0.7rem;
  padding: 1.2rem;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--bg-elevated);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.44);
}
.action-dialog-card h2,
.action-dialog-card p { margin: 0; }
.action-dialog-card h2 { font-size: 1rem; }
.action-dialog-card p { color: var(--text-soft); font-size: 0.84rem; line-height: 1.5; white-space: pre-line; }
.action-dialog-field { display: grid; gap: 0.35rem; }
.action-dialog-field > span { color: var(--text-muted); font-size: 0.72rem; font-weight: 700; }
.action-dialog-field input {
  min-width: 0;
  height: 42px;
  padding: 0 0.75rem;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg-input);
  font: inherit;
}
.action-dialog-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) {
  .action-dialog {
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top));
    margin: auto 0 0;
  }
  .action-dialog-card {
    padding: 1.15rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
  }
  .action-dialog .inbox-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .action-dialog .inbox-confirm-actions.is-single { grid-template-columns: 1fr; }
  .action-dialog .inbox-confirm-btn { min-height: 44px; }
}

/* ---------------------------------------------------------------------------
   Editable thread participants roster (add / remove + picker).
   Scoped under .inbox-thread-participant-editor so the rows can carry a 3rd
   (actions) column without touching the legacy read-only .inbox-thread-
   participant rule. Tokens only; picker is small-screen first-class
   (max-height + overflow:auto, min-width:0 everywhere).
--------------------------------------------------------------------------- */
.inbox-thread-participant-editor {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}
.inbox-thread-participant-editor .inbox-thread-participant {
  grid-template-columns: 30px minmax(0, 1fr) auto;
}
.inbox-thread-participant-editor .inbox-thread-participant:hover {
  /* this row is no longer a button — keep the resting border on hover */
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
}
.inbox-thread-participant-meta {
  min-width: 0;
}
.inbox-thread-participant-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.inbox-thread-participant-action {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}
.inbox-thread-participant-action:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.inbox-thread-participant-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.inbox-thread-participant-remove:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--state-error) 45%, var(--border-subtle));
  color: var(--state-error);
}
.inbox-thread-participant-action:disabled,
.inbox-thread-participant-remove:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.inbox-thread-participant-add {
  justify-self: start;
  border: 1px dashed var(--border-subtle);
  border-radius: 9px;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  padding: 0.34rem 0.6rem;
  cursor: pointer;
}
.inbox-thread-participant-add:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.inbox-thread-participant-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* "Name this contact" — the primary action on a row whose person is still an
   unnamed number showing as a generated animal name. Accent-tinted so it reads
   ahead of the neutral remove control beside it. Same base metrics as
   .inbox-thread-participant-action, so the three buttons line up exactly. */
.inbox-thread-participant-action.is-name {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-weight: 600;
}
.inbox-thread-participant-action.is-name:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}

/* The same offer in a thread HEADER, beside the generated name. Sized to sit on
   the title row without pushing it taller. */
.inbox-name-contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.26rem 0.5rem;
  white-space: nowrap;
  cursor: pointer;
}
.inbox-name-contact-cta:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Inline "create new contact" affordance inside the add-picker (3a). */
.inbox-thread-participant-createtoggle {
  justify-self: start;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.78rem;
  padding: 0.2rem 0;
  cursor: pointer;
}
.inbox-thread-participant-createtoggle:hover {
  text-decoration: underline;
}
.inbox-thread-participant-create {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle);
}
.inbox-thread-participant-field-label {
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 650;
}
/* Phone: the "we don't know who this is" strip under the conversation header.
   Its own row because a phone header has no spare width beside the name. */
.ph-convo-nameprompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.ph-convo-nameprompt-text {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.74rem;
  line-height: 1.35;
  color: var(--text-soft);
}

/* "That number is already on this thread" — the twin guard's explanation. */
.inbox-thread-participant-twin {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.4;
}
.inbox-thread-participant-create-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
}
.inbox-thread-participant-picker {
  display: grid;
  gap: 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-surface);
  padding: 0.6rem;
  min-width: 0;
}
.inbox-thread-participant-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.76rem;
  color: var(--text-soft);
  min-width: 0;
}
.inbox-thread-participant-picker-head > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-thread-participant-search {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.82rem;
  padding: 0.4rem 0.55rem;
}
.inbox-thread-participant-search:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ring) 40%, var(--border-subtle));
}
.inbox-thread-participant-results {
  display: grid;
  gap: 0.3rem;
  max-height: 240px;
  overflow: auto;
  min-width: 0;
}
.inbox-thread-participant-result {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  padding: 0.36rem 0.45rem;
  text-align: left;
  cursor: pointer;
}
.inbox-thread-participant-result:hover:not(:disabled) {
  border-color: var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 60%, var(--bg-elevated));
}
.inbox-thread-participant-result:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.inbox-thread-participant-result strong,
.inbox-thread-participant-result small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-thread-participant-result small {
  color: var(--text-soft);
  font-size: 0.7rem;
}
@media (max-width: 768px) {
  .inbox-thread-participant-results {
    max-height: 180px;
  }
}

/* Richer add-contact picker — type-filter chips + per-row primary-type badge.
   Colours come from relationship_types (per row via --ctp-badge / per chip via
   --ctp-chip); color-mix keeps text legible against both themes. */
.inbox-thread-participant-typefilter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.5rem 0 0.15rem;
}
.inbox-ctp-typechip {
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.inbox-ctp-typechip:hover {
  color: var(--text-primary);
  border-color: var(--border-strong, var(--text-soft));
}
.inbox-ctp-typechip.is-active {
  font-weight: 600;
  color: color-mix(in srgb, var(--ctp-chip, var(--accent)) 70%, var(--text-primary));
  background: color-mix(in srgb, var(--ctp-chip, var(--accent)) 15%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--ctp-chip, var(--accent)) 50%, transparent);
}
.inbox-ctp-result-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.inbox-ctp-result-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.inbox-ctp-result-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-ctp-typebadge {
  flex: none;
  font-size: 0.66rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.2rem 0.4rem;
  border-radius: 999px;
  color: color-mix(in srgb, var(--ctp-badge, var(--accent)) 68%, var(--text-primary));
  background: color-mix(in srgb, var(--ctp-badge, var(--accent)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ctp-badge, var(--accent)) 36%, transparent);
}
.inbox-ctp-result-status {
  text-transform: capitalize;
}

/* Stay schedule and same day turnover context. The popover is fixed so it can
   escape the conversation pane, while the chip stays inline with the dates. */
.inbox-flip-anchor {
  display: inline-flex;
  min-width: 0;
}

.inbox-flip-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.4rem;
  padding: 0.08rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--state-warning) 45%, var(--border-subtle));
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-warning) 16%, var(--bg-elevated));
  color: color-mix(in srgb, var(--state-warning) 72%, var(--text-primary));
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
}

.inbox-flip-chip:hover,
.inbox-flip-chip:focus-visible {
  background: color-mix(in srgb, var(--state-warning) 26%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-warning) 60%, var(--border-subtle));
}

.inbox-flip-chip-icon {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--state-warning) 80%, var(--text-primary));
}

/* Calm variant for a stay or active request with no same day turnover. */
.inbox-flip-chip.is-calm {
  border-color: var(--border-subtle);
  background: var(--bg-elevated);
  color: color-mix(in srgb, var(--text-primary) 78%, transparent);
}

.inbox-flip-chip.is-calm:hover,
.inbox-flip-chip.is-calm:focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}

.inbox-flip-chip.is-calm .inbox-flip-chip-icon {
  color: color-mix(in srgb, var(--text-primary) 62%, transparent);
}

.inbox-flip-pop {
  position: fixed;
  z-index: 80;
  width: min(360px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}

/* Slice 7 — per-message route disclosure (the "sent-to / reply-to" arrow). The
   trigger lives in the bubble-meta cluster; the fixed popover is portalled to body
   so the row's content-visibility paint containment cannot clip it. It flips and
   clamps against the viewport. All colours via tokens → light/dark parity. */
.inbox-route-anchor {
  display: inline-flex;
  min-width: 0;
}
.inbox-route-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 0;
  transition: color 120ms ease, background 120ms ease;
}
.inbox-route-toggle:hover,
.inbox-route-toggle:focus-visible,
.inbox-route-toggle[aria-expanded="true"] {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-primary) 9%, transparent);
}
.inbox-route-caret {
  transition: transform 140ms ease;
}
.inbox-route-caret.is-open {
  transform: rotate(180deg);
}

.inbox-route-pop {
  position: fixed;
  z-index: 80;
  width: min(280px, 92vw);
  max-width: 92vw;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}
.inbox-route-load-state { display: grid; width: min(260px, 92vw); gap: 0.55rem; color: var(--text-soft); font-size: 0.76rem; line-height: 1.35; }
.inbox-route-load-state p { margin: 0; }
.inbox-route-load-actions { display: flex; justify-content: flex-end; gap: 0.4rem; }
.inbox-route-load-actions button { min-height: 30px; padding: 0 0.6rem; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--bg-surface); color: var(--text-primary); font: inherit; font-weight: 650; cursor: pointer; }
.inbox-route-load-actions button:hover,
.inbox-route-load-actions button:focus-visible { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle)); background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface)); }
.inbox-route-head {
  margin-bottom: 0.4rem;
}
.inbox-route-transport {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.inbox-route-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.inbox-route-body p {
  margin: 0;
}
.inbox-route-party {
  font-size: 0.82rem;
  color: var(--text-primary);
  word-break: break-word;
}
.inbox-route-dir {
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 0.2rem;
}
.inbox-route-hint {
  font-size: 0.76rem;
  color: var(--text-soft);
  line-height: 1.35;
}

/* Personal reminders. One component serves the desktop pane and phone sheet. */
.aiops-reminders {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  color: var(--text-primary);
}
.aiops-reminders-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.aiops-reminders-head > span {
  display: grid;
  gap: 1px;
}
.aiops-reminders-head small {
  color: var(--text-muted);
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.aiops-reminders-head strong {
  font-size: 14px;
}
.aiops-reminders-head > button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.aiops-reminders-head button svg {
  flex: none;
}
.aiops-reminder-form {
  display: grid;
  gap: 9px;
  padding: 11px 12px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-muted) 52%, transparent);
}
.aiops-reminder-form label {
  display: grid;
  gap: 5px;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 650;
}
.aiops-reminder-form label small {
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 500;
}
.aiops-reminder-form input,
.aiops-reminder-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  outline: none;
  color: var(--text-primary);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 12px;
}
.aiops-reminder-form textarea {
  min-height: 68px;
  resize: vertical;
  line-height: 1.45;
}
.aiops-reminder-form input:focus,
.aiops-reminder-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}
.aiops-reminder-save {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 9px;
  color: var(--accent-contrast, #fff);
  background: var(--accent);
  font: inherit;
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
}
.aiops-reminder-save:disabled {
  cursor: default;
  opacity: 0.52;
}
.aiops-reminder-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 9px 12px 0;
  padding: 8px 9px;
  border-radius: 9px;
  color: var(--state-danger);
  background: color-mix(in srgb, var(--state-danger) 9%, transparent);
  font-size: 10.5px;
}
.aiops-reminder-error span {
  flex: 1;
}
.aiops-reminder-error button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.aiops-reminders-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px 20px;
}
.aiops-reminders-loading,
.aiops-reminders-empty {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11.5px;
}
.aiops-reminders-empty {
  flex-direction: column;
  padding: 22px;
  text-align: center;
}
.aiops-reminders-empty > span {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 3px;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.aiops-reminders-empty strong {
  color: var(--text-primary);
  font-size: 13px;
}
.aiops-reminders-empty p {
  max-width: 250px;
  margin: 0;
  line-height: 1.5;
}
.aiops-reminder-section + .aiops-reminder-section {
  margin-top: 15px;
}
.aiops-reminder-section > header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
  color: var(--text-soft);
}
.aiops-reminder-section > header strong {
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.aiops-reminder-section > header span {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-muted);
  font-size: 9px;
  font-weight: 750;
}
.aiops-reminder-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.aiops-reminder-section-empty {
  margin: 0;
  padding: 10px;
  border: 1px dashed var(--border-subtle);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 10.5px;
  text-align: center;
}
.aiops-reminder-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.aiops-reminder-card.is-delivered {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.aiops-reminder-card.is-completed,
.aiops-reminder-card.is-cancelled {
  opacity: 0.72;
}
.aiops-reminder-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.aiops-reminder-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: none;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.aiops-reminder-copy {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}
.aiops-reminder-copy strong {
  overflow-wrap: anywhere;
  font-size: 11.5px;
  line-height: 1.35;
}
.aiops-reminder-copy > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 9.5px;
}
.aiops-reminder-copy svg {
  flex: none;
}
.aiops-reminder-status {
  flex: none;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 8.5px;
  font-weight: 750;
}
.aiops-reminder-card > p {
  margin: 0;
  color: var(--text-soft);
  font-size: 10.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.aiops-reminder-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--text-muted);
  font-size: 9px;
}
.aiops-reminder-meta .is-error {
  color: var(--state-danger);
}
.aiops-reminder-actions {
  display: flex;
  gap: 6px;
}
.aiops-reminder-actions button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--surface-muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.aiops-reminder-actions button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  color: var(--accent);
}
.aiops-reminder-actions button.is-cancel:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--state-danger) 38%, var(--border-subtle));
  color: var(--state-danger);
}
.aiops-reminder-actions button:disabled {
  cursor: default;
  opacity: 0.55;
}
.ph-brain .aiops-reminders-head {
  padding-inline: 16px;
}
.ph-brain .aiops-reminder-form,
.ph-brain .aiops-reminders-scroll {
  padding-inline: 16px;
}
.ph-brain .aiops-reminders-head > button,
.ph-brain .aiops-reminder-save,
.ph-brain .aiops-reminder-actions button {
  min-height: 44px;
}
.inbox-route-email {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.1rem 0 0;
  padding: 0.35rem 0 0;
  border-top: 1px solid var(--border-subtle);
}
.inbox-route-email-row {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
}
.inbox-route-email-row dt {
  flex: 0 0 3.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.inbox-route-email-row dd {
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-primary);
  word-break: break-word;
}

/* Stay schedule popover. Long stays used to be clipped into a tiny sixteen day
   calendar whose labels and bars could not be read. The current dates and both
   adjacent booking edges are now stated directly at a useful text size. */
.inbox-turn-head {
  margin: 0 0 0.55rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.25;
}
.inbox-turn-current {
  display: grid;
  gap: 0.16rem;
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
}
.inbox-turn-current > span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.3;
}
.inbox-turn-current > strong {
  color: var(--text-primary);
  font-size: 0.84rem;
  font-weight: 720;
  line-height: 1.35;
}
.inbox-turn-rows {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.inbox-turn-row {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
}
.inbox-turn-row.is-flip {
  background: color-mix(in srgb, var(--state-warning, #f59e0b) 15%, transparent);
}
.inbox-turn-row-label {
  font-size: 0.7rem;
  font-weight: 680;
  color: var(--text-muted);
}
.inbox-turn-row-value {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.81rem;
  line-height: 1.42;
  color: var(--text-primary);
}
.inbox-turn-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  color: #7c4a00;
  background: var(--state-warning, #f59e0b);
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
}

.inbox-flip-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.55rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 650;
  text-decoration: none;
}

.inbox-flip-link:hover {
  text-decoration: underline;
}

/* ── Item 6 — Smarter triage (needs-follow-up / snooze) ──────────────────────
   A FILTER FACET, never a hide: snoozed rows render greyed-but-present in "All"
   and are excluded only from "Needs follow-up". All colour via tokens (light +
   dark parity). The ⋯ menu itself is portalled to <body>, so its tooltip/menu
   already escape the pane-2 overflow — no extra positioning needed here. */

/* Subtle accent dot = this thread needs a follow-up (guest spoke last, not
   snoozed). Distinct from the cyan unread dot — orthogonal axis. */
.workspace-followup-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 auto;
  align-self: center;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Muted "Snoozed until Thu" chip — calm, recedes (a deliberate defer, not an
   alert). Wraps on small screens; min-width:0 so it never blows out the row. */
.workspace-snooze-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-muted) 70%, transparent);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Snoozed rows recede in "All" — present but visibly deferred. Never display:none. */
.workspace-list-card.is-triage-snoozed {
  opacity: 0.62;
}
.workspace-list-card.is-triage-snoozed:hover,
.workspace-list-card.is-triage-snoozed.is-active {
  opacity: 1;
}

/* Live count badge on the Triage filter parent + the "Needs follow-up" option. */
.workspace-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

@media (max-width: 768px) {
  .workspace-snooze-chip {
    white-space: normal;
  }
}

/* ── Unified inbox row (wl2) — one calm anatomy for every thread type (task #66) ── */
.wl2-row{
  display:flex; align-items:center; gap:11px;
  width:100%; box-sizing:border-box; min-width:0;
  padding:9px 12px; border-radius:12px;
  text-decoration:none; color:inherit; position:relative;
  border:1px solid transparent;
  transition:background .12s ease, border-color .12s ease;
}
.wl2-row:hover{ background:color-mix(in srgb, var(--accent) 6%, transparent); }
.wl2-row.is-active{
  background:color-mix(in srgb, var(--accent) 11%, transparent);
  border-color:color-mix(in srgb, var(--accent) 22%, transparent);
}
.wl2-row.is-snoozed{ opacity:.72; }
.wl2-row.is-unread::before,
.wl2-row.is-attention::before{
  content:""; position:absolute; left:3px; top:11px; bottom:11px; width:2px; border-radius:2px;
  background:var(--accent);
}
.wl2-row.is-attention::before{ background:var(--state-warning); }
.wl2-row.is-portal-action:not(.is-active){
  background:color-mix(in srgb, var(--state-warning) 6%, transparent);
  border-color:color-mix(in srgb, var(--state-warning) 18%, transparent);
}

.wl2-avatar{ position:relative; width:40px; height:40px; flex:0 0 40px; }
.wl2-avatar-img,.wl2-avatar-fallback{
  width:40px; height:40px; border-radius:50%; object-fit:cover;
  display:flex; align-items:center; justify-content:center;
}
.wl2-channel{
  position:absolute; right:-3px; bottom:-3px;
  width:17px; height:17px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-soft);
  background:var(--bg-elevated); border:1.5px solid var(--bg-elevated);
  box-shadow:0 0 0 1px var(--border-subtle);
}
.wl2-channel-logo{ display:flex; width:12px; height:12px; }
.wl2-channel-logo img,.wl2-channel-logo svg{ width:12px; height:12px; display:block; }
.wl2-avatar.is-room .wl2-avatar-img,
.wl2-avatar.is-room .wl2-avatar-fallback{ border-radius:12px; }
/* ── Slice 9a — Team Rooms (internal group threads) ───────────────────────── */
/* Pane-2 row: group glyph in the (rounded-square via .wl2-avatar.is-room) avatar. */
.wl2-avatar-room{
  background:color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
  color:var(--accent);
}
.wl2-avatar-room svg{ width:20px; height:20px; }

/* NewRoomModal / NewThreadModal — team-member + contact multi-picker */
.nrm-member-list{
  display:flex; flex-direction:column; gap:2px; max-height:240px; overflow:auto;
  border:1px solid var(--border-subtle); border-radius:var(--radius-sm); padding:4px;
}
.nrm-member-empty{ padding:10px; font-size:12.5px; color:var(--text-muted); }
.nrm-member-row{
  display:flex; align-items:center; gap:10px; width:100%;
  padding:6px 8px; border:0; background:transparent; border-radius:8px;
  cursor:pointer; text-align:left; color:var(--text-primary);
}
.nrm-member-row:hover{ background:color-mix(in srgb, var(--accent) 8%, transparent); }
.nrm-member-row.is-on{ background:color-mix(in srgb, var(--accent) 12%, transparent); }
.nrm-member-avatar{
  flex:0 0 auto; width:28px; height:28px; border-radius:50%; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:600;
  background:color-mix(in srgb, var(--accent) 16%, var(--bg-elevated)); color:var(--accent);
}
.nrm-member-avatar img{ width:100%; height:100%; object-fit:cover; }
.nrm-member-name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }
.nrm-member-check{ flex:0 0 auto; width:16px; text-align:center; color:var(--accent); font-weight:700; }
/* NewThreadModal — picked-contact chips + the contact search dropdown */
.nrm-picked-row{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.nrm-picked-chip{
  display:inline-flex; align-items:center; gap:6px; padding:3px 6px 3px 10px;
  border-radius:999px; font-size:12.5px;
  background:color-mix(in srgb, var(--accent) 12%, transparent); color:var(--text-primary);
  max-width:160px; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.nrm-picked-remove{
  border:0; background:transparent; cursor:pointer; line-height:1;
  font-size:15px; color:var(--text-muted); padding:0 2px; flex-shrink:0;
}
.nrm-picked-remove:hover{ color:var(--text-primary); }
.nrm-search-results{ margin-top:6px; }

.rc-facepile-item{ margin-left:-8px; border-radius:50%; box-shadow:0 0 0 2px var(--bg-elevated); }
.rc-facepile-item:first-child{ margin-left:0; }

/* INBOX §1 — stacked-avatar facepile for multi-party threads (pane-2 rows + chat
   header). Occupies the SAME leading box as a single ContactAvatar so text never
   shifts; the component sets each disc's size + overlap inline so the cluster always
   fits. Leftmost disc on top; each ring matches the row background for separation. */
.avatar-stack{ display:inline-flex; align-items:center; flex:0 0 auto; position:relative; }
.avatar-stack-disc{
  position:relative; flex:0 0 auto; border-radius:50%; overflow:hidden;
  box-shadow:0 0 0 2px var(--bg-elevated);
}
.avatar-stack-fill{
  width:100%; height:100%; border-radius:50%; object-fit:cover;
  display:flex; align-items:center; justify-content:center;
}
.avatar-stack-more{
  overflow:visible;
  display:flex; align-items:center; justify-content:center;
  background:color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
  color:var(--accent); font-weight:700; line-height:1;
}
.rc-avatar-img{ border-radius:50%; object-fit:cover; display:block; }
.rc-avatar-fallback{
  display:flex; align-items:center; justify-content:center; border-radius:50%;
  font-size:11px; font-weight:600;
  background:color-mix(in srgb, var(--accent) 16%, var(--bg-elevated)); color:var(--accent);
}
.rc-bubbles{ display:flex; flex-direction:column; gap:2px; padding:1rem 1.1rem; }
.rc-msg{ display:flex; gap:10px; padding:1px 0; }
.rc-msg.is-turn-start{ margin-top:10px; }
.rc-msg-avatar{ flex:0 0 28px; }
.rc-msg-avatar-spacer{ width:28px; height:1px; }
.rc-msg-main{ flex:1; min-width:0; }
.rc-msg-head{ display:flex; align-items:baseline; gap:8px; margin-bottom:1px; }
.rc-msg-author{ font-size:12.5px; font-weight:600; color:var(--text-primary); }
.rc-msg.is-mine .rc-msg-author{ color:var(--accent); }
.rc-msg-time{ font-size:11px; color:var(--text-muted); }
.rc-msg-body{ font-size:13.5px; color:var(--text-primary); white-space:pre-wrap; word-break:break-word; line-height:1.45; }
/* Wave 8 — rich room message body (our composer's HTML: formatting + mention chips).
   Real block markup, so drop pre-wrap and give the blocks sensible flow + spacing. */
.rc-msg-rich{ white-space:normal; }
.rc-msg-rich p{ margin:0 0 4px; }
.rc-msg-rich p:last-child{ margin-bottom:0; }
.rc-msg-rich ul, .rc-msg-rich ol{ margin:2px 0 4px; padding-left:1.25rem; }
.rc-msg-rich li{ margin:1px 0; }
.rc-msg-rich blockquote{ margin:3px 0; padding-left:8px; border-left:2px solid var(--border-strong); color:var(--text-muted); }
.rc-msg-rich code{ font-family:var(--font-mono, ui-monospace, monospace); font-size:0.92em; background:color-mix(in srgb, var(--text-primary) 8%, transparent); padding:0 3px; border-radius:3px; }
.rc-msg-rich a{ color:var(--accent); text-decoration:underline; }

/* ── Wave 8 slice 2: Slack-grade message affordances ───────────────────────── */
.rc-msg{ position:relative; }
.rc-msg.is-pinned{ background:color-mix(in srgb, var(--accent) 6%, transparent); border-radius:8px; }
/* Whole-row highlight on hover/focus so it's obvious which message the floating
   toolbar belongs to (Slack-style). Background-only — no box/layout change, so the
   absolute toolbar anchor and text alignment are untouched. */
.rc-msg:hover,
.rc-msg:focus-within{ background:color-mix(in srgb, var(--text-primary) 8%, transparent); border-radius:6px; }
.rc-msg.is-pinned:hover,
.rc-msg.is-pinned:focus-within{ background:color-mix(in srgb, var(--accent) 13%, transparent); border-radius:8px; }
.rc-msg-bodywrap{ display:inline; }
.rc-msg-edited{ font-size:10.5px; color:var(--text-muted); margin-left:2px; }
.rc-msg-deleted{ font-style:italic; color:var(--text-muted); }
.rc-msg-pinflag{ display:inline-flex; align-items:center; color:var(--accent); }

/* Hover toolbar — top-right of the row, revealed on hover/focus (always shown on
   touch, where there is no hover). */
.rc-msg-tools{
  position:absolute; top:-12px; right:6px; z-index:3;
  display:inline-flex; align-items:center; gap:1px;
  padding:2px; border:1px solid var(--border-subtle); border-radius:8px;
  background:var(--bg-elevated); box-shadow:0 3px 10px rgba(0,0,0,0.12);
  opacity:0; pointer-events:none; transition:opacity 0.12s ease;
}
.rc-msg:hover .rc-msg-tools,
.rc-msg:focus-within .rc-msg-tools{ opacity:1; pointer-events:auto; }
.rc-msg-tool{
  display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; border:none; border-radius:6px;
  background:transparent; color:var(--text-soft); cursor:pointer;
}
.rc-msg-tool:hover{ background:var(--bg-input); color:var(--text-primary); }
.rc-msg-tool.is-active{ color:var(--accent); }
.rc-msg-tool-danger:hover{ background:color-mix(in srgb, var(--state-danger, #dc2626) 14%, transparent); color:var(--state-danger, #dc2626); }

/* Quick-reaction popover anchored under the react button. */
.rc-react-wrap{ position:relative; display:inline-flex; }
.rc-react-pop{
  position:absolute; top:calc(100% + 4px); left:0; z-index:5;
  display:inline-flex; gap:1px; padding:3px;
  border:1px solid var(--border-subtle); border-radius:9px;
  background:var(--bg-elevated); box-shadow:0 4px 14px rgba(0,0,0,0.16);
}
.rc-react-opt{
  border:none; background:transparent; cursor:pointer;
  font-size:16px; line-height:1; padding:3px 4px; border-radius:6px;
}
.rc-react-opt:hover{ background:var(--bg-input); transform:scale(1.15); }

/* Reaction pills beneath the body. */
.rc-reactions{ display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.rc-reaction{
  display:inline-flex; align-items:center; gap:3px;
  padding:1px 7px; border:1px solid var(--border-subtle); border-radius:11px;
  background:var(--bg-input); color:var(--text-soft); cursor:pointer;
  font-size:11.5px; line-height:1.6;
}
.rc-reaction:hover{ border-color:var(--border-strong); }
.rc-reaction.is-mine{
  background:color-mix(in srgb, var(--accent) 14%, transparent);
  border-color:color-mix(in srgb, var(--accent) 45%, transparent);
  color:var(--accent);
}
.rc-reaction-emoji{ font-size:12.5px; }
.rc-reaction-count{ font-weight:600; }

/* Pinned strip atop the timeline. Titled + clearly bordered so it reads as its
   own block, distinct from the conversation below it. */
.rc-pinned-strip{
  display:flex; flex-direction:column; gap:2px;
  margin:-0.4rem -0.3rem 0.85rem; padding:7px 8px 8px;
  border:1px solid color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  border-radius:9px;
  background:color-mix(in srgb, var(--accent) 6%, var(--bg-input));
}
/* "PINNED · N" section title — the divider Hakim asked for: makes the pinned
   block unmistakable so it doesn't blend into the rest of the timeline. */
.rc-pinned-head{
  display:flex; align-items:center; gap:5px; margin:0 0 5px; padding:0 1px 5px;
  border-bottom:1px solid color-mix(in srgb, var(--accent) 16%, var(--border-subtle));
  font-size:10.5px; font-weight:700; letter-spacing:0.07em; text-transform:uppercase;
  color:var(--accent);
}
.rc-pinned-head > svg{ flex:0 0 auto; }
.rc-pinned-count{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:16px; height:15px; padding:0 5px; border-radius:999px;
  background:color-mix(in srgb, var(--accent) 16%, transparent);
  font-size:10px; font-weight:700; letter-spacing:0; color:var(--accent);
}
.rc-pinned-item{ display:flex; align-items:center; gap:4px; min-width:0; }
.rc-pinned-jump{
  flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:6px;
  border:none; background:transparent; cursor:pointer; padding:2px 3px; border-radius:6px;
  color:var(--text-soft); font-size:12px; text-align:left;
}
.rc-pinned-jump:hover{ background:color-mix(in srgb, var(--accent) 9%, transparent); color:var(--text-primary); }
.rc-pinned-jump > svg{ flex:0 0 auto; color:var(--accent); }
.rc-pinned-text{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rc-pinned-author{ flex:0 0 auto; color:var(--text-muted); font-size:11px; }
.rc-pinned-x{
  flex:0 0 auto; border:none; background:transparent; cursor:pointer;
  color:var(--text-muted); font-size:15px; line-height:1; padding:0 4px; border-radius:5px;
}
.rc-pinned-x:hover{ background:var(--bg-input); color:var(--text-primary); }

/* Inline editor. */
.rc-edit{ display:flex; flex-direction:column; gap:6px; margin-top:2px; }
.rc-edit-area{
  width:100%; resize:vertical; min-height:44px;
  border:1px solid var(--border-strong); border-radius:8px;
  background:var(--bg-input); color:var(--text-primary);
  font:inherit; font-size:13.5px; line-height:1.45; padding:6px 8px;
}
.rc-edit-area:focus{ outline:none; border-color:var(--accent); }
.rc-edit-actions{ display:flex; gap:6px; }
.rc-edit-cancel, .rc-edit-save{
  border-radius:7px; padding:3px 12px; font-size:12px; font-weight:600; cursor:pointer;
}
.rc-edit-cancel{ border:1px solid var(--border-subtle); background:var(--bg-input); color:var(--text-soft); }
.rc-edit-cancel:hover{ border-color:var(--border-strong); color:var(--text-primary); }
.rc-edit-save{ border:1px solid var(--accent); background:var(--accent); color:var(--accent-contrast, #fff); }
.rc-edit-save:disabled{ opacity:0.5; cursor:not-allowed; }

@media (max-width: 768px){
  /* No hover on touch — keep the toolbar reachable. */
  .rc-msg-tools{ opacity:1; pointer-events:auto; top:-10px; }
}

/* ── Wave 9 — threaded replies: "N replies" summary + pane-4 thread view ─────────
   Replaces the old inline quote-chips. A root message that has replies shows a
   compact pill (repliers' faces + count + last-reply time); clicking it opens the
   thread in the support pane. Token-based so light + dark parity is automatic. */
.rc-thread-summary{
  display:inline-flex; align-items:center; gap:8px; max-width:100%;
  margin:5px 0 1px; padding:3px 10px 3px 5px;
  border:1px solid color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  border-radius:999px; background:color-mix(in srgb, var(--accent) 6%, var(--bg-input));
  cursor:pointer; font:inherit; line-height:1;
  transition:background .12s ease, border-color .12s ease;
}
.rc-thread-summary:hover{
  background:color-mix(in srgb, var(--accent) 12%, var(--bg-input));
  border-color:color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.rc-thread-summary:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.rc-thread-faces{ display:inline-flex; flex:0 0 auto; }
.rc-thread-face{
  display:inline-flex; margin-left:-7px; border-radius:999px;
  border:2px solid var(--bg-elevated); overflow:hidden;
}
.rc-thread-face:first-child{ margin-left:0; }
.rc-thread-count{ flex:0 0 auto; font-size:12px; font-weight:600; color:var(--accent); white-space:nowrap; }
.rc-thread-last{
  flex:0 1 auto; min-width:0; font-size:11.5px; color:var(--text-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.rc-thread-go{ flex:0 0 auto; color:var(--accent); }

/* Pane 4 (support rail) shared shell — the canonical .inbox-detail card, but with the
   head/scroll/composer managing their own padding + scroll so a thread composer can pin
   to the bottom while the messages scroll. */
.rc-support{ padding:0; overflow:hidden; gap:0; }
.rc-support-inner{ display:flex; flex-direction:column; flex:1 1 auto; min-height:0; }
.rc-support-head{
  flex:0 0 auto; display:flex; align-items:center; gap:8px;
  padding:0.55rem 0.65rem; border-bottom:1px solid var(--border-subtle);
  background:var(--bg-elevated);
}
.rc-support-back{
  all:unset; display:inline-flex; align-items:center; justify-content:center;
  width:26px; height:26px; border-radius:7px; cursor:pointer; color:var(--text-soft);
}
.rc-support-back:hover{ background:var(--bg-input); color:var(--text-primary); }
.rc-support-back:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.rc-support-title{ flex:0 0 auto; font-size:13px; font-weight:700; color:var(--text-primary); }
.rc-support-sub{ flex:1 1 auto; min-width:0; font-size:12px; color:var(--text-muted); }
.rc-support-scroll{
  flex:1 1 auto; min-height:0; overflow-y:auto;
  display:flex; flex-direction:column; gap:0.55rem; padding:0.65rem 0.7rem;
}
.rc-thread-scroll{ gap:2px; padding:0.7rem 0.6rem; }
.rc-thread-divider{
  display:flex; align-items:center; gap:8px; margin:8px 0 4px; padding:0 2px;
  font-size:10.5px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase;
  color:var(--text-muted);
}
.rc-thread-divider::before, .rc-thread-divider::after{
  content:""; flex:1 1 auto; height:1px; background:var(--border-subtle);
}
.rc-thread-divider > span{ flex:0 0 auto; }
.rc-thread-compose{
  flex:0 0 auto; display:flex; flex-direction:column; gap:6px;
  padding:0.5rem 0.6rem; border-top:1px solid var(--border-subtle); background:var(--bg-elevated);
}
.rc-thread-compose-bar{ display:flex; justify-content:flex-end; }

/* Pane-4 channel details — members + pinned lists. */
.rc-detail-shead{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.rc-detail-count{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:16px; height:15px; padding:0 5px; margin-left:4px; border-radius:999px;
  background:color-mix(in srgb, var(--accent) 14%, transparent);
  font-size:10px; font-weight:700; color:var(--accent);
}
.rc-detail-memberlist{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:5px; }
.rc-detail-member{ display:flex; align-items:center; gap:8px; min-width:0; }
.rc-detail-member-name{
  flex:1 1 auto; min-width:0; font-size:13px; color:var(--text-primary);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.rc-detail-you{ color:var(--text-muted); font-weight:400; }
.rc-detail-empty{ font-size:12px; }
.rc-detail-pinlist{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:3px; }
.rc-detail-pin{ display:flex; align-items:center; gap:4px; min-width:0; }
.rc-detail-pin-jump{
  flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:1px;
  border:none; background:transparent; cursor:pointer; text-align:left;
  padding:4px 6px; border-radius:7px;
}
.rc-detail-pin-jump:hover{ background:color-mix(in srgb, var(--accent) 8%, transparent); }
.rc-detail-pin-text{
  font-size:12.5px; color:var(--text-soft);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.rc-detail-pin-jump:hover .rc-detail-pin-text{ color:var(--text-primary); }
.rc-detail-pin-meta{ font-size:11px; color:var(--text-muted); }

.rc-compose{ display:flex; flex-direction:column; gap:8px; }
.rc-compose-actions{ display:flex; justify-content:flex-end; }
/* Wave 8 — "… is typing" presence line (guest threads + rooms). Sits just above the
   composer; quiet, italic, reserves its own line so it never shifts layout on appear. */
.inbox-typing-note{ margin:0; font-size:12px; font-style:italic; color:var(--text-muted); line-height:1.3; min-height:1em; }

/* ── Slice 9b — Room membership editor ───────────────────────────────────── */
.rc-members-toggle{ flex:0 0 auto; }
.rc-members-edit-btn{
  all:unset; cursor:pointer; font-size:12px; font-weight:600; color:var(--accent);
  padding:3px 7px; border-radius:var(--radius-sm); line-height:1.4;
}
.rc-members-edit-btn:hover{ background:color-mix(in srgb, var(--accent) 12%, transparent); }
.rc-members-edit-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.rc-members-panel{
  display:flex; flex-direction:column; gap:8px; min-width:0;
  padding:10px 16px 12px; border-bottom:1px solid var(--border-subtle); background:var(--bg-elevated);
}
.rc-members-current{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.rc-members-empty{ font-size:12.5px; margin:2px 0; }
.rc-member-row{ width:100%; cursor:default; }
.rc-member-row-copy{
  flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:1px;
}
.rc-member-row-copy .nrm-member-name{ width:100%; }
.rc-member-open-contact{
  all:unset; cursor:pointer; color:var(--accent); font-size:11.5px; font-weight:600; line-height:1.35;
  border-radius:var(--radius-sm); padding:1px 3px; margin-left:-3px;
}
.rc-member-open-contact:hover:not(:disabled){
  background:color-mix(in srgb, var(--accent) 12%, transparent);
}
.rc-member-open-contact:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.rc-member-open-contact:disabled{ opacity:.55; cursor:wait; }
.rc-member-row-remove{
  all:unset; margin-left:auto; flex:0 0 auto; cursor:pointer; color:var(--text-muted);
  font-size:16px; line-height:1; padding:0 6px; border-radius:var(--radius-sm);
}
.rc-member-row-remove:hover:not(:disabled){ color:var(--state-danger, #dc2626); }
.rc-member-row-remove:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.rc-member-row-remove:disabled{ opacity:.35; cursor:not-allowed; }
.rc-members-add{ display:flex; flex-direction:column; gap:6px; min-width:0; }
.rc-members-search{ width:100%; }
.rc-members-actions{ display:flex; }

.wl2-main{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.wl2-line1{ display:flex; align-items:center; gap:6px; }
.wl2-name{
  flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:13.5px; color:var(--text-primary);
}
.wl2-row.is-unread .wl2-name{ font-weight:600; }
.wl2-pinned-dot{ flex:0 0 auto; display:inline-flex; color:var(--accent); }
.wl2-pinned-dot svg{ width:12px; height:12px; }
/* Private-thread lock — restricted access at a glance (var colors: light/dark parity). */
.wl2-lock{ flex:0 0 auto; display:inline-flex; color:var(--text-muted); }
.wl2-lock svg{ width:16px; height:16px; }
/* Broadcast thread marker (spec 2026-08-01-broadcast-threads-design.md): a quiet
   accent pill on line 1 — the row is a send-log to a condition-matched audience,
   not a person. Tokens only — light/dark by construction. */
.wl2-broadcast-pill{
  flex:0 0 auto;
  font-size:10px; font-weight:600; letter-spacing:.02em; line-height:1;
  padding:3px 7px; border-radius:999px;
  color:var(--accent);
  background:color-mix(in srgb, var(--accent) 12%, transparent);
  border:1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ── Broadcast condition builder + live audience preview (BroadcastConditionsEditor)
   and the broadcast thread view (BroadcastThreadView). Tokens only. Spec:
   docs/superpowers/specs/2026-08-01-broadcast-threads-design.md §7. ── */
.bce{ display:grid; grid-template-columns:minmax(0,1fr) 240px; gap:14px; }
@media (max-width: 760px){ .bce{ grid-template-columns:1fr; } }
.bce-modal{ width:min(880px, calc(100vw - 32px)); }
.bce-lines{ display:flex; flex-direction:column; gap:8px; min-width:0; }
.bce-hint{ margin:0; font-size:12px; color:var(--text-muted); }
.bce-row{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.bce-row .bce-field{ flex:0 1 220px; min-width:150px; }
.bce-row .bce-value{ flex:0 1 180px; min-width:120px; }
.bce-num{ width:64px; }
.bce-inline{ display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--text-muted); }
.bce-static{ font-size:13px; color:var(--text-muted); }
/* and/or joiner chips between condition lines — the AND/OR semantics must be
   readable in the layout itself, not only implied by the group border
   (2026-08-06: both lines in one "any of these" group read as a plain list,
   so the OR swallowed the filter). Neutral chip = and; accent chip = or. */
.bce-join{
  align-self:flex-start;
  font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.08em;
  padding:1px 8px; border-radius:999px;
  color:var(--text-muted);
  border:1px solid var(--border-subtle);
  background:var(--bg-elevated);
}
.bce-join-or{
  color:var(--accent);
  border-color:color-mix(in srgb, var(--accent) 40%, transparent);
  background:color-mix(in srgb, var(--accent) 8%, transparent);
}
/* Live plain-words restatement of the whole audience, from describeConditions. */
.bce-summary{
  margin:2px 0 0; padding-top:8px;
  border-top:1px solid var(--border-subtle);
  font-size:12px; line-height:1.5; color:var(--text-muted);
}
.bce-summary strong{ color:var(--text-primary); font-weight:600; }
.bce-group{
  display:flex; flex-direction:column; gap:8px;
  padding:10px; border-radius:12px;
  border:1px dashed color-mix(in srgb, var(--accent) 35%, transparent);
  background:color-mix(in srgb, var(--accent) 5%, transparent);
}
.bce-group-head{
  display:flex; align-items:center; justify-content:space-between;
  font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.04em;
  color:var(--accent);
}
.bce-minor{
  align-self:flex-start;
  font-size:12px; font-weight:600;
  padding:4px 8px; border-radius:8px;
  color:var(--text-muted); background:transparent;
  border:1px solid var(--border-subtle); cursor:pointer;
}
.bce-minor:hover{ color:var(--accent); border-color:color-mix(in srgb, var(--accent) 40%, transparent); }
.bce-preview{
  border:1px solid var(--border-subtle); border-radius:12px;
  padding:10px 12px; background:var(--bg-elevated);
  max-height:320px; overflow-y:auto;
}
.bce-preview-count{ margin:0 0 8px; font-size:13px; }
.bce-preview-note{ margin:0; font-size:12px; color:var(--text-muted); }
.bce-preview-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:4px; }
.bce-preview-list li{ display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:13px; }
.bce-preview-name{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bce-preview-channels{ display:inline-flex; gap:4px; flex:0 0 auto; }
.bce-dot{ font-size:11px; opacity:.25; }
.bce-dot.is-on{ opacity:1; color:var(--accent); }

.btv{ display:flex; flex-direction:column; min-height:0; flex:1 1 auto; }
.btv-head{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 16px; border-bottom:1px solid var(--border-subtle);
}
.btv-head h2{ margin:0; font-size:15px; }
.btv-head-sub{ margin:0; font-size:12px; color:var(--text-muted); }
.btv-timeline{ flex:1 1 auto; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:14px; }
.btv-entry{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.btv-bubble{
  max-width:min(90%, 720px);
  padding:10px 14px; border-radius:16px 16px 4px 16px;
  background:color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
  border:1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere;
}
.btv-subject{ font-weight:600; margin-bottom:4px; }
.btv-summary{
  font-size:12px; color:var(--text-muted); cursor:pointer;
  background:transparent; border:none; padding:0; text-align:right;
}
.btv-summary:hover{ color:var(--accent); }
.btv-deliveries{
  align-self:stretch; margin-top:4px;
  border:1px solid var(--border-subtle); border-radius:10px;
  background:var(--bg-elevated); padding:8px 10px;
  display:flex; flex-direction:column; gap:3px; font-size:12px;
}
.btv-delivery{ display:flex; align-items:center; gap:8px; justify-content:space-between; }
.btv-delivery a{ color:inherit; text-decoration:none; }
.btv-delivery a:hover{ color:var(--accent); text-decoration:underline; }
.btv-delivery .is-skipped{ color:var(--text-muted); }
.btv-delivery .is-failed{ color:var(--danger, #dc2626); }
.btv-compose{
  border-top:1px solid var(--border-subtle); padding:12px 16px;
  display:flex; flex-direction:column; gap:8px;
}
.btv-compose-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.btv-audience-strip{ font-size:12px; color:var(--text-muted); }
.btv-audience-strip.is-warn{ color:var(--state-warning, #b45309); font-weight:600; }
.btv-chips{ display:flex; gap:6px; flex-wrap:wrap; }
.btv-chip{
  font-size:11px; padding:3px 8px; border-radius:999px; cursor:pointer;
  border:1px solid var(--border-subtle); background:transparent; color:var(--text-muted);
}
.btv-chip:hover{ color:var(--accent); border-color:color-mix(in srgb, var(--accent) 40%, transparent); }
.btv-textarea{ width:100%; min-height:88px; resize:vertical; }
.btv-empty{ margin:auto; text-align:center; color:var(--text-muted); font-size:13px; max-width:420px; }
.btv-confirm-list{
  max-height:240px; overflow-y:auto; border:1px solid var(--border-subtle);
  border-radius:10px; padding:8px 10px; display:flex; flex-direction:column; gap:3px; font-size:13px;
}
.btv-confirm-list .is-skipped{ color:var(--text-muted); text-decoration:line-through; }
.wl2-time{ flex:0 0 auto; margin-left:auto; font-size:11.5px; color:var(--text-muted); }
.wl2-row.is-unread .wl2-time{ color:var(--accent); }
.wl2-line2{ display:flex; align-items:center; gap:8px; min-height:17px; }
.contact-type-marker{
  --contact-type-color:#64748b;
  flex:0 1 auto; min-width:0; max-width:132px; height:17px;
  display:inline-flex; align-items:center; gap:4px;
  padding:0 6px; border-radius:999px;
  border:1px solid color-mix(in srgb, var(--contact-type-color) 25%, transparent);
  background:color-mix(in srgb, var(--contact-type-color) 11%, transparent);
  color:color-mix(in srgb, var(--contact-type-color) 76%, var(--text-primary));
  font-size:10.5px; line-height:15px; font-weight:600; white-space:nowrap;
}
.contact-type-marker.is-quiet{
  padding:0 1px; border-color:transparent; background:transparent;
  color:var(--text-muted);
  font-weight:500;
}
.contact-type-marker-dot{
  width:5px; height:5px; border-radius:50%; flex:0 0 auto;
  background:var(--contact-type-color);
}
.contact-type-marker-label{
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.tag-requirement-notice{
  display:flex; align-items:flex-start; gap:7px;
  width:100%; min-width:0; padding:8px 10px;
  border:1px solid color-mix(in srgb, var(--state-warning) 32%, var(--border-subtle));
  border-radius:9px;
  background:color-mix(in srgb, var(--state-warning) 10%, transparent);
  color:color-mix(in srgb, var(--state-warning) 78%, var(--text-primary));
  font-size:11.5px; line-height:1.35;
}
.tag-requirement-notice svg{ flex:0 0 16px; margin-top:1px; }
.property-tag-recommendation {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  border-radius: 9px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}
.property-tag-recommendation svg { flex: 0 0 15px; color: var(--accent); }
.property-details-tags{
  display:flex; flex-direction:column; gap:9px;
  padding:14px 16px; margin-bottom:14px;
  border:1px solid var(--border-subtle); border-radius:12px;
  background:var(--bg-elevated);
}
.property-details-tags-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.property-details-tags-head > div{ display:flex; flex-direction:column; min-width:0; gap:2px; }
.property-details-tags-head strong{ font-size:13px; color:var(--text-primary); }
.property-details-tags-head span{ font-size:11.5px; color:var(--text-muted); }
.property-details-tags-error{ font-size:11.5px; color:var(--state-danger); }
.task-tag-requirement-field{
  display:grid; grid-template-columns:auto minmax(0, 1fr); align-items:center; gap:6px 8px;
  min-width:220px;
}
.task-tag-requirement-label{ font-size:11px; font-weight:650; color:var(--text-muted); }
.task-tag-requirement-field .tag-requirement-notice{ grid-column:1 / -1; padding:6px 8px; }
.task-tag-requirement-error{ grid-column:1 / -1; font-size:11px; color:var(--state-danger); }
.wl2-line1 .contact-type-marker{
  max-width:min(104px, 34%);
}
.wl2-preview{
  flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:12.5px; color:var(--text-soft);
}
/* Live "<name> is typing…" replaces the preview while a User types (typing bus). */
.wl2-typing{ color:var(--accent); font-style:italic; }
.wl2-prefix{ color:var(--text-muted); }
/* Slice 9c — room rows surface their member count before the preview. */
.wl2-room-count{
  flex:0 0 auto; display:inline-flex; align-items:center; gap:8px;
  font-size:11.5px; font-weight:600; color:var(--text-muted);
}
.wl2-room-count::after{ content:""; width:3px; height:3px; border-radius:50%; background:currentColor; opacity:.55; }

.wl2-sig{ flex:0 0 auto; font-size:11px; padding:1px 8px; border-radius:7px; font-weight:500; }
.wl2-sig-waiting{ background:color-mix(in srgb, var(--state-warning) 16%, transparent); color:var(--state-warning); }
.wl2-sig-portal{
  background:var(--state-warning); color:#18120a; font-weight:700;
  box-shadow:0 0 0 1px color-mix(in srgb, var(--state-warning) 38%, transparent);
}
/* The last message FAILED to send (missed-call auto-text bounced, SMS undelivered) —
   the loudest pill in the chain: a dead outbound is invisible everywhere else in the
   list. Theme tokens only (light/dark parity). */
.wl2-sig-failed{ background:color-mix(in srgb, var(--state-error) 16%, transparent); color:var(--state-error); }
.wl2-sig-draft{ background:color-mix(in srgb, var(--accent) 14%, transparent); color:var(--accent); }
.wl2-sig-snoozed{ color:var(--text-muted); }
/* Unread @-mention row treatment (Hakim 2026-07-02: "a special way of highlighting that
   they were mentioned so they dont miss it"). Three signals, all clearing together when
   the thread opens (read_at set → hasMention drops): a solid accent "Mentioned you" pill,
   a soft accent wash over the whole row (skipped while the row is active — the active
   fill already owns that state), and an @ badge on the avatar (wl2-mention-badge below).
   The row is ALSO forced unread (useWorkspaceListData), so the rail/bold/dot come free.
   Tokens only — light/dark by construction; #fff on the accent passes in both themes. */
.wl2-sig-mention{ background:var(--accent); color:#fff; font-weight:600; }
.wl2-row.is-mention:not(.is-active){
  background:color-mix(in srgb, var(--accent) 7%, transparent);
  border-color:color-mix(in srgb, var(--accent) 16%, transparent);
}
.wl2-mention-badge{
  position:absolute; top:-3px; right:-3px;
  width:17px; height:17px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; line-height:1;
  color:#fff; background:var(--accent);
  border:1.5px solid var(--bg-elevated);
}

/* Hover action cluster — floats OVER the right edge (absolute, out of flow) so
   revealing it never reflows line 2. The old display:none→inline-flex toggle
   inside the flex row (plus hiding the sig) re-truncated the preview on every
   hover — that was the "rows wobble and give me a headache" bug. Now: the pill
   fades in above the row content, zero layout shift. */
.wl2-actions{
  position:absolute; top:50%; right:8px; transform:translateY(-50%);
  display:inline-flex; align-items:center; gap:2px;
  padding:3px; border-radius:10px;
  background:var(--bg-elevated); border:1px solid var(--border-subtle);
  box-shadow:0 2px 8px -2px color-mix(in srgb, #000 22%, transparent);
  opacity:0; pointer-events:none; transition:opacity .12s ease;
}
/* Reveal on hover, on keyboard focus of a NON-active row, or while the menu is
   open. The :not(.is-active) is deliberate — without it, clicking a thread leaves
   the <a> focused, so :focus-within kept the pill stuck on the SELECTED row. The
   selected thread now only shows the pill on hover or with its menu open. */
.wl2-row:hover .wl2-actions,
.wl2-row:focus-within:not(.is-active) .wl2-actions,
.workspace-list-item.is-menu-open .wl2-actions{ opacity:1; pointer-events:auto; }
/* Touch — tap-to-reveal, NOT always-visible ghosts. WebKit applies sticky :hover to a
   tapped row, so selecting a thread reveals its pin/⋯ via the .wl2-row:hover rule above,
   and tapping elsewhere clears it (the proven .inbox-msg-tools pattern, 2026-07-17).
   The old always-on 60% fallback stacked the pin BUTTON on the pinned-state pin and
   parked the chip over every row's timestamp on iPad (Hakim 2026-07-20). The phone tier
   (≤640px) hides .wl2-actions entirely further down; this path covers tablets. */
@media (hover: none) {
  .workspace-list-item.is-menu-open .wl2-actions{ opacity:1; pointer-events:auto; }
  /* Bigger effective touch targets while revealed (desktop keeps its 26px density). */
  .wl2-act{ width:34px; height:34px; }
}
/* Inside the floating pill the buttons drop their own chrome — the pill is the chrome. */
.wl2-actions .wl2-act{ border-color:transparent; background:transparent; }
.wl2-actions .wl2-act:hover{ background:color-mix(in srgb, var(--accent) 12%, transparent); }
.wl2-actions .wl2-act.is-on{ border-color:transparent; }
.wl2-act{
  width:26px; height:26px; border-radius:7px; padding:0; cursor:pointer;
  border:1px solid var(--border-subtle); background:var(--bg-elevated); color:var(--text-soft);
  display:flex; align-items:center; justify-content:center;
}
.wl2-act:hover{ color:var(--text-primary); background:color-mix(in srgb, var(--accent) 10%, transparent); }
.wl2-act:disabled{ opacity:.5; cursor:default; }
.wl2-act.is-on{ color:var(--accent); border-color:color-mix(in srgb, var(--accent) 35%, transparent); }
/* ≥16px icon floor (hard rule — feedback_icons_too_small). */
.wl2-act svg{ width:16px; height:16px; }
.wl2-dots{ font-size:15px; line-height:1; }

/* Inbox row ⋯ menu — divider + the "Remind me later" inline preset expander
   (mirrors the rename inline-input pattern; no fiddly nested flyout). */
.workspace-thread-menu-sep{ height:1px; margin:4px 6px; background:var(--border-subtle); }
.workspace-thread-menu-remind{ display:flex; flex-direction:column; gap:6px; padding:6px 8px; }
.workspace-thread-menu-remind-label{ font-size:11px; color:var(--text-muted); font-weight:500; }
.workspace-thread-menu-remind-opts{ display:flex; gap:5px; }
/* Two-class scope so these beat the base `.workspace-thread-menu button` grid
   reset (the same trick the rename Save/Cancel row uses); the explicit inline-flex
   kills the 18px/1fr icon grid so each chip is a plain centred pill, and the
   restated background overrides the base `background:transparent`. */
.workspace-thread-menu-remind-opts .workspace-thread-menu-remind-opt{
  display:inline-flex; align-items:center; justify-content:center;
  flex:1; padding:5px 6px; border-radius:7px; cursor:pointer;
  border:1px solid var(--border-subtle); background:var(--bg-input); color:var(--text-soft);
  font-size:11.5px; font-weight:600; white-space:nowrap;
}
.workspace-thread-menu-remind-opts .workspace-thread-menu-remind-opt:hover{
  color:var(--accent); border-color:color-mix(in srgb, var(--accent) 35%, transparent);
  background:color-mix(in srgb, var(--accent) 10%, var(--bg-input));
}
.workspace-thread-menu-remind-opts .workspace-thread-menu-remind-opt:disabled{ opacity:.5; cursor:default; }

/* ───────────────────────────────────────────────────────────────────────────
   Team-room redesign PR-1 — composer toolbar, ClickUp-style slash grid, and a
   real floating hover-action bar (the icons were 13px specks). Token-based;
   light/dark automatic; collapses on small screens.
   ─────────────────────────────────────────────────────────────────────────── */

/* Per-message hover actions — a floating Slack-style bar, not a row of dots. */
.rc-msg-tools{
  display:flex; align-items:center; gap:2px;
  padding:3px; border-radius:9px;
  background:var(--bg-elevated, var(--bg-input));
  border:1px solid var(--border-subtle);
  box-shadow:0 4px 14px rgba(0,0,0,.14);
}
.rc-msg-tool{
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0;
  border:none; border-radius:7px; background:transparent;
  color:var(--text-soft); cursor:pointer;
  transition:background .12s ease, color .12s ease;
}
.rc-msg-tool svg{ width:16px; height:16px; }
.rc-msg-tool:hover{ background:color-mix(in srgb, var(--accent) 12%, transparent); color:var(--text-primary); }
.rc-msg-tool.is-active{ color:var(--accent); }
.rc-msg-tool-danger:hover{ background:color-mix(in srgb, var(--state-danger, #dc2626) 14%, transparent); color:var(--state-danger, #dc2626); }
.rc-react-pop .rc-react-opt{ font-size:18px; line-height:1; }

/* Composer bottom bar — formatting + insert on the left, send on the right. */
.rc-compose-bar{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-top:8px; min-width:0;
}
.rc-compose-toolbar{ display:flex; align-items:center; gap:2px; flex-wrap:wrap; min-width:0; }
.rc-ct-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0;
  border:none; border-radius:7px; background:transparent;
  color:var(--text-soft); cursor:pointer;
  transition:background .12s ease, color .12s ease;
}
.rc-ct-btn:hover{ background:color-mix(in srgb, var(--accent) 12%, transparent); color:var(--text-primary); }
.rc-ct-sep{ width:1px; align-self:stretch; margin:4px; background:var(--border-subtle); }
.rc-emoji-wrap{ position:relative; display:inline-flex; }
.rc-emoji-pop{
  position:absolute; bottom:calc(100% + 6px); left:0; z-index:40;
  display:grid; grid-template-columns:repeat(6, 1fr); gap:2px;
  padding:6px; border-radius:10px;
  background:var(--bg-elevated, var(--bg-input));
  border:1px solid var(--border-subtle);
  box-shadow:0 8px 24px rgba(0,0,0,.18);
}
.rc-emoji-opt{
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; padding:0; font-size:18px; line-height:1;
  border:none; border-radius:7px; background:transparent; cursor:pointer;
}
.rc-emoji-opt:hover{ background:color-mix(in srgb, var(--accent) 14%, transparent); }
.rc-send-btn{ flex:0 0 auto; }

/* ─── Team-chat Slack-grade additions ────────────────────────────────────── */

/* Feature 5: date separators — "Today" / "Yesterday" / "24 Jun 2026" pill */
.rc-date-separator{
  display:flex; align-items:center; gap:8px;
  margin:10px 0 4px; padding:0 2px;
  color:var(--text-muted); font-size:11.5px; font-weight:600; letter-spacing:0.02em;
  user-select:none;
}
.rc-date-separator::before,
.rc-date-separator::after{
  content:""; flex:1; height:1px; background:var(--border-subtle);
}
.rc-date-separator > span{
  flex:0 0 auto; padding:2px 8px; border-radius:20px;
  background:var(--surface-muted); border:1px solid var(--border-subtle);
}

/* Feature 1: attachment thumbnails + file chips in bubbles */
.rc-msg-attachments{ display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.rc-msg-attach-img-wrap{ display:inline-block; border-radius:8px; overflow:hidden; max-width:240px; }
.rc-msg-attach-img{ display:block; max-width:240px; max-height:200px; object-fit:cover; border-radius:8px; border:1px solid var(--border-subtle); }
.rc-msg-attach-file{
  display:inline-flex; align-items:center; gap:5px;
  padding:5px 9px; border-radius:7px;
  border:1px solid var(--border-subtle); background:var(--surface-muted);
  color:var(--text-soft); font-size:12px; text-decoration:none;
  transition:background 0.12s, border-color 0.12s;
}
.rc-msg-attach-file:hover{ background:var(--bg-input); border-color:var(--border-strong); color:var(--text-primary); }
.rc-msg-attach-file svg{ flex:0 0 auto; color:var(--accent); }
.rc-msg-attach-file span{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:160px; }

/* Feature 3: post card */
.rc-post-card{
  margin-top:2px; border-radius:10px;
  border:1px solid var(--border-subtle); background:var(--bg-elevated);
  padding:10px 12px; display:flex; flex-direction:column; gap:6px;
  box-shadow:0 1px 4px 0 color-mix(in srgb,var(--text-primary) 6%,transparent);
}
.rc-post-title{
  font-size:14px; font-weight:700; color:var(--text-primary);
  line-height:1.3; margin-bottom:2px;
}
.rc-post-body{ font-size:13px; color:var(--text-primary); }

/* Feature 3: post title input above the composer */
.rc-post-title-input{
  width:100%; box-sizing:border-box;
  padding:6px 10px; border-radius:7px;
  border:1px solid var(--border-subtle); background:var(--bg-input);
  color:var(--text-primary); font-size:13.5px; font-weight:600;
  font-family:inherit; outline:none;
  transition:border-color 0.15s;
}
.rc-post-title-input:focus{ border-color:var(--accent); }
.rc-post-title-input::placeholder{ color:var(--text-muted); font-weight:400; }

/* Feature 3: Message / Post mode toggle */
.rc-mode-toggle{
  display:inline-flex; border-radius:7px;
  border:1px solid var(--border-subtle); overflow:hidden;
  background:var(--surface-muted); flex:0 0 auto;
}
.rc-mode-btn{
  padding:3px 10px; font-size:11.5px; font-weight:500;
  color:var(--text-muted); background:transparent; border:none;
  cursor:pointer; transition:background 0.12s, color 0.12s;
  line-height:1.4; white-space:nowrap;
}
.rc-mode-btn:hover{ background:var(--bg-input); color:var(--text-soft); }
.rc-mode-btn.is-active{
  background:var(--accent); color:#fff; font-weight:600;
}
@media (max-width:480px){
  .rc-mode-toggle{ display:none; } /* collapse on very small screens; enter-to-send is default */
}

/* Thread pane Slack polish — hover affordances, spacing */
.rc-thread-scroll .rc-msg:hover{ background:color-mix(in srgb, var(--text-primary) 5%, transparent); }
.rc-support-head-count{
  font-size:11px; color:var(--text-muted);
  border-left:1px solid var(--border-subtle); margin-left:6px; padding-left:6px;
}

/* Slash menu — grouped two-column icon-tile grid (layout only; the panel's
   surface/border/shadow come from the base .message-composer-slash-menu rule). */
.inbox-slash-menu{
  display:block; width:auto; min-width:360px; max-width:460px;
  padding:8px; max-height:340px; overflow-y:auto;
}
.inbox-slash-group{ margin-bottom:6px; }
.inbox-slash-group:last-child{ margin-bottom:0; }
.inbox-slash-group-label{
  padding:4px 8px 2px; font-size:11px; font-weight:600; letter-spacing:.04em;
  text-transform:uppercase; color:var(--text-muted);
}
.inbox-slash-grid{ display:grid; grid-template-columns:1fr 1fr; gap:2px; }
.inbox-slash-menu .message-composer-slash-item{
  display:flex; align-items:center; gap:9px;
  width:100%; padding:7px 8px; text-align:left;
  border:none; border-radius:8px; background:transparent; cursor:pointer;
  color:var(--text-primary);
}
.inbox-slash-menu .message-composer-slash-item:hover,
.inbox-slash-menu .message-composer-slash-item.is-active{ background:color-mix(in srgb, var(--accent) 12%, transparent); }
.inbox-slash-item-icon{
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
  width:28px; height:28px; border-radius:7px;
  background:color-mix(in srgb, var(--text-soft) 12%, transparent);
  color:var(--text-soft);
}
.inbox-slash-menu .message-composer-slash-item.is-active .inbox-slash-item-icon{
  background:color-mix(in srgb, var(--accent) 18%, transparent); color:var(--accent);
}
.inbox-slash-item-text{ display:flex; flex-direction:column; min-width:0; }
.inbox-slash-item-label{ font-size:13px; color:var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.inbox-slash-item-hint{ font-size:11px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

@media (max-width:560px){
  .inbox-slash-menu{ min-width:0; width:min(92vw, 360px); max-width:92vw; }
  .inbox-slash-grid{ grid-template-columns:1fr; }
}


/* ───────────────────────────────────────────────────────────────────────────
   Users & Permissions admin UI  (.uap-*)
   Light + dark automatic via CSS custom properties.
   Small-screen: table collapses to stacked cards at <768px, min-width:0 on flex.
   ─────────────────────────────────────────────────────────────────────────── */

.uap-page {
  display: grid;
  gap: 0.5rem;
  min-height: 0;
}

/* Tabs */
.uap-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 0.1rem;
}
.uap-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.uap-tab:hover { color: var(--text-primary); }
.uap-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Section toolbar (heading + action button) */
.uap-section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.uap-section-copy {
  margin: 0.18rem 0 0;
  font-size: 0.75rem;
}

/* Header right */
.uap-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── User table ── */
.uap-table {
  display: grid;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--table-surface);
}
.uap-table-head {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) auto auto;
  gap: 0;
  padding: 0.4rem 0.6rem;
  background: color-mix(in srgb, var(--bg-deep) 70%, var(--table-surface));
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.uap-table-head > div { padding: 0 0.4rem; }
.uap-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr) auto auto;
  gap: 0;
  align-items: center;
  padding: 0.42rem 0.6rem;
  border-top: 1px solid var(--border-subtle);
  min-width: 0;
}
.uap-table-row:first-child { border-top: none; }
.uap-table-row > div { padding: 0 0.4rem; min-width: 0; }

/* User cell */
.uap-user-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.uap-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}
.uap-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0.05rem;
}
.uap-user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uap-user-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.uap-row-error {
  font-size: 0.7rem;
  color: color-mix(in srgb, var(--state-danger, #dc2626) 85%, var(--text-primary));
}

/* Template select inline */
.uap-template-select {
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
  min-width: 120px;
  max-width: 100%;
}

/* Status pills */
.uap-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--border-subtle) 40%, var(--table-surface));
  color: var(--text-soft);
}
.uap-status-pill--active {
  color: color-mix(in srgb, var(--state-success, #16a34a) 80%, var(--text-primary));
  background: color-mix(in srgb, var(--state-success, #16a34a) 12%, var(--table-surface));
  border-color: color-mix(in srgb, var(--state-success, #16a34a) 30%, var(--border-subtle));
}
.uap-status-pill--invited {
  color: color-mix(in srgb, #f59e0b 80%, var(--text-primary));
  background: color-mix(in srgb, #f59e0b 12%, var(--table-surface));
  border-color: color-mix(in srgb, #f59e0b 30%, var(--border-subtle));
}
.uap-status-pill--disabled {
  color: var(--text-muted);
  opacity: 0.7;
}

/* Row actions */
.uap-row-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.uap-self-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0 0.35rem;
}

/* ── Template cards ── */
.uap-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem;
}
.uap-template-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm, 10px);
  background: var(--table-surface);
  padding: 0.65rem 0.75rem;
  display: grid;
  gap: 0.4rem;
}
.uap-group-card {
  min-height: 148px;
}
.uap-group-members {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0.12rem 0;
}
.uap-group-avatar {
  width: 28px;
  height: 28px;
  margin-left: -6px;
  border-radius: 50%;
  border: 2px solid var(--table-surface);
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elevated));
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 750;
}
.uap-group-avatar:first-child { margin-left: 0; }
.uap-group-avatar--more {
  background: color-mix(in srgb, var(--border-subtle) 70%, var(--bg-elevated));
  color: var(--text-muted);
}
.uap-group-empty {
  display: grid;
  gap: 0.2rem;
  place-items: center;
  text-align: center;
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-sm, 10px);
  padding: 1.35rem 1rem;
  color: var(--text-primary);
}
.uap-group-empty span {
  color: var(--text-muted);
  font-size: 0.76rem;
}
.uap-template-card-head {
  display: grid;
  gap: 0.2rem;
}
.uap-template-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.uap-template-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-primary);
}
.uap-template-desc {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.uap-template-badges {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.uap-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--border-subtle) 40%, transparent);
  color: var(--text-soft);
}
.uap-badge--system {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border-subtle));
  color: var(--accent);
}
.uap-badge--admin {
  background: color-mix(in srgb, #f59e0b 10%, transparent);
  border-color: color-mix(in srgb, #f59e0b 30%, var(--border-subtle));
  color: color-mix(in srgb, #f59e0b 85%, var(--text-primary));
}
.uap-badge--custom {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  border-color: var(--border-subtle);
  color: var(--text-muted);
}
.uap-area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
}
.uap-area-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.38rem;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--border-subtle) 55%, var(--bg-elevated));
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
}
.uap-template-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border-subtle);
}
.uap-member-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.uap-readonly-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Modal ── */
.uap-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
[data-theme="light"] .uap-modal-backdrop { background: rgba(15, 23, 42, 0.35); }
.uap-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: min(480px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  display: grid;
  gap: 0;
}
[data-theme="light"] .uap-modal { box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18); }
.uap-modal--wide { width: min(600px, 100%); }
.uap-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}
.uap-modal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.uap-modal-close {
  padding: 0.25rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1;
  border-radius: 7px;
}
.uap-modal-form {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem 1rem;
}

/* Form field */
.uap-field {
  display: grid;
  gap: 0.22rem;
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 500;
}
.uap-field input,
.uap-field select,
.uap-field textarea {
  width: 100%;
  font-size: 0.84rem;
}
.uap-field textarea {
  resize: vertical;
  min-height: 72px;
}
.uap-group-member-list {
  display: grid;
  gap: 0.28rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.2rem 0.05rem;
}
.uap-group-member-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.42rem 0.5rem;
  cursor: pointer;
}
.uap-group-member-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
}
.uap-group-member-option input {
  width: 14px;
  height: 14px;
  margin: 0;
}
.uap-avatar--small {
  width: 28px;
  height: 28px;
  font-size: 0.62rem;
}
.uap-group-member-copy {
  min-width: 0;
  display: grid;
  gap: 0.05rem;
}
.uap-group-member-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--text-primary);
}
.uap-group-member-copy small {
  color: var(--text-muted);
  font-size: 0.67rem;
}
.uap-optional {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}
.uap-template-hint {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Area checklist */
.uap-areas-fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 0.55rem 0.7rem 0.6rem;
}
.uap-areas-legend {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-soft);
  padding: 0 0.25rem;
}
.uap-areas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.3rem 0.5rem;
  margin-top: 0.35rem;
}
.uap-area-check {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
}
.uap-area-check input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  border-radius: 4px;
  padding: 0;
  width: 14px;
  height: 14px;
}
.uap-area-label { min-width: 0; }
.uap-area-admin-hint {
  font-size: 0.66rem;
  font-weight: 700;
  color: color-mix(in srgb, #f59e0b 80%, var(--text-muted));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 0.2rem;
}
/* Soft, non-shouty hint for the Portfolio tab count ("all tabs" / "3 tabs"). */
.uap-area-subhint {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.2rem;
}
/* Nested Portfolio tab picker inside the template editor — reads as a child of
   the "Portfolio" area toggle via a thicker left accent + top gap. Inherits the
   fieldset border/padding from .uap-areas-fieldset; tokens keep light/dark parity. */
.uap-subtabs-fieldset {
  margin-top: 0.5rem;
  border-left: 2px solid var(--border-strong, var(--border-subtle));
}
.uap-subtabs-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin-top: 0.35rem;
}
.uap-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  cursor: pointer;
}
.uap-radio input[type="radio"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  padding: 0;
}
.uap-subtabs-grid {
  margin-top: 0.45rem;
  /* Per-tab rows carry a Full/View radio pair — auto-fill at 160px collides
     the radios into the neighbouring column. Two wider columns instead. */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.35rem 1.4rem;
}
/* One row per tab in "Specific tabs" mode: checkbox left, Full/View level
   radios right. Same tokens as the surrounding .uap-* family (theme-safe). */
.uap-subtab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-width: 0;
}
.uap-subtab-level {
  margin-top: 0;
  flex: none;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Inline errors */
.uap-inline-error {
  margin: 0;
  font-size: 0.78rem;
  color: color-mix(in srgb, var(--state-danger, #dc2626) 85%, var(--text-primary));
  background: color-mix(in srgb, var(--state-danger, #dc2626) 8%, var(--bg-elevated));
  border: 1px solid color-mix(in srgb, var(--state-danger, #dc2626) 25%, var(--border-subtle));
  border-radius: 7px;
  padding: 0.38rem 0.6rem;
}

/* Modal action rows */
.uap-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  padding-top: 0.25rem;
}
.uap-modal-actions--spread {
  justify-content: space-between;
}
.uap-modal-actions-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Invite link panel */
.uap-invite-link-panel {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem 1rem;
}
.uap-invite-link-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.uap-invite-link-row {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}
.uap-invite-link-input {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
}

/* Skeletons */
.uap-skeleton-row {
  pointer-events: none;
}
.uap-skeleton-cell {
  height: 14px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--border-subtle) 70%, transparent);
  animation: uap-shimmer 1.4s infinite linear;
  background-size: 200% 100%;
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, var(--border-subtle) 70%, transparent) 25%,
    color-mix(in srgb, var(--border-subtle) 45%, var(--bg-elevated)) 50%,
    color-mix(in srgb, var(--border-subtle) 70%, transparent) 75%
  );
}
.uap-skeleton-card {
  pointer-events: none;
  min-height: 90px;
}
.uap-skeleton-title {
  width: 55%;
  height: 14px;
  margin-bottom: 0.5rem;
}
.uap-skeleton-desc {
  width: 80%;
  height: 10px;
}
@keyframes uap-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Small screen collapse (<768px) ── */
@media (max-width: 767px) {
  /* Table becomes stacked cards */
  .uap-table-head { display: none; }
  .uap-table-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-sm, 10px);
    border: 1px solid var(--border-subtle) !important;
    margin-bottom: 0.35rem;
  }
  .uap-table {
    border: none;
    background: transparent;
  }
  .uap-row-actions { flex-wrap: wrap; }
  .uap-template-grid { grid-template-columns: 1fr; }
  .uap-areas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .uap-modal-form { padding: 0.7rem 0.85rem 0.85rem; }
  .uap-modal-head { padding: 0.8rem 0.85rem 0.5rem; }
  .uap-modal-actions--spread { flex-direction: column-reverse; align-items: stretch; }
  .uap-modal-actions-right { flex-direction: row-reverse; }
}

/* ============================================================
   Inbox email card · Details merge/related/quick-view · New-contact
   form · VersionWatcher — 2026-06-24 (feat/inbox-email-details)
   ============================================================ */

/* ── EmailMessageCard ───────────────────────────────────────────────────── */
.inbox-emailcard {
  /* Borderless column wrapper. The bordered box is now .inbox-emailcard-doc; the
     meta strip + the standard turn head sit ABOVE it, OUTSIDE the border, so an email
     reads like every other message type (Hakim 2026-06-25). */
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  gap: 4px;
}

/* Email-only meta — recipient toggle (left) + timestamp & actions (right). Lives
   ABOVE the bordered document, the way the avatar/header of every other message type
   sits above its bubble. */
.inbox-emailcard-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 1px;
  min-width: 0;
}
.inbox-emailcard-recip-block {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* The bordered "email container" = subject + body only (Hakim 2026-06-25: the whole
   section above the subject now lives outside this box). */
.inbox-emailcard-doc {
  min-width: 0;
  /* The email document is ALWAYS a light sheet, both themes — emails are authored
     against white (Front/Missive do the same). On the dark theme the old elevated
     surface bled through between the email's own white blocks as dark patches
     (Hakim 2026-07-02, the Perk booking email). Fixed colours, not tokens, on
     purpose: this sheet must not flip with the app theme. */
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.inbox-emailcard-doc .inbox-emailcard-subject {
  color: #111827;
}
.inbox-emailcard-doc .inbox-emailcard-plaintext {
  color: #374151;
}
.inbox-emailcard-doc .inbox-emailcard-quoted-toggle {
  border-color: #e5e7eb;
  color: #6b7280;
}
.inbox-emailcard-doc .inbox-emailcard-quoted-toggle:hover {
  background: #f3f4f6;
  color: #374151;
}
.inbox-emailcard-doc .inbox-emailcard-quoted-body {
  border-top-color: #e5e7eb;
}
.inbox-emailcard-doc .inbox-emailcard-expand-toggle {
  background: #ffffff;
  border-color: #e5e7eb;
}

/* Recipient summary toggle — inline button under sender name */
.inbox-emailcard-recip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
  max-width: 100%;
}
.inbox-emailcard-recip-toggle:hover { color: var(--text-soft); }
.inbox-emailcard-recip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-emailcard-chevron { transition: transform 160ms ease; flex-shrink: 0; }
.inbox-emailcard-chevron.is-open { transform: rotate(180deg); }

/* "Sent outside the app" marker — on an outbound email that was sent from the Gmail app / a
   phone and pulled into the thread by the sync (email_meta.capturedExternal). Subtle + muted so
   it clarifies provenance without competing with the message. Token-only → light/dark safe. */
.inbox-emailcard-external {
  flex-shrink: 0;
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: default;
}

/* Right side: timestamp + icon cluster, never wraps unless forced by screen */
.inbox-emailcard-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.inbox-emailcard-timestamp {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 2px;
}
/* Icon button cluster — groups the icon buttons together with tighter spacing */
.inbox-emailcard-icon-cluster {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Icon buttons: 32×32, clearly visible, tappable.
   🔴 `padding: 0` is LOAD-BEARING, not tidiness. The global `input, select, button`
   rule sets `padding: .58rem .7rem` (≈9px × 11px) and everything here is border-box,
   so without this reset a 32px box leaves 32 − 22.4 = 9.6px of content width and the
   18px glyph flex-shrinks into it — a THIRD of its stated size. On the phone tier
   (30px box) it was 7.6px. That is TestFlight #54 "icons too small in email", and
   the same trap already cost #539, #684 and #52. `flex: 0 0 auto` on the svg stops
   the shrink itself. Verify the svg's getBoundingClientRect, never the size prop. */
.inbox-emailcard-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 120ms, color 120ms;
}
.inbox-emailcard-icon-btn > svg { flex: 0 0 auto; }
.inbox-emailcard-icon-btn:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}
.inbox-emailcard-icon-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--ring) 60%, transparent);
  outline-offset: 1px;
}

.inbox-emailcard-menu-wrap { position: relative; }
.inbox-emailcard-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 120;
  min-width: 168px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--text-primary) 12%, transparent);
  padding: 4px;
  display: flex;
  flex-direction: column;
}
.inbox-emailcard-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-soft);
  border-radius: 5px;
  text-align: left;
  transition: background 100ms, color 100ms;
}
/* Same anti-squeeze rule as the action row: a 16px glyph in a flex row with a text
   label will shrink to fit if you let it. Never rely on the size prop alone. */
.inbox-emailcard-menu-item > svg { flex: 0 0 auto; }
.inbox-emailcard-menu-item:hover { background: color-mix(in srgb, var(--border-subtle) 55%, transparent); color: var(--text-primary); }
.inbox-emailcard-menu-item:focus-visible { outline: 2px solid color-mix(in srgb, var(--ring) 60%, transparent); outline-offset: -1px; }

/* Details accordion panel — sits between the header and the subject,
   pushes content DOWN, never overlays anything */
.inbox-emailcard-details-panel {
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-muted) 50%, transparent);
  padding: 6px 0;
}
.inbox-emailcard-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.inbox-emailcard-details-label {
  color: var(--text-muted);
  white-space: nowrap;
  padding: 3px 12px 3px 14px;
  vertical-align: top;
  font-weight: 500;
  width: 1%;
}
.inbox-emailcard-details-value { color: var(--text-soft); padding: 3px 14px 3px 0; word-break: break-all; }

.inbox-emailcard-subject {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 14px 10px;
  line-height: 1.3;
}
.inbox-emailcard-body { padding: 0 14px 14px; min-width: 0; }
/* #5 — clip a very long email to a comfortable height with a soft fade + a "Show full
   email" toggle, so one big message can't dominate the entire thread. Token-based fade
   works in light + dark (the mask only affects alpha, not colour). */
.inbox-emailcard-preview { position: relative; }
.inbox-emailcard-clip { position: relative; }
.inbox-emailcard-clip.is-collapsed {
  max-height: 360px;
  overflow: hidden;
}
.inbox-emailcard-clip.is-collapsed.has-overflow {
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
}
.inbox-emailcard-expand-toggle {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 4px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.inbox-emailcard-preview.is-expanded .inbox-emailcard-expand-toggle {
  position: static;
  margin-top: 8px;
}
.inbox-emailcard-expand-toggle:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.inbox-emailcard-expand-chev { transition: transform 120ms ease; }
.inbox-emailcard-expand-chev.is-open { transform: rotate(180deg); }
.inbox-emailcard-plaintext {
  font-size: 13px;
  color: var(--text-soft);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin: 0;
  line-height: 1.6;
}
.inbox-emailcard-quoted-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 1px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 1px;
  line-height: 1.4;
  transition: background 120ms, color 120ms;
}
.inbox-emailcard-quoted-toggle:hover { background: color-mix(in srgb, var(--border-subtle) 50%, transparent); color: var(--text-soft); }
.inbox-emailcard-quoted-toggle:focus-visible { outline: 2px solid color-mix(in srgb, var(--ring) 60%, transparent); outline-offset: 1px; }
.inbox-emailcard-quoted-dots { display: block; line-height: 1; }
.inbox-emailcard-quoted-body { margin-top: 8px; border-top: 1px solid var(--border-subtle); padding-top: 10px; }

/* Small screen adjustments */
@media (max-width: 767px) {
  .inbox-emailcard-body { padding: 0 12px 12px; }
  .inbox-emailcard-details-label { padding-left: 12px; }
  .inbox-emailcard-subject { padding: 0 12px 8px; font-size: 15px; }
  .inbox-emailcard-timestamp { font-size: 11px; }
  /* Was 30px — SMALLER than the desktop box on the tier with the fattest pointer.
     A phone gets the roomier box, not the meaner one (small screens are first-class). */
  .inbox-emailcard-icon-btn { width: 36px; height: 36px; }
}
/* Hide timestamp at very small widths — icon cluster stays */
@media (max-width: 479px) {
  .inbox-emailcard-timestamp { display: none; }
}
/* Touch: a finger needs a real target and a glyph it can actually see. Same treatment
   .aiops-wheel already gets — the box grows and the glyph grows with it, so the row
   doesn't turn into four hairlines in a wide gap. Four 40px boxes + gaps = 166px, and
   the timestamp is already hidden under 480px, so the recipient line still has room
   (it ellipsises — .inbox-emailcard-recip-block is flex:1 1 auto; min-width:0). */
@media (hover: none) {
  .inbox-emailcard-icon-btn { width: 40px; height: 40px; }
  .inbox-emailcard-icon-btn > svg { width: 20px; height: 20px; }
  .inbox-emailcard-icon-cluster { gap: 4px; }
  /* Menu rows were a 31px tap target with a 13px label — fine with a mouse, mean with
     a thumb. 44px is the standing minimum for a touch row in this app. */
  .inbox-emailcard-menu { min-width: 210px; }
  .inbox-emailcard-menu-item { min-height: 44px; padding: 8px 12px; font-size: 14px; }
  .inbox-emailcard-menu-item > svg { flex: 0 0 auto; }
}

/* ── Details: merge UI ──────────────────────────────────────────────────── */
.inbox-crm-merge-btn {
  /* Was a bare 0.72rem muted TEXT link — invisible as an action ("there is no
     merge option", Hakim 2026-07-02). Now a real secondary button. */
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  padding: 0.38rem 0.7rem;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.inbox-crm-merge-btn:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-elevated));
}
.inbox-crm-merge-panel {
  margin-top: 0.75rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}
.inbox-crm-merge-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-subtle);
}
.inbox-crm-merge-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
  padding: 0 2px;
}
.inbox-crm-merge-list { list-style: none; margin: 0; padding: 0; }
.inbox-crm-merge-candidate {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.12s;
  min-width: 0;
  color: inherit;
}
.inbox-crm-merge-candidate:last-child { border-bottom: none; }
.inbox-crm-merge-candidate:hover:not(:disabled) { background: color-mix(in srgb, var(--border-subtle) 55%, transparent); }
.inbox-crm-merge-candidate:disabled { opacity: 0.6; cursor: not-allowed; }
.inbox-crm-merge-candidate-name { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── ContactQuickView (pane 4) ──────────────────────────────────────────── */
.inbox-cqv-body { min-width: 0; }
.inbox-cqv-hero { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; min-width: 0; }
.inbox-cqv-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.inbox-cqv-name { font-size: 0.97rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-cqv-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.inbox-cqv-avatar--ph { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }

/* ── Shared ContactIdentityCard — editable name (used by quick view + full page) ── */
.inbox-cid { display: flex; flex-direction: column; min-width: 0; }
.inbox-cid-name-row { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.inbox-cid-name-row .inbox-cqv-name { flex: 0 1 auto; }
/* Pencil stays visible (not hover-only) so it works on touch + small screens. */
.inbox-cid-name-editbtn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.inbox-cid-name-editbtn:hover,
.inbox-cqv-hero:hover .inbox-cid-name-editbtn,
.inbox-cid-name-editbtn:focus-visible {
  opacity: 1;
  color: var(--accent);
  background: rgba(127, 127, 127, 0.14);
}
.inbox-cid-name-edit { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.inbox-cid-name-edit .inbox-cqv-add-input { flex: 1 1 auto; min-width: 0; }

/* Kind-aware name editor (person = First+Last, company = one name) — stacks the
   Person/Company toggle above the field(s) above the actions. */
.inbox-cid-name-editor { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.inbox-cid-name-editor .segmented-control { align-self: flex-start; }
.inbox-cid-name-editor > .inbox-cqv-add-input { width: 100%; min-width: 0; }
.inbox-cid-name-fields { display: flex; gap: 0.4rem; min-width: 0; }
.inbox-cid-name-fields .inbox-cqv-add-input { flex: 1 1 0; min-width: 0; }
.inbox-cid-name-editor-actions { display: flex; align-items: center; gap: 0.4rem; }

/* ── VersionWatcher slide-in ────────────────────────────────────────────── */
@keyframes vw-slidein {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Voice refinements (items 1-7) — 2026-06-24
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Item 4: recording state dot + button ─────────────────────────────────── */
.softphone-rec-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state-error, #ef4444);
  margin-left: 6px;
  vertical-align: middle;
  animation: softphone-rec-blink 1.2s ease-in-out infinite;
}
@keyframes softphone-rec-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
/* Recording button active = red tint */
.softphone-btn.softphone-rec-on {
  color: var(--state-error, #ef4444);
}

/* ── Item 3: user picker in transfer subbar ───────────────────────────── */
.softphone-subbar--transfer { flex-direction: column; align-items: stretch; gap: 6px; }
.softphone-agent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 120px;
  overflow-y: auto;
  min-width: 0;
}
.softphone-agent-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle, rgba(0,0,0,.12));
  background: var(--surface-muted, transparent);
  font-size: 0.75rem;
  color: var(--text-primary);
  cursor: pointer;
  min-width: 0;
  transition: background 0.12s;
}
.softphone-agent-row:hover { background: var(--surface-hover, rgba(0,0,0,.06)); }
.softphone-agent-row.is-selected { background: var(--accent, #4f46e5); color: #fff; border-color: var(--accent, #4f46e5); }
.softphone-agent-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.softphone-agent-dot.is-on_call,
.softphone-agent-dot.is-ringing { background: var(--state-error, #ef4444); }
.softphone-agent-dot.is-available { background: #22c55e; }
.softphone-agent-dot.is-busy,
.softphone-agent-dot.is-dnd,
.softphone-agent-dot.is-in_meeting { background: #f59e0b; }
.softphone-agent-dot.is-focus { background: var(--accent, #6366f1); }
.softphone-agent-dot.is-away { background: var(--text-muted, #9ca3af); }
.softphone-agent-dot.is-idle { background: var(--border-subtle, #d1d5db); }
.softphone-agent-name { font-size: 0.75rem; line-height: 1; min-width: 0; }

/* ── Item 6: status dot + popover on the topbar account avatar ───────────── */
.workspace-status-wrap { position: relative; display: flex; align-items: center; }
.workspace-account-btn--with-status { position: relative; }
.workspace-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--bg, #fff);
  flex-shrink: 0;
}
.workspace-status-dot.is-available { background: #22c55e; }
.workspace-status-dot.is-busy,
.workspace-status-dot.is-in_meeting { background: #f59e0b; }
.workspace-status-dot.is-dnd { background: var(--state-error, #ef4444); }
.workspace-status-dot.is-focus { background: var(--accent, #6366f1); }
.workspace-status-dot.is-away { background: var(--text-muted, #9ca3af); }
/* The account button overlay dot — positioned bottom-right */
.workspace-account-btn--with-status .workspace-status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
}
/* Badge: tiny pressable dot that opens the status popover */
.workspace-status-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1;
}
.workspace-status-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 200;
  /* Same surface tokens as .workspace-account-menu — the old
     --surface-popover/--bg tokens don't exist, so this fell back to #fff
     and was unreadable in dark mode (Hakim 2026-07-10). */
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 6px 0;
  min-width: 180px;
  box-shadow: var(--shadow-soft);
}
.workspace-status-menu-head {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 14px 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0;
}
.workspace-status-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.workspace-status-option:hover { background: var(--surface-muted, rgba(0,0,0,.04)); }
.workspace-status-option.is-active { font-weight: 600; color: var(--accent, #4f46e5); }
.workspace-status-option:disabled { opacity: 0.5; cursor: not-allowed; }
/* Divider between the status section and the profile links in the avatar menu. */
.workspace-account-menu-sep {
  height: 1px;
  margin: 0.3rem 0.35rem;
  background: var(--border-subtle);
}
/* Status options inherit the account menu's button metrics when inside it. */
.workspace-account-menu .workspace-status-option {
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.8rem;
}

/* ── Item 7: pane-2 pinned call row ──────────────────────────────────────── */
.inbox-live-call-stack {
  position: sticky;
  top: 0;
  z-index: 10;
}
.inbox-pinned-call {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle, rgba(0,0,0,.1));
  background: var(--surface-muted, rgba(0,0,0,.03));
  min-width: 0;
}
.inbox-pinned-call--thread {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.inbox-pinned-call--thread:focus-visible {
  outline: 2px solid var(--focus-ring, var(--accent));
  outline-offset: -2px;
}
.inbox-pinned-call--thread:disabled {
  cursor: default;
  opacity: 1;
}
.inbox-pinned-call.is-ringing { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.inbox-pinned-call.is-active { background: color-mix(in srgb, var(--state-success) 8%, transparent); }
.inbox-pinned-call--thread:not(:disabled):hover {
  background: color-mix(in srgb, var(--state-success) 12%, var(--surface-muted));
}
.inbox-pinned-call-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.inbox-pinned-call.is-ringing .inbox-pinned-call-dot {
  background: var(--accent, #4f46e5);
  animation: softphone-pulse 1.1s ease-in-out infinite;
}
.inbox-pinned-call.is-active .inbox-pinned-call-dot { background: var(--state-success); }
.inbox-pinned-call-info { flex: 1; min-width: 0; }
.inbox-pinned-call-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.inbox-pinned-call-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}
.inbox-pinned-call-actions { display: flex; gap: 4px; flex-shrink: 0; }
.inbox-pinned-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.12s;
}
.inbox-pinned-call-btn--accept {
  background: #22c55e;
  color: #fff;
}
.inbox-pinned-call-btn--accept:hover { background: #16a34a; }
.inbox-pinned-call-btn--decline {
  background: var(--state-error, #ef4444);
  color: #fff;
}
.inbox-pinned-call-btn--decline:hover { background: #dc2626; }

/* ── Item 5: availability panel in voice settings ─────────────────────────── */
.vp-availability { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle, rgba(0,0,0,.08)); }
.vp-avail-days { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.vp-avail-day { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vp-avail-toggle { display: flex; align-items: center; gap: 6px; min-width: 80px; }
.vp-avail-day-label { font-size: 0.8rem; font-weight: 500; color: var(--text-primary); min-width: 30px; }
.vp-avail-times { display: flex; align-items: center; gap: 6px; }
.vp-time { width: 90px; font-size: 0.8rem; }
.vp-avail-off { font-size: 0.78rem; }
.vp-dnd-field { margin-top: 10px; }
.vp-save-row { margin-top: 12px; }

/* ── Item 4: recording mode selector in voice settings ─────────────────────── */
.vp-rec-mode { margin-bottom: 10px; }
.vp-rec-label { font-size: 0.8rem; font-weight: 500; color: var(--text-primary); display: block; margin-bottom: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   Inbox email + contacts UX — 2026-06-25
   Composer recipient picker, redesigned ContactQuickView sections, avatar fix
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Roster avatar: fixed 30px round, cover-cropped (was stretching: the shared
   .inbox-msg-avatar-ph forced width/height:100% in a non-square row). ─────────── */
.inbox-participant-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
}

/* ── Composer recipient picker (ComposerRecipientBar) ─────────────────────────── */
.crb {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  min-width: 0;
}
.crb--inline { margin-bottom: 0; }
/* When the recipient picker sits in the compose tools row (next to the channel
   dropdown), drop the standalone-row bottom margin so it aligns with the buttons. */
.inbox-compose-tools .crb { margin-bottom: 0; }
.crb-label { color: var(--text-muted); font-weight: 600; flex: 0 0 auto; }
.crb-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.18rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.crb-trigger:hover { border-color: var(--border-strong); }
.crb-trigger--inline {
  /* A real, legible button — not a stray full-stop caret (Hakim 2026-06-28). */
  padding: 0.22rem 0.4rem;
  border-color: var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-muted);
}
.crb-trigger--inline:hover { color: var(--accent); border-color: var(--border-strong); }
.crb-active { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crb-owner {
  flex: 0 0 auto;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.68rem;
}
.crb-caret { color: var(--text-muted); flex: 0 0 auto; display: inline-flex; align-items: center; }
.crb-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 71;
  min-width: 240px;
  max-width: min(320px, 90vw);
  max-height: 280px;
  overflow-y: auto;
  padding: 0.3rem;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.crb--inline .crb-menu { left: auto; right: 0; }
/* The phone recipient picker (variant="bar") sits in the composer pinned to the
   viewport bottom, so a downward menu fell off the bottom of the screen (Hakim
   2026-06-25: "the phone number dropdown renders beneath the screen"). Open it
   UPWARD instead; the inline email variant keeps dropping down (that one's fine). */
.crb:not(.crb--inline) .crb-menu {
  top: auto;
  bottom: calc(100% + 6px);
}
.crb-opt {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  text-align: left;
  min-width: 0;
}
.crb-opt:hover { background: var(--bg-input); }
.crb-opt.is-active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.crb-opt-icon { flex: 0 0 auto; color: var(--text-muted); }
.crb-opt-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crb-opt-owner {
  flex: 0 0 auto;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.68rem;
}
.crb-badge {
  flex: 0 0 auto;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.crb-badge--active { color: var(--accent); }
.crb-empty { padding: 0.45rem 0.5rem; font-size: 0.78rem; color: var(--text-muted); }
.crb-add {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.45rem 0.5rem;
  border: none;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 7px 7px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.crb-add:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ── Add-identifier modal (shared by the composer picker) ─────────────────────── */
.crb-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.crb-modal {
  width: min(360px, 100%);
  padding: 1rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}
.crb-modal-head { font-size: 0.92rem; font-weight: 650; color: var(--text-primary); }
.crb-modal-input {
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 0 0.6rem;
  min-width: 0;
}
.crb-modal-input:focus { outline: none; border-color: var(--accent); }
/* Foolproof phone entry: the add-number field is the shared PhoneInput (country
   flag + dial code, GB default, emits E.164) — restyled to sit like the modal's
   other fields. Same retrofit as the CRM rail's channel-add. */
.crb-modal-phone .phone-input-control {
  height: 36px;
  padding: 0 0.6rem;
  border-radius: 9px;
  background: var(--bg-input);
}
.crb-modal-phone .phone-input-control:focus-within { border-color: var(--accent); }
.crb-modal-phone .PhoneInputCountrySelect { background: var(--bg-input); }
.crb-modal-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; color: var(--text-muted); }
.crb-modal-field select {
  height: 34px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 0 0.5rem;
}
.crb-modal-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-primary); cursor: pointer; }
.crb-modal-error { margin: 0; font-size: 0.78rem; color: var(--state-error); }
.crb-modal-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.15rem; }
.crb-modal-cancel {
  height: 34px;
  padding: 0 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.crb-modal-cancel:hover { border-color: var(--border-strong); }
.crb-modal-save {
  height: 34px;
  padding: 0 1rem;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.crb-modal-save:disabled { opacity: 0.5; cursor: default; }

/* ── ContactQuickView (pane 4) — grouped sections, merge-by-search ────────────── */
.inbox-cqv-hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; min-width: 0; }
.inbox-cqv-added { font-size: 0.72rem; color: var(--text-muted); }
.inbox-cqv-group { margin-top: 0.9rem; min-width: 0; }
.inbox-cqv-group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.35rem; }
.inbox-cqv-group-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.inbox-cqv-type-help {
  margin: -0.05rem 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  line-height: 1.4;
}
.inbox-contact-type-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.inbox-contact-type-option > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-contact-type-option > small {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.62rem;
}
.inbox-cqv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.inbox-cqv-list-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  min-width: 0;
  font-size: 0.86rem;
  color: var(--text-primary);
}
.inbox-cqv-list-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inbox-cqv-phone-value { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 0.05rem; }
.inbox-cqv-phone-value .inbox-cqv-list-value { flex: none; max-width: 100%; }
.inbox-cqv-phone-intel { color: var(--text-muted); font-size: 0.69rem; line-height: 1.25; text-transform: capitalize; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-cqv-intel-btn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0.2rem;
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
}
.inbox-cqv-intel-btn:hover:not(:disabled) { text-decoration: underline; }
.inbox-cqv-intel-btn:disabled { color: var(--text-muted); cursor: default; }
.inbox-cqv-list-tags { display: inline-flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; }
.inbox-cqv-wa-badge {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, #25d366 18%, transparent);
  color: color-mix(in srgb, #1c8c46 80%, var(--text-primary));
}
.inbox-cqv-group-empty { margin: 0.1rem 0 0; font-size: 0.8rem; }
.inbox-cqv-add-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.inbox-cqv-add-link:hover { text-decoration: underline; }
/* #8 — editable Type (role) chips + Tags + Notes in the contact quick view (light/dark tokens). */
.inbox-cqv-group-head { display: flex; align-items: center; gap: 0.5rem; }
.inbox-cqv-roles { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.inbox-cqv-role-name { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.inbox-cqv-role-name:hover { text-decoration: underline; }
.inbox-cqv-chip-x {
  border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
  line-height: 1; padding: 0 0 0 0.15rem; margin-left: 0.1rem;
  display: inline-flex; align-items: center;
}
.inbox-cqv-chip-x:hover { color: var(--state-error); }
.inbox-cqv-chip-add {
  border: 1px dashed var(--border-strong); background: transparent; color: var(--text-muted);
  border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.72rem; cursor: pointer;
}
.inbox-cqv-chip-add:hover { color: var(--accent); border-color: var(--accent); }
.inbox-cqv-type-picker { display: inline-flex; align-items: center; gap: 0.25rem; }
.inbox-cqv-type-picker select {
  border: 1px solid var(--border-subtle); background: var(--bg-input); color: var(--text-primary);
  border-radius: 6px; padding: 0.12rem 0.35rem; font: inherit; font-size: 0.74rem; max-width: 11rem;
}
.inbox-cqv-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.inbox-cqv-tag {
  display: inline-flex; align-items: center; gap: 0.1rem;
  background: var(--surface-muted); color: var(--text-soft);
  border-radius: 999px; padding: 0.1rem 0.2rem 0.1rem 0.55rem; font-size: 0.74rem;
}
.inbox-cqv-tag-input {
  flex: 1; min-width: 5rem; border: 0; background: transparent; color: var(--text-primary);
  font: inherit; font-size: 0.78rem; padding: 0.15rem 0.1rem; outline: none;
}
.inbox-cqv-tag-input::placeholder { color: var(--text-muted); }
.inbox-cqv-notes {
  width: 100%; min-width: 0; resize: vertical; min-height: 3.4rem;
  border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-input);
  color: var(--text-primary); font: inherit; font-size: 0.82rem; line-height: 1.45; padding: 0.45rem 0.55rem;
}
.inbox-cqv-notes:focus { outline: none; border-color: var(--accent); }
.inbox-cqv-notes::placeholder { color: var(--text-muted); }
.inbox-cqv-notes-save {
  margin-left: auto; border: 0; background: transparent; color: var(--accent);
  font: inherit; font-size: 0.74rem; font-weight: 600; cursor: pointer; padding: 0;
}
.inbox-cqv-notes-save:disabled { opacity: 0.5; cursor: default; }
.inbox-cqv-addform {
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
  min-width: 0;
}
.inbox-cqv-addform .inbox-cqv-add-input { flex: 1 1 auto; }
.inbox-cqv-add-check { display: flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; color: var(--text-primary); cursor: pointer; }
.inbox-cqv-add-actions { display: flex; justify-content: flex-end; gap: 0.45rem; }
.inbox-cqv-add-cancel {
  height: 32px;
  padding: 0 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.inbox-cqv-add-cancel:hover { border-color: var(--border-strong); }
/* Identifier rows: hover-revealed edit/remove (tap-to-reveal on touch via WebKit's
   sticky :hover — same pattern as .inbox-msg-tools; the old always-visible touch
   fallback was part of the iPad ghost-button clutter, Hakim 2026-07-20), with a
   two-step inline "Remove?" confirm — no modal for a single-row action. */
.inbox-cqv-row-actions { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; opacity: 0; transition: opacity 0.12s ease; }
.inbox-cqv-list-row:hover .inbox-cqv-row-actions,
.inbox-cqv-list-row:focus-within .inbox-cqv-row-actions { opacity: 1; }
.inbox-cqv-row-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.inbox-cqv-row-btn svg { flex: 0 0 auto; }
.inbox-cqv-row-btn:hover { background: var(--surface-muted); color: var(--text-primary); }
.inbox-cqv-row-btn--danger:hover { color: var(--state-error); }
.inbox-cqv-row-confirm {
  border: 1px solid color-mix(in srgb, var(--state-error) 45%, transparent);
  background: color-mix(in srgb, var(--state-error) 10%, transparent);
  color: var(--state-error); border-radius: 999px; padding: 0 0.7rem; height: 30px;
  font: inherit; font-size: 0.78rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.inbox-cqv-row-confirm:disabled { opacity: 0.6; cursor: default; }
.inbox-cqv-list-row--editing { display: block; }
.inbox-cqv-list-row--editing .inbox-cqv-editform { margin-top: 0; }
.inbox-cqv-merge-search {
  width: 100%;
  height: 34px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.84rem;
  padding: 0 0.75rem;
}
.inbox-cqv-merge-search:focus { outline: none; border-bottom-color: var(--accent); }
.inbox-cqv-merge-confirm { padding: 0.65rem 0.75rem; font-size: 0.82rem; color: var(--text-primary); }
.inbox-cqv-merge-confirm p { margin: 0 0 0.6rem; line-height: 1.4; }
.inbox-cqv-merge-confirm-actions { display: flex; justify-content: flex-end; gap: 0.45rem; }
.inbox-cqv-merge-confirm-btn {
  height: 32px;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 8px;
  background: var(--state-error, #ef4444);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}
.inbox-cqv-merge-confirm-btn:disabled { opacity: 0.5; cursor: default; }

/* Merge conflict-resolution modal (§1) — reuses the crb-modal shell, wider body.
   Tokens only (light/dark parity by construction). */
.inbox-merge-modal { width: min(440px, calc(100vw - 32px)); max-height: min(80vh, 640px); overflow-y: auto; }
.inbox-merge-modal .crb-modal-head strong { font-weight: 700; }
.inbox-merge-modal-sub { margin: -0.2rem 0 0.75rem; font-size: 0.8rem; line-height: 1.45; color: var(--text-secondary); }
.inbox-merge-modal-rows { display: flex; flex-direction: column; gap: 0.85rem; }
.inbox-merge-row { border: 0; padding: 0; margin: 0; min-width: 0; }
.inbox-merge-row-label {
  padding: 0;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.inbox-merge-row-options { display: flex; flex-direction: column; gap: 0.35rem; }
.inbox-merge-opt {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-primary);
  min-width: 0;
}
.inbox-merge-opt.is-picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--bg-secondary)); }
.inbox-merge-opt input[type="radio"] { accent-color: var(--accent); margin: 0; flex: none; }
.inbox-merge-opt-value { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.inbox-merge-opt-owner { flex: none; font-size: 0.7rem; color: var(--text-secondary); max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-merge-opt-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.inbox-merge-row-note { margin: 0.3rem 0 0; font-size: 0.72rem; color: var(--text-secondary); }
.inbox-cid-aka { margin: 0.1rem 0 0; font-size: 0.75rem; }

@media (max-width: 768px) {
  .crb-menu { min-width: 200px; }
  .crb-modal { width: 100%; }
  .inbox-merge-modal { width: 100%; }
}

/* ===========================================================================
   Share to team chat (PR B) — modal + guest-bubble share pill + shared-card link.
   Tokens only (light/dark parity); modal portals to <body> so it sits above panes.
   =========================================================================== */
/* Interactive shared-message card (SharedMessageCard) — collapsed summary that
   expands in place to the real original + meta + "Go to conversation". Theme
   tokens only so it works on both surfaces in light + dark. */
.shared-msg-card {
  border: 0.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  max-width: 460px;
}
/* The sharer's accompanying comment, above the card (forward-with-comment). */
.shared-msg-note {
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
  border-bottom: 0.5px solid var(--border);
  white-space: pre-wrap;
  word-break: break-word;
}
.shared-msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}
.shared-msg-head-title {
  font-weight: 500;
  color: var(--text-primary);
}
.shared-msg-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
}
.shared-msg-summary {
  flex: 1;
  min-width: 0;
}
.shared-msg-summary-line {
  display: block;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shared-msg-body {
  padding: 0 14px 14px;
}
.shared-msg-frame {
  width: 100%;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  min-height: 140px;
  background: #fff;
}
.shared-msg-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.shared-msg-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.shared-msg-att {
  font-size: 13px;
  color: var(--text-accent);
  text-decoration: none;
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.shared-msg-meta {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shared-msg-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.shared-msg-meta-row span:first-child {
  color: var(--text-muted);
}
.shared-msg-goto {
  margin-top: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  border-radius: var(--radius);
  border: 0.5px solid var(--border-strong);
  background: var(--bg-accent);
  color: var(--text-accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.shared-thread-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
}
.shared-thread-summary strong {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.35;
}
.shared-thread-summary span {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}
.shared-thread-goto {
  width: auto;
  margin: 0 14px 14px;
}

.stc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: color-mix(in srgb, #020617 56%, transparent);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: stc-fade-in 160ms ease-out both;
}
.stc-panel {
  width: min(94vw, 520px);
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: 0 24px 64px color-mix(in srgb, #000 42%, transparent);
  outline: none;
  overflow: hidden;
  animation: stc-panel-in 190ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
.stc-overlay.is-closing {
  pointer-events: none;
  animation: stc-fade-out 140ms ease-in both;
}
.stc-panel.is-closing {
  animation: stc-panel-out 140ms ease-in both;
}
.stc-grab {
  display: none;
}
.stc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.stc-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
}
.stc-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.stc-close:disabled { opacity: 0.5; cursor: not-allowed; }
.stc-close:hover:not(:disabled) {
  background: var(--bg-input);
  color: var(--text-primary);
}
.stc-preview {
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: 11px;
  padding: 10px 12px;
  background: var(--surface-muted);
}
.stc-preview-kind {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stc-preview-title {
  font-size: 0.88rem;
  font-weight: 680;
  color: var(--text-primary);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stc-preview-snippet {
  font-size: 0.82rem;
  color: var(--text-soft);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stc-preview-author {
  font-weight: 650;
  color: var(--text-muted);
}
.stc-note,
.stc-filter {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.stc-note {
  resize: vertical;
  min-height: 58px;
  max-height: 130px;
  line-height: 1.4;
}
.stc-note:focus-visible,
.stc-filter:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.stc-channels-label {
  margin: 1px 0 -5px;
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  color: var(--text-muted);
}
.stc-filter-wrap {
  position: relative;
}
.stc-filter {
  padding-right: 38px;
}
.stc-filter::-webkit-search-cancel-button {
  opacity: 0.7;
}
.stc-filter-progress {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 15px;
  height: 15px;
  margin-top: -8px;
  border: 2px solid color-mix(in srgb, var(--text-muted) 28%, transparent);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: stc-spin 700ms linear infinite;
  pointer-events: none;
}
.stc-channels {
  display: flex;
  flex-direction: column;
  flex: 1 1 300px;
  gap: 3px;
  overflow-y: auto;
  height: min(300px, 34dvh);
  max-height: 300px;
  min-height: 54px;
  padding: 1px 3px 1px 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.stc-channels-empty {
  padding: 14px 4px;
  font-size: 0.84rem;
  margin: 0;
}
.stc-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease, transform 130ms ease;
}
.stc-channel:hover {
  background: var(--bg-input);
}
.stc-channel:active {
  transform: scale(0.993);
}
.stc-channel:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: -2px;
}
.stc-channel.is-chosen {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.stc-channel-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--text-muted);
}
.stc-channel.is-chosen .stc-channel-icon {
  color: var(--accent);
}
.stc-channel-copy {
  display: grid;
  flex: 1 1 auto;
  gap: 1px;
  min-width: 0;
}
.stc-channel-name,
.stc-channel-context {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stc-channel-name {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 520;
}
.stc-channel-context {
  font-size: 0.73rem;
  color: var(--text-muted);
}
.stc-channel-check {
  flex: 0 0 auto;
  color: var(--accent);
}
.stc-error {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--state-danger, #dc2626);
  margin: 0;
}
.stc-send-error {
  padding: 0 2px;
}
.stc-loading-more {
  margin: 3px 0;
  padding: 8px 4px;
  font-size: 0.76rem;
  text-align: center;
}
.stc-load-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 4px;
}
.stc-load-state-inline {
  border-top: 1px solid var(--border-subtle);
  margin-top: 4px;
}
.stc-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.stc-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 1px;
}
.stc-btn {
  min-height: 40px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, filter 140ms ease, transform 140ms ease;
}
.stc-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.stc-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.stc-btn-ghost {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-primary);
}
.stc-btn-ghost:hover:not(:disabled) {
  background: var(--bg-input);
}
.stc-btn-primary {
  background: var(--accent);
  color: var(--accent-contrast, #fff);
}
.stc-btn-primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

@keyframes stc-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes stc-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes stc-panel-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes stc-panel-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(6px) scale(0.99); }
}
@keyframes stc-sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes stc-sheet-out {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(18px); opacity: 0; }
}
@keyframes stc-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  .stc-overlay {
    align-items: flex-end;
    padding: 0;
    height: 100dvh;
    backdrop-filter: blur(2px);
  }
  .stc-panel {
    width: 100%;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top, 0px)));
    gap: 11px;
    padding: 8px 16px max(12px, env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
    animation-name: stc-sheet-in;
  }
  .stc-panel.is-closing {
    animation-name: stc-sheet-out;
  }
  .stc-grab {
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 1px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 38%, transparent);
  }
  .stc-title {
    font-size: 1.05rem;
  }
  .stc-close {
    width: 44px;
    height: 44px;
  }
  .stc-preview {
    padding: 9px 11px;
  }
  .stc-preview-snippet {
    -webkit-line-clamp: 2;
  }
  .stc-note {
    min-height: 54px;
    max-height: 90px;
    resize: none;
  }
  .stc-filter,
  .stc-note {
    font-size: 16px;
  }
  .stc-channels {
    flex: 1 1 auto;
    height: auto;
    max-height: none;
    min-height: 96px;
  }
  .stc-channel {
    min-height: 56px;
    padding: 7px 10px;
  }
  .stc-channel-name {
    font-size: 0.93rem;
  }
  .stc-channel-context {
    font-size: 0.76rem;
  }
  .stc-actions {
    flex: 0 0 auto;
    margin: 0 -16px calc(-1 * max(12px, env(safe-area-inset-bottom, 0px)));
    padding: 10px 16px max(12px, env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
  }
  .stc-btn {
    min-height: 48px;
    flex: 1 1 0;
    font-size: 0.94rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stc-overlay,
  .stc-panel,
  .stc-filter-progress {
    animation-duration: 1ms;
  }
  .stc-channel,
  .stc-btn {
    transition: none;
  }
}

/* Guest-bubble hover affordances (share · listing-intel · translate · create-task).
   They live in ONE flex CLUSTER in the empty side of the full-width message row.
   Never place this cluster over the bubble: it hides the words and intercepts a
   drag that should select them. The body keeps enough opposite-side room for the
   widest four-action cluster at the narrowest desktop width. */
.inbox-msg-body { position: relative; }
.inbox-msg:has(.inbox-msg-pills) .inbox-msg-body {
  max-width: min(75%, calc(100% - 172px));
}
.inbox-msg-pills {
  position: absolute;
  top: 0;
  display: inline-flex;
  gap: 4px;
  z-index: 3;
}
/* Inbound content leaves space to its right; outbound content leaves space to
   its left. Put the actions in that space, with an 8px gap from the message.
   Inbound reverses DOM order so Share remains the outermost action. */
.inbox-msg-pills.in {
  left: calc(100% + 8px);
  right: auto;
  flex-direction: row-reverse;
}
.inbox-msg-pills.out {
  right: calc(100% + 8px);
  left: auto;
}
/* Email and call cards intentionally use the entire conversation width, so they
   have no empty side rail. Keep their actions just above the card instead of
   pushing them beyond the clipped scroll area or covering the card controls. */
.inbox-msg-body:has(.inbox-emailcard, .inbox-voice-card) .inbox-msg-pills {
  top: -38px;
}
.inbox-msg-body:has(.inbox-emailcard, .inbox-voice-card) .inbox-msg-pills.in {
  right: 8px;
  left: auto;
}
.inbox-msg-body:has(.inbox-emailcard, .inbox-voice-card) .inbox-msg-pills.out {
  left: 8px;
  right: auto;
}
.inbox-share-pill {
  /* Flows inside .inbox-msg-pills now (was absolute per-pill). */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-soft);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
  box-shadow: 0 2px 6px color-mix(in srgb, #000 14%, transparent);
}
/* Per-pill reveal (not on the cluster) so a captured-intel bookmark can stay visible
   at rest while the rest hide. Touch: WebKit's sticky :hover on .inbox-msg-body fires
   the reveal on tap and clears it on the next tap elsewhere (proven pattern, 2026-07-17). */
.inbox-msg-body:hover .inbox-share-pill,
.inbox-share-pill:focus-visible { opacity: 1; pointer-events: auto; }
.inbox-share-pill:hover { color: var(--accent); background: var(--bg-input); }
.inbox-intel-pill.is-captured { color: var(--accent); opacity: 1; pointer-events: auto; }
.inbox-translate-pill.is-on { color: var(--accent); }
.inbox-translate-pill:disabled { cursor: default; } /* busy while translating */
.inbox-translate-pill:disabled:hover { color: var(--text-soft); background: var(--bg-elevated); }

/* Message→task pill: a task was created FROM this message. Sits above the
   whole card (Slack-style), coloured by the task's LIVE status via
   --pill-status-color (set inline from the status palette), click-through to
   /tasks?task=. Both themes ride the tokens; the status colour is the accent. */
.inbox-msg-task-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 4px;
}
.inbox-msg-task-row.out { justify-content: flex-end; }
.inbox-msg-task-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 340px;
  padding: 3px 10px 3px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pill-status-color) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--pill-status-color) 10%, var(--bg-elevated));
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.inbox-msg-task-chip:hover {
  background: color-mix(in srgb, var(--pill-status-color) 18%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--pill-status-color) 65%, var(--border-subtle));
}
.inbox-msg-task-chip svg { color: var(--pill-status-color); flex: none; }
.inbox-msg-task-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.inbox-msg-task-chip.is-done .inbox-msg-task-chip-title {
  text-decoration: line-through;
  opacity: 0.75;
}

/* Hover card for the pill — portaled (reaction-tooltip idiom), anchored above
   the chip's centre. */
.inbox-msg-task-card {
  position: fixed;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 8px 24px color-mix(in srgb, #000 22%, transparent);
  z-index: 90;
  pointer-events: none;
}
.inbox-msg-task-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.inbox-msg-task-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.inbox-msg-task-card-status { font-weight: 600; }
.inbox-msg-task-card-muted { color: var(--text-soft); }

/* Phone twin — same idea, tap-first sizing (44px total touch row height is
   overkill for a chip; 28px visual + the bubble's own spacing reads right). */
.ph-msg-task-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 4px;
}
.ph-msg-task-row.out { justify-content: flex-end; }
.ph-msg-task-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 78vw;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--pill-status-color) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--pill-status-color) 10%, var(--bg-elevated));
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}
.ph-msg-task-chip svg { color: var(--pill-status-color); flex: none; }
.ph-msg-task-chip-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ph-msg-task-chip.is-done .ph-msg-task-chip-title {
  text-decoration: line-through;
  opacity: 0.75;
}

/* Translation marker under a translated bubble ("Auto-translated from Spanish ·
   See original"). Inherits the bubble's text color (in/out bubbles + both themes)
   and stays ≥12px. */
.inbox-translated-note {
  display: block;
  margin-top: 0.2rem;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.3;
  color: inherit;
  opacity: 0.72;
  cursor: pointer;
  text-align: inherit;
}
.inbox-translated-note:hover { opacity: 1; text-decoration: underline; }

/* Composer language contract: the User writes in the workspace language, then
   sees the exact recipient-language payload before Send can commit it. */
.inbox-recipient-language {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  margin: 0.45rem 0 0;
  padding: 0.5rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}
.inbox-recipient-language-control {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}
.inbox-recipient-language-slot {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.inbox-recipient-language-control.is-toolbar {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0;
}
.inbox-recipient-language-control.is-toolbar .inbox-recipient-language-select {
  height: 30px;
  min-width: 34px;
  max-width: 154px;
  margin-left: 0;
  padding: 0 7px;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-muted);
}
.inbox-recipient-language-control.is-toolbar.is-active .inbox-recipient-language-select {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-input));
  color: var(--accent);
}
.inbox-recipient-language-control.is-toolbar .inbox-recipient-language-select .selectmenu-label:empty {
  display: none;
}
.inbox-recipient-language-control.is-toolbar .inbox-recipient-language-state {
  margin-left: 0.35rem;
  white-space: nowrap;
}
.inbox-recipient-language-icon {
  display: inline-flex;
  color: var(--accent);
  flex: 0 0 auto;
}
.inbox-recipient-language-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
}
.inbox-recipient-language-select {
  min-width: 0;
  margin-left: auto;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
}
.inbox-recipient-language-state,
.inbox-recipient-language-preview-label {
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 650;
}
.inbox-recipient-language-preview {
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  min-width: 0;
}
.inbox-recipient-language-preview-text {
  max-height: 7.5rem;
  overflow: auto;
  color: var(--text-primary);
  font-size: 0.78rem;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.inbox-recipient-language-preview-text.is-loading {
  color: var(--text-soft);
  font-style: italic;
}
.inbox-recipient-language-error {
  color: var(--danger, #dc2626);
  font-size: 0.7rem;
  line-height: 1.35;
}

/* Sent bubbles keep workspace-language text primary. This disclosure preserves
   the exact recipient-language payload for a one-tap audit. */
.inbox-outbound-language {
  margin-top: 0.32rem;
  color: inherit;
  font-size: 0.72rem;
}
.inbox-outbound-language summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: inherit;
  font-weight: 650;
  opacity: 0.72;
  cursor: pointer;
  list-style: none;
}
.inbox-outbound-language summary::-webkit-details-marker { display: none; }
.inbox-outbound-language summary:hover { opacity: 1; }
.inbox-outbound-language-body {
  max-height: 9rem;
  margin-top: 0.32rem;
  padding-top: 0.32rem;
  border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  overflow: auto;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* #146 — per-message hover toolbar (react · share) on internal/UOS bubbles.
   Mirrors .inbox-share-pill's hover-reveal, but holds a small row of tools. */
.inbox-msg-tools {
  position: absolute;
  /* Float the bar ABOVE the message (Hakim: the old position obscured the text). */
  top: -34px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 4px 12px color-mix(in srgb, #000 18%, transparent);
  /* Hover-only, like ClickUp/Slack: hidden at rest, revealed on row hover /
     keyboard focus (rule below). The bar must NOT sit visible on every message
     (Hakim 2026-07-01: "the hover bar is no longer a hover bar, it's visible on
     everything"). */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 5;
}
/* Anchor to the message's own outer edge so it never sits over the bubble body. */
.inbox-msg-tools.in { left: 0; right: auto; }
.inbox-msg-tools.out { right: 0; left: auto; }
.inbox-msg-body:hover .inbox-msg-tools,
.inbox-msg-tools:focus-within { opacity: 1; pointer-events: auto; }
/* Touch: tap-to-reveal. WebKit applies sticky :hover to a tapped bubble, so
   the reveal rule above fires on tap and clears on the next tap elsewhere.
   The previous always-on 60% ghosts put a floating pill bar over every
   message on a phone — read as broken UI (Hakim 2026-07-17). A long-press
   sheet is still the eventual mobile-native answer. */
@media (hover: none) {
  .inbox-msg-tools { opacity: 0; pointer-events: none; }
}
.inbox-msg-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.inbox-msg-tool:hover { color: var(--accent); background: var(--bg-input); }
.inbox-msg-tool--danger:hover { color: #ef4444; background: color-mix(in srgb, #ef4444 12%, var(--bg-input)); }

/* §3 UOS post subtype — a titled POST renders its heading above the body, and the
   composer offers a Message ⇄ Post toggle + a title field. Indigo = the brand accent. */
.inbox-post-title { margin: 0 0 0.25rem; font-size: 0.95rem; font-weight: 650; line-height: 1.25; color: var(--text-primary); }
.inbox-feed-note-title { margin: 0 0 0.15rem; font-size: 0.9rem; font-weight: 650; line-height: 1.25; color: var(--text-primary); }
.inbox-feed-note-replies { margin-top: 0.25rem; font-size: 0.78rem; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
.inbox-uos-postbar { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.4rem; }
.inbox-uos-posttitle { flex: 1 1 auto; min-width: 0; padding: 0.32rem 0.6rem; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--bg-elevated); color: var(--text-primary); font-size: 0.9rem; font-weight: 600; }
.inbox-uos-posttitle:focus { outline: none; border-color: var(--accent); }
/* §3 UOS post-types (Hakim 2026-06-30) — announcement / update / discussion / idea each
   carry an ICON + BORDER COLOUR so the post stands out. The type sets --post-c on the
   bubble + the post header + the composer chip; everything below reads that one variable. */
[data-post-kind="announcement"] { --post-c: #f59e0b; }
[data-post-kind="update"] { --post-c: #3b82f6; }
[data-post-kind="discussion"] { --post-c: #8b5cf6; }
[data-post-kind="idea"] { --post-c: #10b981; }
[data-post-kind="post"] { --post-c: var(--accent); }
.inbox-bubble[data-post-kind] {
  border-color: color-mix(in srgb, var(--post-c) 45%, var(--border-subtle));
  border-left: 3px solid var(--post-c);
}
.inbox-post-head { display: flex; flex-direction: column; gap: 0.15rem; margin: 0 0 0.3rem; }
.inbox-post-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--post-c);
}
.inbox-post-kind svg { width: 14px; height: 14px; flex: 0 0 auto; }
/* Composer post-bar chip (above the editor when a post type is active). */
.inbox-uos-posttype {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--post-c);
  white-space: nowrap;
}
.inbox-uos-posttype svg { width: 15px; height: 15px; }
.inbox-edit { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.inbox-edit-area {
  width: 100%;
  min-height: 56px;
  resize: vertical;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.875rem;
  padding: 6px 8px;
}
.inbox-edit-actions { display: flex; gap: 6px; }
.inbox-edit-save,
.inbox-edit-cancel {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}
.inbox-edit-save { background: var(--accent); color: var(--accent-contrast, #fff); border-color: var(--accent); }
.inbox-edit-cancel { background: transparent; color: var(--text-soft); }

/* Quick-react popover. Portaled to document.body (an absolute child of the
   .inbox-bubbles scroller clips at its top/bottom edges); top/left/transform
   come inline from the anchor button's rect, clamped to the viewport. */
.inbox-react-anchor { position: relative; display: inline-flex; }
.inbox-react-pop {
  position: fixed;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  box-shadow: 0 4px 12px color-mix(in srgb, #000 18%, transparent);
  z-index: 10000;
}
.inbox-react-opt {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 7px;
  transition: background 0.1s ease, transform 0.1s ease;
}
.inbox-react-opt:hover { background: var(--bg-input); transform: scale(1.18); }

/* Reactions row chips under the bubble (extends the base .inbox-bubble-reactions).
   Reactions ALWAYS sit LEFT, directly under the message (Hakim 2026-07-23: "reactions on
   the left … all uos messages sit left"). UOS messages are side `in`; WhatsApp
   reactions can sit under either side. Keep the reaction cluster left-aligned
   beneath its own message on both. */
.inbox-bubble-reactions { margin-top: 0.28rem; flex-wrap: wrap; }
.inbox-bubble-reactions.in { align-self: flex-start; justify-self: start; }
.inbox-bubble-reactions.out { align-self: flex-start; justify-content: flex-start; }
.inbox-whatsapp-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.28rem;
  align-self: flex-start;
}
.inbox-whatsapp-reactions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.inbox-reply-add {
  border-style: dashed;
  gap: 5px;
  font-weight: 650;
}
.inbox-reaction-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  height: 22px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease;
}
.inbox-reaction-chip:hover { background: var(--bg-input); }
.inbox-reaction-add {
  border-style: dashed;
  gap: 5px;
  font-weight: 650;
}
.inbox-reaction-chip.is-mine {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-elevated));
  color: var(--text-primary);
}
.inbox-reaction-count { font-weight: 650; font-size: 0.72rem; }

/* A native WhatsApp reply is composer state, not a hidden gesture. The quoted
   target stays visible above both the free-form and approved-template composers
   until Send or explicit cancel. One compact line keeps the phone composer under
   the entry-morph height and lets long text truncate instead of growing it. */
.wa-reply-context {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-height: 64px;
  margin: 4px 0 7px;
  padding: 8px 8px 8px 10px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid #25d366;
  border-radius: 10px;
  background: color-mix(in srgb, #25d366 7%, var(--bg-elevated));
  color: var(--text-primary);
}
.wa-reply-context-icon {
  color: #25d366;
  flex: none;
}
.wa-reply-context-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
  font-size: 12px;
  line-height: 1.25;
}
.wa-reply-context-copy strong,
.wa-reply-context-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-reply-context-copy strong { font-weight: 700; }
.wa-reply-context-copy span { color: var(--text-muted); }
.wa-reply-context-cancel {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.wa-reply-context-cancel:hover,
.wa-reply-context-cancel:focus-visible {
  background: var(--bg-input);
  color: var(--text-primary);
}
.inbox-feedback-status,
.ph-feedback-status {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  line-height: 1;
  padding: 5px 8px;
  margin-top: 5px;
}
.inbox-feedback-status.is-acknowledged,
.ph-feedback-status.is-acknowledged {
  border-color: color-mix(in srgb, #60a5fa 42%, var(--border-subtle));
  background: color-mix(in srgb, #60a5fa 11%, var(--bg-elevated));
  color: #60a5fa;
}
.inbox-feedback-status.is-in_progress,
.ph-feedback-status.is-in_progress {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--border-subtle));
  background: color-mix(in srgb, #f59e0b 12%, var(--bg-elevated));
  color: #d8900b;
}
.inbox-feedback-status.is-fixed,
.ph-feedback-status.is-fixed {
  border-color: color-mix(in srgb, #22c55e 45%, var(--border-subtle));
  background: color-mix(in srgb, #22c55e 11%, var(--bg-elevated));
  color: #19a34b;
}
.inbox-feedback-status-dot,
.ph-feedback-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.72;
}
/* Hover a reaction chip → who reacted (Hakim 2026-06-30). Inverted pill, names
   resolved client-side from the roster. Portaled to document.body and shown by
   mount/unmount (JS hover state) — CSS :hover can't reach across a portal, and
   an absolute child of the .inbox-bubbles scroller clips at its edges. */
.inbox-reaction-who {
  position: fixed;
  max-width: 240px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--text-primary);
  color: var(--bg-elevated);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 18px color-mix(in srgb, #000 26%, transparent);
  pointer-events: none;
  z-index: 10000;
}

/* (Removed .inbox-compose-quote — the inline "replying to" banner above the
   composer. Reply now lives entirely in the pane-4 thread panel. Hakim 2026-07-01.) */
.inbox-replies-last {
  color: var(--text-soft);
  font-weight: 500;
}

/* Shared-thread card link (rendered inside a posted rc-post-card in a team room). */
.rc-shared-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.rc-shared-link:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .stc-panel { width: 96vw; }
  .stc-channels { max-height: 40vh; }
}

/* ───────────────── In-app attachment viewer (§3e) ───────────────── */
.av-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* A full-screen blur over the live Inbox plus a large decoded photo can
     stall WebKit's compositor. The viewer is an opaque workspace on purpose:
     predictable paint cost, and no distracting app chrome behind the file. */
  background: #05070d;
}
.av-panel {
  display: flex;
  flex-direction: column;
  width: calc(100vw - 32px);
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 56px color-mix(in srgb, #000 48%, transparent);
  isolation: isolate;
}
.av-panel.has-rail { width: calc(100vw - 32px); }
.av-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-elevated);
  position: relative;
  z-index: 2;
}
.av-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 82px;
  height: 38px;
  padding: 0 12px 0 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  flex: 0 0 auto;
}
.av-close:hover {
  border-color: color-mix(in srgb, var(--text-muted) 58%, var(--border-subtle));
  background: var(--surface-hover);
}
.av-close:focus-visible,
.av-iconbtn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.av-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.av-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
.av-type {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-radius: 5px;
  padding: 2px 6px;
  flex-shrink: 0;
}
.av-position {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.av-head-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.av-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.av-iconbtn:hover { background: var(--surface-hover); color: var(--text-primary); }
.av-body { display: flex; flex: 1; min-height: 0; }
.av-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: color-mix(in srgb, #05070d 86%, var(--bg-elevated));
  position: relative;
  min-width: 0;
  overscroll-behavior: contain;
  /* The gallery owns horizontal swipes while an image is fitted. Giving the
     browser pan-x here caused real devices to cancel the JS gesture before
     touchend even though synthetic tests passed. */
  touch-action: pan-y pinch-zoom;
}
.av-stage.is-media-zoomed {
  /* A zoomed image needs ordinary two-axis panning instead of gallery nav. */
  touch-action: pan-x pan-y pinch-zoom;
}
.av-gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text-primary) 24%, transparent);
  border-radius: 999px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transform: translateY(-50%);
}
.av-gallery-nav:hover {
  background: var(--bg-elevated);
  border-color: color-mix(in srgb, var(--text-primary) 42%, transparent);
}
.av-gallery-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.av-gallery-nav.is-prev { left: 14px; }
.av-gallery-nav.is-next { right: 14px; }
.av-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  display: block;
}
.av-img.is-zoom { max-width: none; max-height: none; cursor: zoom-out; }
.av-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.av-filecard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px;
  color: var(--text-soft);
  text-align: center;
}
.av-filecard-icon { color: var(--text-muted); }
.av-filecard-name { font-size: 14px; font-weight: 600; color: var(--text-primary); word-break: break-all; }
.av-filecard-hint { font-size: 12px; color: var(--text-muted); }
.av-rail {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.av-rail-head {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.av-rail-scroll { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.av-msg {
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--surface-muted);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 60%, transparent);
}
.av-msg.is-mine { background: color-mix(in srgb, var(--accent) 12%, var(--surface-muted)); }
.av-msg-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.av-msg-author { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.av-msg-time { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.av-msg-body {
  font-size: 12.5px;
  color: var(--text-soft);
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.av-msg-clip { color: var(--text-muted); }
.av-rail-empty { font-size: 12px; color: var(--text-muted); text-align: center; margin: 16px 0; }
/* Item 4 — the rail is the file's own comment thread. */
.av-rail-head .av-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.av-composer { border-top: 1px solid var(--border-subtle); padding: 10px; display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.av-input {
  width: 100%;
  resize: none;
  font: inherit;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
}
.av-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.av-composer-actions { display: flex; justify-content: flex-end; }
.av-error { font-size: 12px; color: var(--state-danger); }
.av-btn {
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 14px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-muted);
  color: var(--text-primary);
  cursor: pointer;
}
.av-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); text-decoration: none; }
.av-btn-primary:hover { filter: brightness(1.05); }
.av-btn:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 768px) {
  .av-overlay { padding: 0; }
  /* 100dvh (not vh) so the panel matches the VISIBLE viewport on iOS; the
     safe-area padding keeps the header (and its Close button) below the
     status bar and the rail clear of the home indicator — the overlay is
     position:fixed, so the phone-tier body padding never reaches it. */
  .av-panel, .av-panel.has-rail {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .av-head { gap: 7px; padding-left: 7px; padding-right: 7px; }
  .av-close {
    min-width: 74px;
    height: 40px;
    padding: 0 10px 0 7px;
  }
  .av-title { gap: 0; }
  .av-type { display: none; }
  .av-position { margin-left: 7px; }
  .av-head-actions { gap: 0; }
  .av-open-external { display: none; }
  .av-iconbtn { width: 40px; height: 40px; }
  .av-gallery-nav {
    width: 44px;
    height: 44px;
    background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  }
  .av-gallery-nav.is-prev { left: 8px; }
  .av-gallery-nav.is-next { right: 8px; }
  .av-body { flex-direction: column; }
  .av-rail {
    width: auto;
    max-height: min(44vh, 420px);
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

/* ───────────────────────────────────────────────────────────────────────
   Owner statement panel (Financials tab, owner case) — OwnerStatementPanel.tsx
   Light/dark parity via the shared --bg-elevated / --text-* / --border-*
   tokens (CLAUDE.md #5); icons in the component are ≥16px (CLAUDE.md icon
   rule). The waterfall is the headline element — each row shows the
   deduction, its % of the previous remainder, and the running balance.
   ─────────────────────────────────────────────────────────────────────── */

.owner-stmt {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 1.25rem 2rem;
  min-width: 0;
}

.owner-stmt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.owner-stmt-toolbar-title h2 {
  margin: 0 0 0.15rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.owner-stmt-toolbar-title p {
  margin: 0;
  font-size: 0.85rem;
}

.owner-stmt-toolbar-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.owner-stmt-month-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.owner-stmt-month-field span {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.owner-stmt-status {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-soft);
}

.owner-stmt-status svg {
  flex: 0 0 auto;
  color: var(--accent);
}

.owner-stmt-status.error svg {
  color: var(--state-error);
}

.owner-stmt-spin {
  animation: uos-spin 0.8s linear infinite;
}

.owner-stmt-period {
  margin: -0.4rem 0 0;
  font-size: 0.82rem;
}

/* ── The waterfall ── */

.owner-stmt-waterfall h3,
.owner-stmt-channel-mix h3,
.owner-stmt-charges-card h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.owner-stmt-waterfall-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.owner-stmt-wf-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto auto;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0.1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.88rem;
}

.owner-stmt-wf-row:last-child {
  border-bottom: none;
}

.owner-stmt-wf-row.is-basis {
  font-weight: 700;
}

.owner-stmt-wf-row.is-basis .owner-stmt-wf-remainder {
  color: var(--accent);
}

.owner-stmt-wf-row.is-final {
  margin-top: 0.2rem;
  padding-top: 0.7rem;
  border-top: 2px solid var(--border-strong);
  border-bottom: none;
  font-weight: 700;
}

.owner-stmt-wf-label {
  color: var(--text-soft);
  min-width: 0;
}

.owner-stmt-wf-row.is-basis .owner-stmt-wf-label,
.owner-stmt-wf-row.is-final .owner-stmt-wf-label {
  color: var(--text-primary);
}

.owner-stmt-wf-detail {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  white-space: nowrap;
  justify-self: end;
}

.owner-stmt-wf-deduction {
  font-variant-numeric: tabular-nums;
  color: var(--state-error);
}

.owner-stmt-wf-row.is-basis .owner-stmt-wf-deduction,
.owner-stmt-wf-row.is-final .owner-stmt-wf-deduction {
  color: var(--text-soft);
}

.owner-stmt-wf-pct {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.owner-stmt-wf-arrow {
  color: var(--text-muted);
}

.owner-stmt-wf-remainder {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
  justify-self: end;
}

.owner-stmt-payout {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}

.owner-stmt-payout span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
}

.owner-stmt-payout strong {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* ── Analytics cards ── */

.owner-stmt-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
}

.owner-stmt-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin-bottom: 0;
}

.owner-stmt-stat-card svg {
  color: var(--accent);
}

.owner-stmt-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.owner-stmt-stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

/* ── Channel mix ── */

.owner-stmt-channel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.owner-stmt-channel-pill {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-width: 110px;
}

.owner-stmt-channel-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

.owner-stmt-channel-gross {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.owner-stmt-channel-count {
  font-size: 0.72rem;
}

/* ── Owner fees & services ── */

.owner-stmt-charges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.owner-stmt-charges-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.owner-stmt-charge-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.1rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.owner-stmt-charge-row:last-child {
  border-bottom: none;
}

.owner-stmt-charge-label {
  color: var(--text-soft);
  flex: 1 1 auto;
  min-width: 0;
}

.owner-stmt-charge-date {
  font-size: 0.74rem;
  white-space: nowrap;
}

.owner-stmt-charge-amount {
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Generate/Preview/Send modal ── */

.owner-stmt-modal-backdrop {
  z-index: 2200;
}

.owner-stmt-modal {
  min-width: min(100%, 560px);
  max-width: 720px;
  max-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.25rem;
  overflow: hidden;
}

.owner-stmt-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.owner-stmt-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.owner-stmt-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.owner-stmt-modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.owner-stmt-modal-subject {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.owner-stmt-narrative {
  overflow-y: auto;
  max-height: 220px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.owner-stmt-narrative :is(h1, h2, h3, h4, h5, h6) {
  color: var(--text-primary);
  margin: 0.6rem 0 0.3rem;
}

.owner-stmt-narrative p {
  margin: 0 0 0.6rem;
}

.owner-stmt-narrative ul,
.owner-stmt-narrative ol {
  margin: 0 0 0.6rem;
  padding-left: 1.2rem;
}

.owner-stmt-pdf-frame-wrap {
  flex: 1 1 auto;
  min-height: 280px;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-base, #fff);
}

.owner-stmt-pdf-frame {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: none;
  display: block;
}

/* Inbox @-mention toast stack — the instant, visible "you were mentioned" alert
   (Hakim 2026-07-01). Fixed top-right below the top bar; slides in and auto-dismisses. */
.inbox-toast-stack {
  position: fixed;
  top: 4.25rem;
  right: 1rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}
.inbox-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  animation: inbox-toast-in 160ms ease-out;
}
@keyframes inbox-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.inbox-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  flex: none;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.inbox-toast-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.inbox-toast-title {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text-strong, var(--foreground));
}
.inbox-toast-body {
  font-size: 0.8rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.inbox-toast-cta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.15rem;
}
.inbox-toast-x {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
}
.inbox-toast-x:hover {
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
  color: var(--text-strong, var(--foreground));
}

.owner-stmt-send-success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.6rem;
  background: color-mix(in srgb, var(--state-success) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--state-success) 35%, transparent);
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--state-success);
}

.owner-stmt-send-success svg {
  flex: 0 0 auto;
}

.owner-stmt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

@media (max-width: 768px) {
  .owner-stmt {
    padding: 0.9rem 0.85rem 1.5rem;
  }
  .owner-stmt-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .owner-stmt-toolbar-controls {
    justify-content: space-between;
  }
  .owner-stmt-wf-row {
    grid-template-columns: 1fr;
    row-gap: 0.2rem;
  }
  .owner-stmt-wf-detail,
  .owner-stmt-wf-arrow,
  .owner-stmt-wf-remainder {
    justify-self: start;
  }
  .owner-stmt-modal {
    min-width: 0;
    width: 100%;
    max-height: 92vh;
  }
}


/* MyStay — ID document review (portal module 2) */
.mystay-payments { margin-top: 10px; border-top: 1px solid var(--border-subtle); padding-top: 8px; }
.mystay-payments-title {
  display: flex; align-items: center; gap: 6px; margin: 0 0 5px;
  font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .03em;
}
.mystay-payments-list { display: flex; flex-direction: column; }
.mystay-payment-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}
.mystay-payment-row:last-child { border-bottom: 0; }
.mystay-payment-info { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 2px; }
.mystay-payment-name { overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 650; color: var(--text-primary); }
.mystay-payment-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--text-muted); }
.mystay-payment-meta strong { color: var(--text-primary); font-weight: 700; }
.mystay-payment-meta.is-refunded,
.mystay-payment-meta.is-refunded strong { color: var(--state-success); }
.mystay-payment-schedule-state.is-applied { color: var(--state-success); }
.mystay-payment-schedule-state.is-updating { color: var(--state-warning); }
.mystay-payment-schedule-state.is-failed { color: var(--state-danger); font-weight: 700; }
.mystay-payment-refund {
  flex: 0 0 auto; min-height: 30px; padding: 5px 9px; border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--state-danger, #dc2626) 42%, var(--border-strong));
  background: color-mix(in srgb, var(--state-danger, #dc2626) 7%, var(--surface-muted));
  color: var(--state-danger, #dc2626); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer;
}
.mystay-payment-refund:hover:not(:disabled) {
  border-color: var(--state-danger, #dc2626);
  background: color-mix(in srgb, var(--state-danger, #dc2626) 12%, var(--surface-muted));
}
.mystay-payment-refund:disabled { opacity: .55; cursor: default; }
.mystay-payment-actions { flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.mystay-payment-change { min-height: 30px; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface-muted); color: var(--text-primary); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
.mystay-payment-change:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mystay-payment-change:disabled { opacity: .55; cursor: default; }
.mystay-payment-complete { flex: 0 0 auto; font-size: 11px; font-weight: 650; color: var(--text-muted); }

.mystay-action-notice { margin: 8px 0 0; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--state-success) 34%, var(--border-subtle)); border-radius: 8px; background: color-mix(in srgb, var(--state-success) 8%, var(--surface)); color: var(--text-primary); font-size: 11px; line-height: 1.45; }

.mystay-idreview { margin-top: 10px; border-top: 1px solid var(--border-subtle); padding-top: 8px; container-type: inline-size; }
.mystay-idreview-title { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.mystay-idreview-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.mystay-idreview-row.is-declining { flex-wrap: wrap; }
.mystay-idreview-row.has-owner { flex-wrap: wrap; }
.mystay-upsell-schedule { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid var(--border-subtle); border-radius: 9px; background: color-mix(in srgb, var(--surface-raised) 88%, transparent); }
.mystay-upsell-schedule > span:first-child { min-width: 0; display: grid; gap: 2px; }
.mystay-upsell-schedule strong { font-size: 12px; color: var(--text-primary); }
.mystay-upsell-schedule small { font-size: 11px; color: var(--text-muted); }
.mystay-upsell-schedule-edit { width: 100%; display: grid; grid-template-columns: minmax(120px, 1fr) minmax(100px, .8fr); gap: 8px; padding: 10px; border: 1px solid var(--border-subtle); border-radius: 9px; }
.mystay-upsell-schedule-edit label { display: grid; gap: 4px; min-width: 0; font-size: 11px; color: var(--text-muted); }
.mystay-upsell-schedule-edit label:nth-child(3), .mystay-upsell-schedule-edit .mystay-idreview-actions { grid-column: 1 / -1; }
.mystay-upsell-schedule-edit input { min-width: 0; width: 100%; box-sizing: border-box; border: 1px solid var(--border-subtle); border-radius: 7px; background: var(--surface-raised); color: var(--text-primary); font: inherit; padding: 7px 8px; }
@container (max-width: 360px) { .mystay-upsell-schedule, .mystay-upsell-schedule-edit { display: grid; grid-template-columns: 1fr; } .mystay-upsell-schedule-edit label:nth-child(3), .mystay-upsell-schedule-edit .mystay-idreview-actions { grid-column: 1; } }
.mystay-idreview-thumb { flex: none; display: block; width: 44px; height: 32px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border-subtle); }
.mystay-idreview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mystay-idreview-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mystay-idreview-kind { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.mystay-idreview-type { font-weight: 500; color: var(--text-muted); }
.mystay-idreview-status { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }
.mystay-idreview-status--approved { color: var(--state-success); }
.mystay-idreview-status--rejected { color: #dc2626; }
/* The card-hold status is a sentence ("card held — approve to charge…"), not a
   one-word status — capitalizing every word reads wrong. */
.mystay-idreview-status--held { text-transform: none; }
.mystay-deposit-control {
  margin-top: 10px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
  display: grid;
  gap: 8px;
}
.mystay-deposit-heading,
.mystay-deposit-status { display: flex; align-items: flex-start; gap: 8px; }
.mystay-deposit-heading > span:last-child,
.mystay-deposit-status > span { display: grid; min-width: 0; gap: 1px; }
.mystay-deposit-heading strong,
.mystay-deposit-status strong { font-size: 12px; color: var(--text-primary); }
.mystay-deposit-heading small,
.mystay-deposit-status small { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.mystay-deposit-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.mystay-deposit-status {
  padding: 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--surface-subtle, var(--surface));
}
.mystay-deposit-status.is-held { color: var(--accent); }
.mystay-deposit-status.is-done { color: var(--state-success); }
.mystay-deposit-status.is-warning,
.mystay-deposit-status.is-captured { color: #dc2626; }
.mystay-deposit-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mystay-deposit-actions button,
.mystay-deposit-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  padding: 5px 10px;
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.mystay-deposit-actions button:hover:not(:disabled),
.mystay-deposit-retry:hover { border-color: var(--accent); color: var(--accent); }
.mystay-deposit-actions button.is-danger { color: #b91c1c; }
.mystay-deposit-actions button.is-danger:hover:not(:disabled) { border-color: #dc2626; color: #dc2626; }
.mystay-deposit-actions button:disabled { opacity: .55; cursor: default; }
.mystay-deposit-decision {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--surface-subtle, var(--surface));
}
.mystay-deposit-decision > strong { font-size: 12px; color: var(--text-primary); }
.mystay-deposit-decision > span { font-size: 11px; line-height: 1.45; color: var(--text-muted); }
.mystay-deposit-decision label { display: grid; gap: 4px; font-size: 11px; font-weight: 650; color: var(--text-secondary); }
.mystay-deposit-decision input,
.mystay-deposit-decision textarea {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-primary);
  padding: 7px 8px;
  font: inherit;
  font-size: 12px;
  resize: vertical;
}
.mystay-deposit-decision input:focus,
.mystay-deposit-decision textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
.mystay-idreview-error { font-size: 12px; color: #dc2626; margin: 4px 0 0; }
.mystay-idreview-recovery { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mystay-idreview-recovery .mystay-idreview-error { margin-top: 0; }
.mystay-idreview-actions { display: flex; gap: 6px; }
.mystay-idreview-actions button {
  font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--surface-muted); color: var(--text-primary);
  padding: 3px 8px;
}
.mystay-idreview-actions button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.mystay-idreview-actions button:disabled { opacity: 0.5; cursor: default; }
.mystay-decline-note {
  display: flex; width: 100%; flex-direction: column; gap: 8px; padding: 10px;
  border: 1px solid color-mix(in srgb, var(--state-danger, #dc2626) 28%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--state-danger, #dc2626) 5%, var(--surface));
}
.mystay-decline-note:focus { outline: 2px solid color-mix(in srgb, var(--state-danger, #dc2626) 28%, transparent); outline-offset: 2px; }
.mystay-decline-confirm-copy { display: flex; flex-direction: column; gap: 2px; font-size: 12px; line-height: 1.4; }
.mystay-decline-confirm-copy strong { color: var(--text-primary); font-weight: 750; }
.mystay-decline-confirm-copy span { color: var(--text-muted); }
.mystay-decline-note label { font-size: 12px; font-weight: 650; color: var(--text-muted); }
.mystay-decline-note textarea { width: 100%; resize: vertical; border: 1px solid var(--border-subtle); border-radius: 8px; padding: 8px 10px; background: var(--surface); color: var(--text-primary); font: inherit; font-size: 12px; line-height: 1.4; }
.mystay-decline-note textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 30%, transparent); border-color: var(--accent); }
.mystay-decline-note > .mystay-idreview-actions { justify-content: flex-start; }
.portal-action-owner {
  flex: 0 0 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 9px; border: 1px solid color-mix(in srgb, var(--state-warning) 42%, var(--border-subtle));
  border-radius: 9px; background: color-mix(in srgb, var(--state-warning) 8%, var(--surface));
}
.portal-action-owner.is-claimed {
  border-color: color-mix(in srgb, var(--state-success) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-success) 7%, var(--surface));
}
.portal-action-owner-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.portal-action-owner-copy strong { font-size: 11.5px; line-height: 1.35; color: var(--text-primary); }
.portal-action-owner-copy small { font-size: 10.5px; line-height: 1.35; color: var(--text-muted); }
.portal-action-owner > button {
  flex: 0 0 auto; min-height: 31px; padding: 5px 9px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); color: var(--text-primary);
  font: inherit; font-size: 10.5px; font-weight: 750; cursor: pointer;
}
.portal-action-owner > button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.portal-action-owner > button:disabled { opacity: .55; cursor: default; }
.portal-action-owner > p { flex: 0 0 100%; margin: 0; font-size: 10.5px; color: var(--state-danger, #dc2626); }

/* One Inbox-native portal action card, mounted above the conversation timeline
   on desktop and phone. It reuses MyStay's review rows; tokens keep light/dark
   parity and the compact layout wraps cleanly on narrow screens. */
.guest-portal-actions{
  flex:0 0 auto; margin:10px 16px 0; padding:11px 13px 12px;
  border:1px solid color-mix(in srgb, var(--state-warning) 34%, var(--border-subtle));
  border-radius:12px;
  background:color-mix(in srgb, var(--state-warning) 7%, var(--bg-elevated));
  box-shadow:0 7px 22px -18px color-mix(in srgb, var(--state-warning) 65%, transparent);
}
.guest-portal-actions.is-probing{ display:none; }
.guest-portal-actions.is-collapsed{ padding-bottom:11px; }
.guest-portal-actions-head{ display:flex; align-items:center; gap:9px; }
.guest-portal-actions-icon{
  width:30px; height:30px; flex:0 0 30px; border-radius:9px;
  display:grid; place-items:center; color:var(--state-warning);
  background:color-mix(in srgb, var(--state-warning) 15%, transparent);
}
.guest-portal-actions-copy{ display:flex; flex:1; flex-direction:column; gap:1px; min-width:0; }
.guest-portal-actions-head strong{ font-size:13px; color:var(--text-primary); }
.guest-portal-actions-head small{ font-size:11.5px; color:var(--text-muted); }
.guest-portal-actions-toggle{
  min-height:32px; flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; gap:4px;
  padding:5px 8px; border:1px solid var(--border-strong); border-radius:8px;
  background:color-mix(in srgb, var(--surface) 78%, transparent); color:var(--text-primary);
  font:inherit; font-size:11px; font-weight:700; cursor:pointer;
}
.guest-portal-actions-toggle:hover{ border-color:var(--accent); color:var(--accent); }
.guest-portal-actions-toggle:focus-visible{ outline:2px solid color-mix(in srgb, var(--accent) 32%, transparent); outline-offset:2px; }
.guest-portal-actions-body[hidden]{ display:none; }
.guest-portal-actions .mystay-idreview{ margin-top:9px; padding-top:8px; }
.guest-portal-actions .mystay-idreview-actions{ flex-wrap:wrap; justify-content:flex-end; }
.guest-portal-actions .mystay-idreview-actions button{ min-height:32px; padding:6px 10px; }
.mystay-idreview-row.has-decision{ flex-wrap:wrap; }
.upsell-decision{
  flex:0 0 100%; min-width:0; margin-top:5px; overflow:hidden;
  border:1px solid var(--border-subtle); border-radius:11px;
  background:color-mix(in srgb, var(--surface) 82%, transparent);
}
.upsell-decision--conflict{ border-color:color-mix(in srgb, var(--state-danger, #dc2626) 42%, var(--border-subtle)); }
.upsell-decision--attention{ border-color:color-mix(in srgb, var(--state-warning, #f59e0b) 42%, var(--border-subtle)); }
.upsell-decision--clear{ border-color:color-mix(in srgb, var(--state-success, #22c55e) 36%, var(--border-subtle)); }
.upsell-decision-toggle{
  width:100%; min-height:42px; padding:8px 10px; border:0; cursor:pointer;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  background:transparent; color:var(--text-primary); font:inherit; text-align:left;
}
.upsell-decision-toggle:hover{ background:color-mix(in srgb, var(--accent) 5%, transparent); }
.upsell-decision-toggle > span{ min-width:0; display:grid; grid-template-columns:auto minmax(0, 1fr); align-items:center; gap:6px; }
.upsell-decision-toggle strong{ font-size:11.5px; }
.upsell-decision-toggle small{ grid-column:1 / -1; min-width:0; padding-left:21px; overflow-wrap:anywhere; font-size:11px; line-height:1.35; color:var(--text-muted); }
.upsell-decision-body{ display:flex; flex-direction:column; gap:9px; padding:0 10px 10px; }
.upsell-decision-assessment{
  display:flex; flex-direction:column; gap:2px; padding:8px 9px; border-radius:9px;
  background:var(--surface-muted); color:var(--text-primary);
}
.upsell-decision-assessment strong{ font-size:12px; }
.upsell-decision-assessment span{ font-size:11px; line-height:1.45; color:var(--text-muted); }
.upsell-decision-assessment.is-conflict{ background:color-mix(in srgb, var(--state-danger, #dc2626) 9%, var(--surface-muted)); }
.upsell-decision-assessment.is-attention{ background:color-mix(in srgb, var(--state-warning, #f59e0b) 10%, var(--surface-muted)); }
.upsell-decision-assessment.is-clear{ background:color-mix(in srgb, var(--state-success, #22c55e) 8%, var(--surface-muted)); }
.upsell-decision-facts{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:6px; }
.upsell-decision-facts > span{
  min-width:0; display:flex; flex-direction:column; gap:2px; padding:7px 8px;
  border:1px solid var(--border-subtle); border-radius:8px; background:var(--surface-muted);
}
.upsell-decision-facts small{ font-size:9.5px; color:var(--text-muted); }
.upsell-decision-facts strong{ font-size:10.5px; line-height:1.35; color:var(--text-primary); }
.upsell-decision-task-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:10px; }
.upsell-decision-task-head > span{ display:flex; min-width:0; flex-direction:column; gap:1px; }
.upsell-decision-task-head strong{ font-size:11.5px; color:var(--text-primary); }
.upsell-decision-task-head small{ font-size:10.5px; color:var(--text-muted); }
.upsell-decision-calendar,
.upsell-decision-task > a,
.upsell-decision-task > button{
  display:inline-flex; align-items:center; justify-content:center; gap:5px; flex:0 0 auto;
  min-height:29px; padding:5px 8px; border:1px solid var(--border-strong); border-radius:7px;
  background:var(--surface); color:var(--text-primary); font:inherit; font-size:10.5px; font-weight:700;
  text-decoration:none; cursor:pointer;
}
.upsell-decision-calendar:hover,
.upsell-decision-task > a:hover,
.upsell-decision-task > button:hover{ border-color:var(--accent); color:var(--accent); }
.upsell-decision-tasks{ display:flex; flex-direction:column; border-top:1px solid var(--border-subtle); }
.upsell-decision-task{ display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--border-subtle); }
.upsell-decision-task-copy{ display:flex; min-width:0; flex:1; flex-direction:column; gap:1px; }
.upsell-decision-task-copy strong{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11.5px; color:var(--text-primary); }
.upsell-decision-task-copy small{ font-size:10px; line-height:1.35; color:var(--text-muted); }
.upsell-decision-empty,
.upsell-decision-footnote{ margin:0; font-size:10.5px; line-height:1.4; color:var(--text-muted); }
.upsell-decision-footnote{ padding-top:1px; font-style:italic; }
.ph-convo .guest-portal-actions{
  margin:8px 10px 0; border-color:color-mix(in srgb, #f59e0b 38%, var(--ph-line));
  background:color-mix(in srgb, #f59e0b 8%, var(--ph-card));
}
.ph-convo .guest-portal-actions-head strong,
.ph-convo .guest-portal-actions .mystay-idreview-kind{ color:var(--ph-text); }
.ph-convo .guest-portal-actions-head small,
.ph-convo .guest-portal-actions .mystay-idreview-title,
.ph-convo .guest-portal-actions .mystay-idreview-status{ color:var(--ph-text-2); }
.ph-convo .guest-portal-actions-toggle{
  border-color:var(--ph-line); background:color-mix(in srgb, var(--ph-card) 82%, var(--ph-bg)); color:var(--ph-text);
}
.ph-convo .portal-action-owner { border-color: color-mix(in srgb, #f59e0b 42%, var(--ph-line)); background: color-mix(in srgb, #f59e0b 8%, var(--ph-card)); }
.ph-convo .portal-action-owner.is-claimed { border-color: color-mix(in srgb, #22c55e 34%, var(--ph-line)); background: color-mix(in srgb, #22c55e 7%, var(--ph-card)); }
.ph-convo .portal-action-owner-copy strong { color: var(--ph-text); }
.ph-convo .portal-action-owner-copy small { color: var(--ph-text-2); }
.ph-convo .portal-action-owner > button { border-color: var(--ph-line); background: var(--ph-card); color: var(--ph-text); }
.ph-convo .upsell-decision{ background:color-mix(in srgb, var(--ph-card) 90%, transparent); border-color:var(--ph-line); }
.ph-convo .upsell-decision-toggle,
.ph-convo .upsell-decision-assessment strong,
.ph-convo .upsell-decision-facts strong,
.ph-convo .upsell-decision-task-head strong,
.ph-convo .upsell-decision-task-copy strong{ color:var(--ph-text); }
.ph-convo .upsell-decision-toggle small,
.ph-convo .upsell-decision-assessment span,
.ph-convo .upsell-decision-facts small,
.ph-convo .upsell-decision-task-head small,
.ph-convo .upsell-decision-task-copy small,
.ph-convo .upsell-decision-empty,
.ph-convo .upsell-decision-footnote{ color:var(--ph-text-2); }
.ph-convo .upsell-decision-assessment,
.ph-convo .upsell-decision-facts > span{ background:color-mix(in srgb, var(--ph-card) 76%, var(--ph-bg)); border-color:var(--ph-line); }
@container (max-width: 430px){
  .mystay-idreview-row.has-decision{
    display:grid; grid-template-columns:minmax(0, 1fr); align-items:start; gap:8px;
  }
  .mystay-idreview-row.has-decision > .mystay-idreview-info,
  .mystay-idreview-row.has-decision > .mystay-idreview-actions,
  .mystay-idreview-row.has-decision > .upsell-decision{ width:100%; box-sizing:border-box; }
  .mystay-idreview-row.has-decision > .mystay-idreview-actions{
    display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); justify-content:stretch;
  }
  .mystay-idreview-row.has-decision > .mystay-idreview-actions button{
    min-width:0; min-height:34px; padding:6px 8px; white-space:normal;
  }
  .mystay-idreview-row.has-decision > .mystay-idreview-actions .is-change-option{
    grid-column:1 / -1; grid-row:2;
  }
  .upsell-decision-facts{ grid-template-columns:1fr; }
  .upsell-decision-task-head{ align-items:flex-start; flex-direction:column; }
}
@media (max-width: 600px){
  .mystay-payment-row { align-items: flex-start; flex-wrap: wrap; gap: 7px; padding: 10px 0; }
  .mystay-payment-refund { min-height: 38px; padding: 8px 12px; }
  .mystay-payment-actions { width: 100%; justify-content: flex-start; }
  .mystay-payment-change { min-height: 38px; padding: 8px 12px; }
  .guest-portal-actions .mystay-idreview-row{ align-items:flex-start; flex-wrap:wrap; }
  .guest-portal-actions .mystay-idreview-actions{ width:100%; padding-left:0; justify-content:flex-start; }
  .guest-portal-actions .mystay-idreview-actions button{ min-height:38px; padding:8px 12px; }
  .portal-action-owner { align-items: stretch; flex-direction: column; }
  .portal-action-owner > button { width: 100%; min-height: 38px; }
  .guest-portal-actions-toggle{ min-height:38px; padding:7px 9px; }
  .guest-portal-actions .mystay-idreview-recovery .mystay-idreview-actions{ width:auto; padding-left:0; }
  .upsell-decision-facts{ grid-template-columns:1fr; }
  .upsell-decision-task-head{ align-items:flex-start; }
  .upsell-decision-task{ align-items:flex-start; flex-direction:column; }
  .upsell-decision-task > a,
  .upsell-decision-task > button{ width:100%; min-height:38px; }
}

/* Sensitive tag on access-code dynamic fields (slash menu + fields dropdown) */
.property-intel-sensitive-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b45309;
  background: color-mix(in srgb, #f59e0b 16%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 40%, transparent);
}

/* ============================================================
   PHONE TIER (≤640px) — first-class mobile-browser support.
   The fixed nav rail is replaced by AppNav's hamburger + overlay
   drawer (JS-driven via matchMedia — --content-offset is an inline
   style on <html>, so a stylesheet @media can never override it).
   Everything below is additive; desktop is untouched.
   ============================================================ */

/* --- Hamburger + drawer (rendered only on phone by AppNav) --- */
.phone-nav-burger {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 40;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
body:has(.auth-shell) .phone-nav-burger {
  display: none;
}
.phone-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 10, 22, 0.5);
}
.phone-nav-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 84vw);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: phone-drawer-in 0.18s ease;
}
@keyframes phone-drawer-in {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
.phone-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.phone-nav-head svg {
  max-height: 26px;
  width: auto;
}
.phone-nav-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.phone-nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.phone-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.phone-nav-link .side-nav-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}
.phone-nav-link.is-active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
}
.phone-nav-group {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.phone-nav-group-title {
  margin: 0 0 2px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.phone-nav-sublink {
  padding: 8px 10px 8px 40px;
  font-weight: 500;
  font-size: 0.9rem;
}
.phone-nav-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

@media (max-width: 640px) {
  /* Safe areas: with viewport-fit=cover (app/layout.tsx) the WKWebView shell
     and standalone Safari draw us under the status bar / home indicator —
     env() insets are 0 everywhere else, so this is inert in normal browsers.
     overscroll-behavior kills the body rubber-band that makes the page feel
     like it floats loose inside the native shell. */
  body {
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    overscroll-behavior-y: none;
  }

  /* THE FRAME LOCK. Desktop already scrolls every pane internally — the
     shell is a viewport-height grid. On phone the body's safe-area padding
     plus .app-content's min-height:100vh made the DOCUMENT taller than the
     screen, so iOS scrolled the whole app: chrome slid under the status bar
     and the page "floated" (the single worst handling defect on device).
     A native app's chrome never moves. Pin the body as a fixed non-scrolling
     frame and hand the shell an exact height chain; only inner panes scroll.
     Scoped to the workspace shell so public surfaces (guest portal, auth,
     storefront) keep normal document scroll. */
  body:has(.workspace-shell) {
    position: fixed;
    inset: 0;
    overflow: hidden;
  }
  body:has(.workspace-shell) .app-shell,
  body:has(.workspace-shell) .app-content {
    height: 100%;
    min-height: 0;
  }
  body:has(.workspace-shell) .workspace-shell {
    height: 100%;
  }

  /* Native touch texture: chrome (buttons, tabs, nav, pane heads) must not
     sprout the iOS long-press text-selection loupe / callout — that is the
     tell of a webpage. Message bubbles and inputs keep selection. */
  .workspace-topbar,
  .phone-nav-drawer,
  .workspace-shell button,
  .workspace-shell [role="button"],
  .workspace-shell [role="tab"],
  .workspace-shell .workspace-pane-head {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }

  /* position:fixed ignores body padding — offset the burger + drawer manually. */
  .phone-nav-burger {
    top: calc(10px + env(safe-area-inset-top, 0px));
  }
  .phone-nav-drawer {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
  }

  /* Belt-and-braces: kill the SSR-first-paint rail flash (AppNav renders the
     desktop rail for one frame until matchMedia resolves). */
  .side-nav-stack {
    display: none;
  }

  /* The legacy ≤1020px tablet rule pins .app-content to an 80px rail inset —
     on phone there is NO rail, so content is full-bleed. */
  .app-content {
    padding-left: 0;
  }

  /* --- Topbar: clear the hamburger, show only the ACTIVE tab, drop
         low-priority chrome. --- */
  .workspace-topbar {
    margin-left: 52px;
  }
  .workspace-tab:not(.active) {
    display: none;
  }
  .workspace-tab-pin,
  .workspace-tab-close,
  .workspace-kbd {
    display: none;
  }
  .workspace-topbar .ws-pane-toggle,
  .workspace-topbar .workspace-newmenu-btn,
  .workspace-topbar .workspace-messages-wrap,
  .workspace-topbar .workspace-roadmap-wrap,
  .workspace-topbar .workspace-whatsnew-wrap,
  .workspace-topbar .workspace-tab-overflow,
  .workspace-topbar .workspace-tab-add,
  .workspace-topbar [aria-label="Open action history"] {
    display: none;
  }

  /* --- Master-detail back pill: a compact circular chevron that overlays
         the top-left of the main pane instead of eating a full row. --- */
  .workspace-main-pane.is-compact-main {
    position: relative;
  }
  .workspace-main-pane.is-compact-main > .workspace-compact-back {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 6;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    justify-content: center;
    font-size: 0; /* hides the bare text label; the chevron keeps its own size */
    background: var(--bg-elevated);
  }
  .workspace-compact-back-chevron {
    font-size: 1.3rem;
  }

  /* Registry detail cards (fees / chart of accounts): clear the overlaid back
     chevron (36px circle at 8px inset) so it never covers the page title. */
  .workspace-main-pane.is-compact-main .registry-detail-card > header h2 {
    margin-left: 46px;
  }

  /* Documents editor toolbar: same clearance — the overlaid chevron was
     sitting on top of the toolbar's own "← Drive" button. */
  .workspace-main-pane.is-compact-main .doc-toolbar {
    padding-left: 46px;
  }

  /* Generalised chevron clearance: every first-row surface the overlaid
     back chevron was found covering (property/website tab strips, the
     accounting intro-card headings). One rule per surface family beats
     rediscovering this per page. */
  .workspace-main-pane.is-compact-main .properties-middle-tabs {
    padding-left: 46px;
  }
  .workspace-main-pane.is-compact-main .registry-empty > h2 {
    margin-left: 46px;
  }

  /* Topbar active tab: ellipsize long labels ("Property Operations")
     instead of letting the pill run under the search button. */
  .workspace-tab .workspace-tab-label {
    max-width: 26vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Topbar dropdowns (notifications, account): they anchor right:0 on
     their 320px-min panels, which hangs them off the LEFT edge of a
     375px screen. Pin to the viewport instead, under the topbar. */
  .workspace-channel-notifications-menu,
  .workspace-account-menu {
    position: fixed;
    left: 8px;
    right: 8px;
    top: calc(58px + env(safe-area-inset-top, 0px));
    min-width: 0;
    max-width: none;
  }

  /* Tasks list: the 10-column desktop grid crushed the title column to
     zero width (only chips and T-numbers survived). Reflow as a wrapping
     row — controls + number/title first, metadata flowing after — and
     drop the drag grip and listing chips (no drag on touch; listing
     context lives inside the task). */
  .task-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    /* Card chrome (same pattern as the Reservations phone list): the
       title→metadata gap inside a row matches the row→row gap, so only
       an explicit card boundary makes the grouping unambiguous. */
    margin: 6px 8px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-elevated);
    /* Desktop pins rows to --tasks-row-h; the wrapped second line needs
       the card to grow. */
    height: auto;
    min-height: var(--tasks-row-h);
  }
  .task-avatar.is-empty {
    display: none;
  }
  /* Drop what has no phone job: drag grip (no drag on touch), bulk-select
     checkbox, hover action icons, listing chips — all live in the task
     detail. What remains gets an explicit two-line order: line 1 =
     complete + priority + title + assignee, line 2 = type/status/due. */
  .task-row-grip,
  .task-row-checkbox,
  .task-row-actions,
  .task-row-listings {
    display: none;
  }
  .task-row-complete { order: 1; }
  .task-row-priority { order: 2; }
  .task-row-title-block {
    order: 3;
    /* Wide flex-basis forces the metadata cluster onto its own second
       line (basis 0 would let it cram back onto line 1). */
    flex: 1 1 55%;
    min-width: 0;
  }
  .task-row-assignees { order: 4; }
  .task-row-type { order: 5; margin-left: 30px; }
  .task-row-status { order: 6; }
  .task-row-due { order: 7; }
  .task-row-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Canonical segmented control: fill the row and shrink labels with
     ellipsis instead of clipping mid-glyph ("Short-le"). */
  .segmented-control {
    display: flex;
    max-width: 100%;
  }
  .segmented-control-btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  /* Inner label spans are flex containers, which cannot ellipsize bare
     text — flatten them to blocks so text-overflow engages. The
     rental-mode icons yield their width to the label (text wins at
     phone size; the icon carried no extra meaning). */
  .segmented-control-btn > span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sp-rentalmode-opt svg {
    display: none;
  }

  /* Phone pricing and stays is the canonical pricing component inside a
     single-column phone screen, not the desktop Properties pane squeezed down. */
  .ph-pricing-app .ph-screen {
    overflow: hidden;
  }
  .ph-pricing-title-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  .ph-pricing-title-wrap > span {
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .ph-pricing-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }
  .ph-pricing-body .sp-tab-outer {
    height: auto;
    min-height: 100%;
  }
  .ph-pricing-body .sp-scroll-area {
    overflow: visible;
  }
  .ph-pricing-body .sp-root {
    width: 100%;
    padding: 0.65rem 0.6rem 6rem;
  }
  .ph-pricing-body .sp-subtab-nav {
    grid-template-columns: 1fr;
  }
  .ph-pricing-body .sp-subtab-nav-sub {
    white-space: normal;
  }

  /* --- Inbox thread header: one tight identity row + a single-line,
         horizontally-scrollable context strip (was one word per line). --- */
  .inbox-chat-head {
    padding: 0.45rem 0.55rem 0.45rem;
    gap: 0.35rem;
    flex-wrap: wrap;
  }
  .inbox-chat-title-row {
    flex-wrap: nowrap;
    min-width: 0;
  }
  .inbox-chat-title {
    font-size: 0.98rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .inbox-head-tags {
    display: none; /* tag chips live in Details on phone; the manage trigger stays */
  }
  .inbox-chat-sub {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-width: calc(100vw - 24px);
  }
  .inbox-chat-sub::-webkit-scrollbar {
    display: none;
  }
  .inbox-chat-sub > span {
    flex: 0 0 auto;
  }
  .inbox-chat-head-actions {
    gap: 4px;
  }
  /* Density + transcript-export are desktop niceties — drop them on phone. */
  .inbox-chat-head-actions [title="Export transcript (.txt)"],
  .inbox-chat-head-actions [aria-label^="Activity:"],
  .inbox-chat-head-actions [title^="Activity:"] {
    display: none;
  }

  /* The email bubbles and composer benefit from edge-to-edge width. */
  .inbox-chat-head,
  .inbox-compose {
    min-width: 0;
  }
}

/* ── Inbox details rail — loading skeletons (2026-07-10) ─────────────────────
   Shimmer placeholders for pane-4's async sections (identity card, linked
   tasks, shared files) built on the app-wide .skel drop-in. Rendered by
   InboxCrmDetails.tsx while each section's fetch is in flight. */
.inbox-crm-skel-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inbox-crm-skel-lines {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 7px;
}
.inbox-crm-skel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.inbox-crm-skel-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inbox-crm-skel-row .skel {
  flex: 0 0 auto;
}
.inbox-crm-skel-row .skel:last-child {
  flex: 0 1 auto;
}

/* The full CRM graph is a separate Inbox chunk. Reserve the same substantial
   record and property shapes while that optional chunk arrives so opening
   Details never collapses the support rail or shifts the conversation. */
.inbox-crm-chunk-loading {
  min-height: 480px;
}
.inbox-support-chunk-loading {
  min-height: 340px;
  display: grid;
  align-content: start;
  gap: 14px;
}
.inbox-support-chunk-back {
  width: 132px;
  height: 16px;
}
.inbox-support-chunk-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
}

/* ==========================================================================
   Native file preview (2026-07-14) — in-app rendering for all document + media
   types. `.fp-*` = the shared FilePreview renderer (full-screen viewer stage,
   components/inbox/FilePreview.tsx). Inline-bubble additions (video/audio/typed
   cards) extend the existing .inbox-file-card / .inbox-bubble-* rules.
   Theme-aware via tokens; verified light + dark.
   ========================================================================== */

/* --- FilePreview: media --------------------------------------------------- */
.fp-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.fp-img.is-zoom { max-width: none; max-height: none; cursor: zoom-out; }
.fp-video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  background: #000;
  border-radius: 6px;
  display: block;
}
.fp-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.fp-audio-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px;
  text-align: center;
  color: var(--text-soft);
}
.fp-audio-wrap .fp-card-name { color: var(--text-primary); font-weight: 600; font-size: 14px; word-break: break-all; }
.fp-audio { width: min(520px, 90%); }

/* --- FilePreview: document (docx html), sheet, text ----------------------- */
.fp-doc {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: #fff;
  display: block;
}
.fp-doc .inbox-email-frame { width: 100%; border: 0; }

.fp-sheet-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-elevated);
}
.fp-sheet-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px 0;
  overflow-x: auto;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border-subtle);
}
.fp-sheet-tab {
  border: 1px solid transparent;
  border-bottom: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  white-space: nowrap;
}
.fp-sheet-tab.is-active {
  color: var(--text-primary);
  background: var(--surface-muted);
  border-color: var(--border-subtle);
}
.fp-sheet-scroll { flex: 1; overflow: auto; min-height: 0; }
.fp-sheet {
  border-collapse: collapse;
  font-size: 12.5px;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.fp-sheet th,
.fp-sheet td {
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  text-align: left;
  white-space: nowrap;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}
.fp-sheet thead th {
  position: sticky;
  top: 0;
  background: var(--surface-muted);
  font-weight: 700;
  z-index: 1;
}
.fp-sheet-rownum {
  position: sticky;
  left: 0;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-weight: 600;
  text-align: right !important;
  user-select: none;
}

.fp-text-wrap {
  width: 100%;
  height: 100%;
  overflow: auto;
  background: var(--bg-elevated);
}
.fp-text {
  margin: 0;
  padding: 18px 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

.fp-archive {
  width: min(920px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.fp-archive-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}
.fp-archive-head span { color: var(--text-muted); font-size: 12px; }
.fp-archive-list { flex: 1; min-height: 0; overflow: auto; }
.fp-archive-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto minmax(64px, auto);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
}
.fp-archive-kind { color: var(--text-muted); text-align: center; }
.fp-archive-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-archive-lock {
  color: var(--text-soft);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
}
.fp-archive-size {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* --- FilePreview: typed card + states ------------------------------------- */
.fp-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 28px;
  text-align: center;
  max-width: 420px;
}
.fp-card-icon { color: var(--text-muted); }
.fp-card-name { font-size: 14px; font-weight: 600; color: var(--text-primary); word-break: break-all; }
.fp-card-sub { font-size: 13px; color: var(--text-soft); }
.fp-card-hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; max-width: 320px; }
.fp-card-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.fp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.fp-btn:hover { background: var(--surface-muted); }
.fp-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}
.fp-btn-primary:hover { filter: brightness(1.05); background: var(--accent); }
.fp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  font-size: 13px;
}
.fp-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  animation: fp-spin 0.8s linear infinite;
}
@keyframes fp-spin { to { transform: rotate(360deg); } }
.fp-empty,
.fp-note { color: var(--text-muted); font-size: 12.5px; padding: 12px 16px; text-align: center; }
.fp-note { flex: 0 0 auto; border-top: 1px solid var(--border-subtle); }

/* --- Inline chat bubble: native video/audio + typed document cards -------- */
.inbox-bubble-video {
  display: block;
  margin-bottom: 0.3rem;
  border-radius: 8px;
  overflow: hidden;
  width: min(320px, 100%);
  max-width: 320px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border-subtle);
  background: #000;
  position: relative;
}
.inbox-bubble-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Typed file card: two-line (name + kind) + a kind-accented icon. */
.inbox-file-card-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.inbox-file-card-kind { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.inbox-file-card-open { color: var(--text-muted); flex: 0 0 auto; margin-left: auto; }
/* Accent the icon by kind so a doc / sheet / slide / pdf read at a glance. */
.inbox-file-card-icon[data-kind="pdf"] { color: #dc2626; }
.inbox-file-card-icon[data-kind="word"] { color: #2563eb; }
.inbox-file-card-icon[data-kind="sheet"] { color: #16a34a; }
.inbox-file-card-icon[data-kind="slide"] { color: #ea580c; }
.inbox-file-card-icon[data-kind="audio"] { color: var(--accent); }
.inbox-file-card-icon[data-kind="text"],
.inbox-file-card-icon[data-kind="code"] { color: var(--text-soft); }

/* (Owner calendar has NO bespoke styling — it renders the property calendar's
   exact chrome: .property-calendar-tab, .property-calendar-toolbar,
   .property-calendar-task-chip. Only the data differs. Hard rule: same chrome
   across Listings/Owners views.) */

/* ---------------------------------------------------------------------------
   Settings → Lead capture (/settings/leads). Token-driven so light/dark work
   by construction; layout is mobile-first (rows wrap on small screens). The
   PUBLIC form's styles live in app/f/[slug]/lead-form.css, not here.
--------------------------------------------------------------------------- */

.leads-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.leads-primary-btn:disabled { opacity: 0.55; cursor: default; }

.leads-ghost-btn,
.leads-danger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.leads-danger-btn { color: var(--state-error); border-color: var(--state-error); }

.leads-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  cursor: pointer;
  flex: none;
}
.leads-icon-btn:hover { color: var(--text-primary); border-color: var(--border-strong); }

.leads-linklike {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0;
  cursor: pointer;
}
.leads-danger-link { color: var(--state-error); }

.leads-create-row,
.leads-inline-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.leads-create-row .properties-input-text { flex: 1 1 200px; }

.leads-empty {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 1rem;
}
.leads-empty p { margin: 0; }

.leads-list { display: flex; flex-direction: column; gap: 0.5rem; }
.leads-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-elevated);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  font: inherit;
  color: var(--text-primary);
}
.leads-row:hover { border-color: var(--border-strong); }
.leads-row-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.leads-row-name { font-weight: 700; }
.leads-row-sub { font-size: 0.8rem; }

.leads-pill {
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.leads-pill.on { color: var(--state-success); border-color: var(--state-success); }

.leads-back {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  padding: 0;
  margin-bottom: 0.4rem;
  cursor: pointer;
}
.leads-back:hover { color: var(--text-primary); }

.leads-head-actions { display: flex; align-items: center; gap: 0.75rem; flex: none; }
.leads-toggle { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; cursor: pointer; }
.leads-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

.leads-saved { color: var(--state-success); font-size: 0.8rem; margin: 0 0 0.5rem; }

.leads-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; margin-bottom: 1.25rem; }
@container settings-main (min-width: 900px) { .leads-grid { grid-template-columns: 1fr 1fr; } }
.leads-col { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }

.leads-h2 { font-size: 0.95rem; font-weight: 800; margin: 1rem 0 0.5rem; }
.leads-hint { font-size: 0.78rem; margin: 0.1rem 0 0.35rem; }

.leads-copy-row { display: flex; align-items: flex-start; gap: 0.4rem; margin-bottom: 0.4rem; min-width: 0; }
.leads-code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
}
.leads-snippet { flex: 1; font-family: ui-monospace, monospace; font-size: 0.75rem; resize: vertical; }
.leads-copied { color: var(--state-success); font-size: 0.75rem; align-self: center; }

/* Website chat settings (settings/chat-widgets) — shares the leads-* family so
   the two capture surfaces read as siblings. Theme tokens only (light/dark). */
.leads-copy-block { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.35rem 0; min-width: 0; }
.leads-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0 0 0.35rem;
}
.leads-back-btn:hover { color: var(--text-primary); }
.leads-editor-grid { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.75rem; }
.leads-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; }
.leads-field > span:first-child { font-weight: 700; font-size: 0.8rem; color: var(--text-secondary); }
.leads-check-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.leads-textarea { resize: vertical; font-family: inherit; }
.leads-advanced summary { cursor: pointer; font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); }
.leads-advanced[open] summary { margin-bottom: 0.5rem; }
.leads-color-input {
  width: 56px;
  height: 34px;
  padding: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-muted);
  cursor: pointer;
}

.leads-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.leads-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.2rem 0.35rem 0.2rem 0.6rem;
  font-size: 0.78rem;
}
.leads-chip button {
  display: inline-flex;
  border: 0;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}
.leads-chip-input { max-width: 240px; }

.leads-warn {
  color: var(--state-warning);
  border: 1px solid var(--state-warning);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  margin: 0 0 0.6rem;
}

.leads-fields { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.leads-field-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  padding: 0.5rem 0.6rem;
}
.leads-drag { color: var(--text-muted); cursor: grab; display: inline-flex; flex: none; }
.leads-field-label { flex: 2 1 180px; }
.leads-field-kind { flex: 1 1 120px; }
.leads-field-map { flex: 1 1 140px; }
.leads-required { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; flex: none; }
.leads-required input { accent-color: var(--accent); }
.leads-options { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.35rem; padding-left: 1.5rem; }

.leads-subs { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; }
.leads-subs-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.leads-subs-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.35rem 0.5rem;
}
.leads-subs-table td { border-bottom: 1px solid var(--border-subtle); padding: 0.45rem 0.5rem; vertical-align: top; }
.leads-subs-table a { color: var(--accent); }
.leads-subs-answers { display: flex; flex-direction: column; gap: 0.15rem; }
.leads-answer b { font-weight: 600; }
.leads-journey-cell { min-width: 170px; }
.leads-stage-menu { min-width: 160px; }
.leads-ads-sync { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.25rem; color: var(--text-muted); font-size: 0.7rem; }
.leads-ads-sync-sent { color: var(--state-success); }
.leads-ads-sync-failed { color: var(--state-error); }
.leads-ads-retry { display: inline; padding: 0; font-size: inherit; color: inherit; text-decoration: underline; }

.leads-status { font-size: 0.72rem; font-weight: 700; text-transform: capitalize; }
.leads-status-received { color: var(--state-success); }
.leads-status-duplicate { color: var(--text-muted); }
.leads-status-spam, .leads-status-blocked, .leads-status-error { color: var(--state-error); }

.leads-danger { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.25rem; }

@container settings-main (max-width: 640px) {
  .leads-subs-table th:nth-child(3), .leads-subs-table td:nth-child(3) { display: none; }
  .leads-copy-row { flex-wrap: wrap; }
  .leads-subs { width: 100%; overflow-x: auto; }
  .leads-subs-table { min-width: 700px; }
}

/* ============================================================
   TOUCH MECHANICS (any width, pointer-based) — hover-only UI is
   unreachable on touch: iOS gives a tapped element sticky :hover,
   so cursor-following hover cards appear on first tap and never
   dismiss (nothing fires mouseleave). Suppress them; tapping the
   chip already opens the reservation / task itself.
   !important outguns the chip:hover reveal rules' specificity.
   ============================================================ */
@media (hover: none) {
  .property-calendar-res-hover,
  .property-calendar-block-hover {
    display: none !important;
  }
  /* Kill the grey tap flash + the 350ms double-tap-zoom wait on
     interactive elements — the biggest "this is a website" tells. */
  a,
  button,
  [role="button"],
  input,
  select,
  textarea,
  label {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* ================= INBOX PHONE PASS (<=640px) =================
   The flagship-exemplar surface. Measured at 390x844 before this pass:
   topbar 38 + mode-tabs 36 + chat head 95 + composer 147 = 316px of chrome
   (37% of the screen) before the first message. Target: ~170px. */
@media (max-width: 640px) {
  /* Thread header: ONE row. Desktop stacks head-main plus a full actions row;
     phone pins the surviving actions to the right of the title row. Cut here:
     collab avatars, the Inbox|Details strip (the panel button opens the same
     content as a drawer), the activity-density toggle — all niche on a phone. */
  .inbox-chat-head {
    position: relative;
    padding: 8px 10px;
  }
  .inbox-chat-head-main {
    /* Left: clear the overlaid back chevron (36px circle at 8px inset) —
       it sat on the avatar in threads and on the TITLE in the contact
       record. Right: room for the pinned actions. */
    padding-left: 40px;
    padding-right: 126px;
    min-width: 0;
  }
  .inbox-chat-head-text {
    min-width: 0;
  }
  .inbox-chat-head-text > * {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .inbox-chat-head-actions {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    margin: 0;
  }
  .inbox-chat-head .inbox-collab,
  .inbox-chat-head .properties-res-inbox-tabs,
  .inbox-chat-head .inbox-activity-toggle {
    display: none;
  }

  /* Composer: message-app height. One non-wrapping tools row (it wrapped to
     two lines at 390px), tighter padding, no character counter, no sentiment
     context bar — the insight surfaces live in the details drawer. */
  .inbox-compose {
    padding: 8px 10px 10px;
  }
  .inbox-compose-actions {
    margin-top: 6px;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
  }
  .inbox-compose-tools {
    gap: 4px;
    min-width: 0;
  }
  .inbox-char-counter,
  .inbox-context-bar {
    display: none;
  }

  /* Thread list rows: the pin/menu chip cluster rendered on TOP of the
     timestamp on every row (the touch fallback made it always-visible).
     A tap navigates here, so the chips were unreachable decoration —
     pin/mute live in the thread's own header menu. */
  .wl2-actions {
    display: none;
  }
}

/* ================= PHONE APP (<=640px) — phone-first UI layer =================
   Implements Hakim's Claude design canvas (project "Upgraded OS iPhone app
   design"): big confident titles, attention-as-cards, channel rings, floating
   glass tab bar. At the phone tier the workspace chrome is not rendered at all;
   these classes style the dedicated phone screens. Inert on desktop — the
   .phone-app root only mounts below 641px. Values are lifted verbatim from the
   design artboards; do not "normalize" them to desktop tokens. */

/* Every body-portaled .ph-* ROOT must appear in BOTH lists below (dark base +
   light override): a portal to <body> escapes .phone-app, so a sheet only gets
   the ph variables if its own root class carries them (defect D8 — the Details
   sheet rendered permanently dark from its fallbacks). */
:root {
  /* One geometry contract for the web island and every bar stacked above it.
     Build 15 replaces --ph-tabbar-lift with the native overlay's measured lift
     at runtime; web and older shells use the matching safe-area calculation. */
  --ph-tabbar-lift: min(max(calc(env(safe-area-inset-bottom, 0px) - 24px), 8px), 14px);
  --ph-tabbar-height: 58px;
  --ph-active-call-bar-height: 48px;
  --ph-stavros-bar-height: 46px;
  --ph-tabbar-stack-bottom:
    calc(var(--ph-tabbar-lift) + var(--ph-tabbar-height) + var(--ph-tabbar-lift));
  --ph-update-card-bottom:
    calc(var(--ph-tabbar-stack-bottom) + var(--ph-tabbar-lift));
}
.phone-app,
.ph-tabbar,
.ph-stavros-bar,
.ph-alert-delivery-pill,
.ph-brain,
.ph-notif,
.ph-wn,
.ph-guide,
.ph-update-card,
.ph-sheet-overlay,
.ph-call-layer,
.ph-active-call-bar,
.ph-details,
.ph-task-sheet,
.ph-glass-menu {
  --ph-bg: #111114;
  --ph-surface: #1b1b20;
  --ph-surface-2: #17171a;
  --ph-hairline: rgba(255, 255, 255, 0.06);
  --ph-border: rgba(255, 255, 255, 0.1);
  --ph-text: #ededee;
  --ph-text-2: #8a8a93;
  --ph-text-3: #6f6f77;
  --ph-text-mid: #c9c9cf;
  --ph-accent: #6366f1;
  --ph-accent-strong: #4f46e5;
  --ph-accent-soft: #a5b4fc;
  --ph-accent-wash: rgba(99, 102, 241, 0.14);
  --ph-chip-text: #a5b4fc;
  --ph-danger: #f87171;
  --ph-success: #34d399;
  --ph-success-wash: rgba(52, 211, 153, 0.14);
  --ph-bubble-in-bg: #1d1d20;
  --ph-bubble-in-border: transparent;
  --ph-composer-bg: #1d1d20;
  --ph-composer-border: rgba(255, 255, 255, 0.09);
  --ph-tabbar-bg: rgba(26, 26, 31, 0.52);
  --ph-tabbar-border: rgba(255, 255, 255, 0.06);
  --ph-tabbar-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --ph-glass-spec: rgba(255, 255, 255, 0.32);
  --ph-glass-spec-soft: rgba(255, 255, 255, 0.1);
  --ph-glass-sheen: rgba(255, 255, 255, 0.08);
  --ph-home-indicator: rgba(255, 255, 255, 0.35);
}
.phone-app {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--ph-bg);
  color: var(--ph-text);
  font-family: var(--font-manrope), "Manrope", -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Phone error toast — failed inbox writes surface HERE at the phone tier: the
   desktop .workspace-toast sits under the fixed .phone-app layer (z 60), which
   is how "Mark all as read" failed invisibly for days (2026-07-30 diagnosis).
   Above the app chrome + tab bar, below sheets (1200+). Theme tokens only —
   light/dark parity per CLAUDE.md §5. Tap dismisses; WorkspaceShell auto-clears. */
.ph-action-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--ph-tabbar-stack-bottom, 74px) + 10px);
  z-index: 300;
  border: 1px solid color-mix(in srgb, var(--state-error) 45%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--state-error) 8%, var(--bg-elevated));
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.6rem 0.8rem;
  text-align: left;
}
.ph-task-completion-undo {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--ph-tabbar-stack-bottom, 74px) + 10px);
  z-index: 305;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 8px 8px 8px 13px;
  border: 1px solid color-mix(in srgb, var(--state-success) 40%, var(--ph-border));
  border-radius: 15px;
  background: color-mix(in srgb, var(--state-success) 9%, var(--ph-surface));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .32);
  color: var(--ph-text);
  animation: workspace-share-toast-in 180ms ease-out both;
}
.ph-task-completion-undo.is-error {
  border-color: color-mix(in srgb, var(--state-error) 45%, var(--ph-border));
  background: color-mix(in srgb, var(--state-error) 9%, var(--ph-surface));
}
.ph-task-completion-undo.is-warning {
  border-color: color-mix(in srgb, var(--state-warning) 48%, var(--ph-border));
  background: color-mix(in srgb, var(--state-warning) 10%, var(--ph-surface));
}
.ph-task-completion-undo > span { display: grid; min-width: 0; gap: 2px; }
.ph-task-completion-undo strong { font-size: 13px; }
.ph-task-completion-undo small {
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-task-completion-undo button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--ph-border);
  border-radius: 10px;
  background: var(--ph-surface-2);
  color: var(--ph-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}
.ph-task-completion-undo button:disabled { opacity: .65; }
.ph-task-completion-undo button.is-dismiss { width: 34px; min-height: 34px; padding: 0; color: var(--ph-text-3); }
.ph-share-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--ph-tabbar-stack-bottom, 74px) + 10px);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 8px 7px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  box-shadow: var(--shadow-soft);
  color: var(--text-primary);
  animation: workspace-share-toast-in 180ms ease-out both;
}
.ph-share-toast span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-share-toast button {
  flex: 0 0 auto;
  min-width: 48px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}
.ph-share-toast .ph-share-toast-dismiss {
  min-width: 38px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
}
[data-theme="light"] .phone-app,
[data-theme="light"] .ph-tabbar,
[data-theme="light"] .ph-stavros-bar,
[data-theme="light"] .ph-alert-delivery-pill,
[data-theme="light"] .ph-brain,
[data-theme="light"] .ph-notif,
[data-theme="light"] .ph-wn,
[data-theme="light"] .ph-guide,
[data-theme="light"] .ph-update-card,
[data-theme="light"] .ph-sheet-overlay,
[data-theme="light"] .ph-call-layer,
[data-theme="light"] .ph-active-call-bar,
[data-theme="light"] .ph-details,
[data-theme="light"] .ph-task-sheet,
[data-theme="light"] .ph-glass-menu {
  --ph-bg: #f5f5f4;
  --ph-surface: #ffffff;
  --ph-surface-2: #ffffff;
  --ph-hairline: rgba(0, 0, 0, 0.05);
  --ph-border: rgba(0, 0, 0, 0.08);
  --ph-text: #18181b;
  --ph-text-2: #6b6b73;
  --ph-text-3: #9c9ca3;
  --ph-text-mid: #3f3f46;
  --ph-accent: #4f46e5;
  --ph-accent-strong: #4338ca;
  --ph-accent-soft: #4f46e5;
  --ph-accent-wash: #e0e7ff;
  --ph-chip-text: #4338ca;
  --ph-danger: #dc2626;
  --ph-success: #047857;
  --ph-success-wash: #d1fae5;
  --ph-bubble-in-bg: #ffffff;
  --ph-bubble-in-border: rgba(0, 0, 0, 0.06);
  --ph-composer-bg: #ffffff;
  --ph-composer-border: rgba(0, 0, 0, 0.09);
  --ph-tabbar-bg: rgba(255, 255, 255, 0.55);
  --ph-tabbar-border: rgba(0, 0, 0, 0.05);
  --ph-tabbar-shadow: 0 10px 28px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.07);
  --ph-glass-spec: rgba(255, 255, 255, 0.9);
  --ph-glass-spec-soft: rgba(255, 255, 255, 0.5);
  --ph-glass-sheen: rgba(255, 255, 255, 0.35);
  --ph-home-indicator: rgba(0, 0, 0, 0.3);
}

/* --- Screen scaffold --- */
.ph-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
/* Pull to refresh (TestFlight #50). The strip lives at the top of the scroller and
   pushes the list down by exactly the pull distance, so the list reads as attached
   to the finger. NO transition while the finger is down — that would lag behind
   the drag; the spring back on release is transitioned by .is-refreshing / the
   height going to 0 on an element that unmounts, so the snap is instant either way. */
.ph-ptr {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  flex: 0 0 auto;
  color: var(--ph-text-3);
}
.ph-ptr.is-armed {
  color: var(--ph-accent);
}
.ph-ptr.is-refreshing {
  color: var(--ph-accent);
  transition: height 0.2s cubic-bezier(0.32, 0.72, 0.28, 1);
}
.ph-ptr.is-refreshing svg {
  animation: ph-ptr-spin 0.8s linear infinite;
}
.ph-ptr-label {
  font-size: 12px;
  font-weight: 600;
}
@keyframes ph-ptr-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ph-ptr.is-refreshing svg {
    animation-duration: 2.4s;
  }
}
.ph-screen-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  /* Round 6 D38: the shared Ask Stavros bar floats above the tab bar on every
     screen, so scrollers clear it (was 96px for the tab bar alone). */
  padding: 4px 12px calc(152px + env(safe-area-inset-bottom, 0px));
}
.ph-calendar-page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
.ph-header {
  padding: 4px 20px 0;
}
.ph-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
/* Compact header (2026-07-26, Hakim: "isn't the word inbox a bit big and
   taking up too much valuable space?"). The 34px large-title + stacked
   subtitle burned ~64px of every screen before content; 22px + a tight
   subline sits the whole heading inside the 44px button row's height, so the
   header costs what the buttons already cost. Shared by every phone screen —
   one heading scale everywhere. */
.ph-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 26px;
  color: var(--ph-text);
}
.ph-subtitle {
  margin: 1px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ph-text-2);
}
.ph-header-actions {
  display: flex;
  gap: 10px;
  /* Never let the row squeeze its buttons below the 44px tap target — if a screen
     ever adds one action too many the header must overflow visibly (and get
     caught) rather than silently shrinking every button into an unhittable dot. */
  flex-shrink: 0;
}
/* Header buttons wear the same tabbar-material glass as the search capsule and
   chips (the .ph-gchip recipe) — Hakim asked for the Liquid Glass treatment on
   this row too. Web-drawn: the row sits above the scroller (nothing passes
   under it), so Apple's real refraction would add nothing a backdrop blur
   doesn't; no native build needed. Inset rims only — no outer drop shadow. */
.ph-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  border: 0.5px solid var(--ph-tabbar-border);
  background: var(--ph-tabbar-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.14);
  color: var(--ph-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
[data-theme="light"] .ph-icon-btn {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.06);
}

/* --- Header actions + search + filter chips (2f language) --- */
.ph-icon-btn {
  position: relative;
}
.ph-icon-btn.is-accent {
  background: var(--ph-accent-strong);
  color: #fff;
}
.ph-icon-btn.is-active {
  color: var(--ph-accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ph-accent) 45%, transparent);
}
.ph-icon-btn-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: var(--ph-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.ph-active-filters {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ph-active-filters::-webkit-scrollbar {
  display: none;
}
/* Always-visible quick-filter chip strip (Unread/Guests/Owners/Internal) under
   the search box — surfaces the useful few filters that were buried behind the
   filter icon. Same horizontal-scroll row as the active-filter pills. */
.ph-quickchips {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ph-quickchips::-webkit-scrollbar {
  display: none;
}
.ph-fchip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #b4b4bc;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
[data-theme="light"] .ph-fchip {
  border-color: rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: #52525b;
}
.ph-fchip.is-active {
  background: var(--ph-accent-strong);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}
.ph-fchip.is-reset {
  border-style: dashed;
  background: transparent;
}
.ph-fchip-count {
  opacity: 0.75;
  font-weight: 700;
}

/* ── Inbox liquid glasshead — search + the anchor-and-pair chips float INSIDE
   the scroll container (a sticky, transparent wrapper) so rows genuinely slide
   under the glass, exactly like desktop pane 2's .inbox-glasshead. The wrapper
   itself is invisible — only the capsules are material — and clicks in the
   gaps fall through to the rows beneath. WebKit rule (same as .ph-jump-pill):
   the blurred pills never self-animate; all motion rides .ph-gchip-inner. ── */
.ph-glasshead {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  gap: 9px;
  /* Bleed across the scroll container's 4px/12px padding so the head spans the
     full screen width and rows pass beneath it edge to edge. */
  margin: -4px -12px 8px;
  padding: 8px 14px 10px;
  background: transparent;
  pointer-events: none;
}
/* The Inbox already has a page heading plus two navigation axes above this
   native-capable glass head. Keep its search and chips close together so the
   conversation list remains the dominant phone surface. The iOS glass plugin
   measures these exact boxes, so the same compact geometry applies to both the
   web fallback and the public shell without a native-only fork. */
.ph-glasshead.ph-inbox-glasshead {
  gap: 6px;
  margin: -4px -12px 4px;
  padding: 8px 14px 5px;
}
.ph-inbox-glasshead .ph-search-field {
  height: 38px;
  border-radius: 19px;
}
.ph-glasshead > * {
  pointer-events: auto;
}
/* Progressive blur under the head — NOT a painted band (Hakim 2026-07-26:
   the opaque scrim read as "the top bar is in some kind of container"). Rows
   passing beneath blur into mush via a masked backdrop-filter, the iOS 26
   screen-top treatment. ZERO paint on purpose — a first version kept a faint
   bg tint "for contrast" and Hakim still read it as something drawn behind
   the capsules. Blur alone has no edge; the capsules float free. */
.ph-glasshead::before {
  content: "";
  position: absolute;
  inset: -1px 0 -18px 0;
  z-index: -1;
  pointer-events: none;
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 45%, transparent 100%);
}
/* Native Liquid Glass head (shell build ≥ 15, GlassHeadPlugin): the shell
   draws the search capsule + chips as REAL glass floating over the webview,
   positioned on the geometry measured from these very elements — so they hide
   (keeping the layout space + scroll-under geometry) rather than unmount.
   opacity, NOT visibility: the native search capsule's tap is handed to THIS
   input via a synchronous .focus() — a visibility:hidden input refuses focus,
   which forced a state→render→rAF detour before the keyboard could start
   (Hakim felt it as keyboard lag, 2026-07-26). An opacity-0 input focuses
   instantly. pointer-events off so the ghost element can never swallow a tap
   if the native overlay ever lets one through. */
.ph-glasshead.is-native .ph-search-wrap,
.ph-glasshead.is-native .ph-search-field,
.ph-glasshead.is-native .ph-quickchips {
  opacity: 0;
  pointer-events: none;
}
/* NO blur band under the native head — nothing web-drawn at all. Build 16 kept
   the masked blur "to pre-soften rows" and Hakim immediately read its edges as
   "still in a container" (2026-07-26, verbatim). The bottom tab bar is the
   reference: native glass floating over SHARP rows, zero web paint behind it —
   the refraction IS the treatment. (Web-fallback mode keeps the band.) */
.ph-glasshead.is-native::before {
  content: none;
}
/* The search capsule goes full glass (it was a solid composer-grey block —
   the "web view" tell). Same material family as the tab bar / Stavros bar. */
.ph-glasshead .ph-search-field {
  margin-top: 0;
  background: var(--ph-tabbar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.8) brightness(1.04);
  backdrop-filter: blur(20px) saturate(1.8) brightness(1.04);
  border: 0.5px solid var(--ph-tabbar-border);
  /* Inset rims only — no outer drop shadow (Hakim 2026-07-26): a cast shadow
     under the head elements read as a dark smudge over the rows sliding
     beneath. The floating chrome (tab bar, Stavros bar) keeps
     --ph-tabbar-shadow. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.12);
}
.ph-glasshead .ph-quickchips,
.ph-glasshead .ph-active-filters {
  margin-top: 0;
  /* Keep the pills' hairline borders from clipping at the scroller edges. */
  padding: 2px 2px 4px;
  margin-left: -2px;
  margin-right: -2px;
}

/* Tasks is a finite work list, not a live conversation. Its title, search and
   filters belong to the list and leave naturally as the User scrolls. Inbox
   deliberately keeps the shared sticky/native treatment. */
.ph-task-page-header {
  padding: 4px 8px 0;
}
.ph-glasshead.ph-task-glasshead {
  position: relative;
  top: auto;
  z-index: 1;
  margin: 0 -12px 8px;
}
.ph-glasshead.ph-task-glasshead::before {
  content: none;
}

/* Liquid-glass chip: the pill is a backdrop root (blur + specular rim); the
   inner span carries entrance + press motion. */
.ph-gchip {
  flex: 0 0 auto;
  position: relative;
  padding: 0;
  border-radius: 17px;
  border: 0.5px solid var(--ph-tabbar-border);
  background: var(--ph-tabbar-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
  /* Inset rims only — no outer drop shadow, same rule as the search capsule. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.14);
  color: var(--ph-text);
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
[data-theme="light"] .ph-gchip {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.06);
}
.ph-gchip-inner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  /* Tight enough that Unread + Stays + Rooms + DMs (with k-counts) fit a
     390px screen on one line without scrolling. */
  padding: 8px 10.5px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.16s ease;
  animation: ph-gchip-rise 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* Staggered entrance, left to right — the chip row REMOUNTS (keyed) whenever
   the anchor combination changes, so each new pairing set "spawns" in
   sequence. That is the anchor-and-pair morph. */
.ph-gchip:nth-child(2) .ph-gchip-inner { animation-delay: 0.04s; }
.ph-gchip:nth-child(3) .ph-gchip-inner { animation-delay: 0.08s; }
.ph-gchip:nth-child(4) .ph-gchip-inner { animation-delay: 0.12s; }
.ph-gchip:nth-child(5) .ph-gchip-inner { animation-delay: 0.16s; }
.ph-gchip:nth-child(6) .ph-gchip-inner { animation-delay: 0.2s; }
.ph-gchip:nth-child(7) .ph-gchip-inner { animation-delay: 0.24s; }
.ph-gchip:nth-child(8) .ph-gchip-inner { animation-delay: 0.28s; }
.ph-gchip:active .ph-gchip-inner {
  transform: scale(0.92);
  opacity: 0.85;
}
.ph-gchip.is-active {
  background: var(--ph-accent-strong);
  border-color: transparent;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.ph-gchip.is-attention {
  border-color: color-mix(in srgb, #f59e0b 50%, var(--ph-tabbar-border));
  background: color-mix(in srgb, #f59e0b 16%, var(--ph-tabbar-bg));
  color: #f6a817;
}
.ph-gchip.is-attention.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #1f1300;
}
.ph-gchip-count {
  opacity: 0.72;
  font-weight: 700;
  font-size: 11px;
}
.ph-gchip-x {
  font-size: 13px;
  opacity: 0.85;
  margin-left: 1px;
}
@keyframes ph-gchip-rise {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.96);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ph-gchip-inner {
    animation: none;
  }
}

/* --- Floating liquid-glass tab bar ---
   Layered material: translucent tint + heavy blur/saturation underneath, a
   specular rim (inset highlights) and a diagonal sheen on top.
   COMPACT ISLAND (Hakim 2026-07-26): the bar hugs its tabs and floats
   centered — content shows either side — instead of stretching full width,
   and sits lower. The bottom offset is CLAMPED to 8–14px, never derived
   raw from the safe-area inset: iOS 26 devices report bottom insets as
   large as 58pt (measured on the iPhone 17 Pro simulator), so "inset − K"
   left the bar floating ~44px high — the exact "bar is too high" bug. The
   native bar (apps/shell TabBarPlugin.swift, build ≥14) mirrors this
   geometry exactly — change one, change both. The static translateX centering
   never animates (WebKit backdrop-root rule). The stacked bars consume the
   shared --ph-tabbar-stack-bottom contract above, so their gap cannot drift
   away from the bottom edge gap. */
.ph-tabbar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: var(--ph-tabbar-lift);
  z-index: 6;
  height: var(--ph-tabbar-height);
  border-radius: 29px;
  width: max-content;
  max-width: calc(100% - 24px);
  background: var(--ph-tabbar-bg);
  backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  border: 0.5px solid var(--ph-tabbar-border);
  box-shadow: var(--ph-tabbar-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}
.ph-tabbar::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 1px 1px var(--ph-glass-spec),
    inset 0 -1px 1px var(--ph-glass-spec-soft),
    inset 1.5px 0 2px -1px var(--ph-glass-spec-soft),
    inset -1.5px 0 2px -1px var(--ph-glass-spec-soft),
    inset 0 -12px 20px -14px rgba(0, 0, 0, 0.3);
}
.ph-tabbar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    var(--ph-glass-sheen),
    transparent 32%,
    transparent 68%,
    var(--ph-glass-sheen)
  );
  opacity: 0.7;
}
.ph-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ph-text-2);
  position: relative;
  text-decoration: none;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  min-width: 52px;
  /* Island bar: tabs size naturally; this padding IS the tab spacing. */
  padding: 6px 10px;
  z-index: 1;
}
.ph-tab svg {
  width: 23px;
  height: 23px;
}
.ph-tab-label {
  font-size: 10px;
  font-weight: 600;
}
.ph-tab.is-active {
  color: var(--ph-accent-soft);
}
.ph-tab.is-active .ph-tab-label {
  font-weight: 700;
}
.ph-tab-badge {
  position: absolute;
  top: 0;
  right: 4px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #6366f1;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* --- Thread rows — D21: flat iOS list grammar. Edge-to-edge rows, hairline
   separators inset to the text column, NO card backgrounds; unread = accent
   dot in a reserved left gutter + heavier title (iOS Mail/Messages), so the
   list reads as one calm surface instead of stacked blobs. --- */
.ph-row {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  align-items: center;
  border-radius: 0;
  background: transparent;
  width: 100%;
  border: 0;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  /* Long-press opens the thread action sheet — suppress the OS text-selection
     callout so the hold reads as a gesture, not a copy attempt. */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* D23: press feedback = quiet iOS highlight, never a scale bounce. */
.ph-row:active {
  background: rgba(255, 255, 255, 0.055);
  transition-duration: 0.04s;
}
.ph-row.is-portal-action{
  background:color-mix(in srgb, #f59e0b 7%, transparent);
  box-shadow:inset 3px 0 0 #f59e0b;
}
[data-theme="light"] .ph-row:active {
  background: rgba(0, 0, 0, 0.05);
}
.ph-row-main {
  flex: 1;
  min-width: 0;
}
.ph-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ph-row-name {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ph-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-row.is-unread .ph-row-name {
  font-weight: 800;
}
.ph-row-name.is-attention {
  color: var(--ph-danger);
}
.ph-row-time {
  font-size: 12px;
  color: var(--ph-text-3);
  flex: 0 0 auto;
  margin-left: auto;
}
/* Round 5 (reverses D21): the reserved left gutter pushed every row ~18px right
   for the sake of an occasional dot — Hakim: not worth the space. Unread now
   reads on the RIGHT like WhatsApp: tinted time + a dot beside it. */
.ph-row.is-unread .ph-row-time {
  color: var(--ph-accent-soft);
  font-weight: 700;
}
.ph-row-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 18px;
  color: var(--ph-text-2);
  overflow: hidden;
}
.ph-row-top .contact-type-marker {
  max-width:min(116px, 44%);
  color:color-mix(in srgb, var(--contact-type-color) 76%, var(--ph-text));
}
.ph-row-top .contact-type-marker.is-quiet {
  color:var(--ph-text-3);
}
.ph-row-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ph-row-preview-text.is-single {
  display: block;
  white-space: nowrap;
}
.ph-row-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--ph-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-row-unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6366f1;
  flex: 0 0 auto;
}
.ph-row-unread-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #6366f1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex: 0 0 auto;
}
.ph-row-channel {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}
.ph-row-channel svg,
.ph-row-channel img {
  width: 13px;
  height: 13px;
}
.ph-list-sep {
  height: 1px;
  /* Inset to the text column: 4 pad + 18 gutter + 10 gap + 44 avatar + 10 gap */
  margin: 0 0 0 86px;
  background: var(--ph-hairline);
}
.ph-row.is-snoozed {
  opacity: 0.72;
}
.ph-row-glyph {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: var(--ph-text-3);
}
.ph-row-glyph.is-pin {
  color: var(--ph-accent-soft);
}
.ph-row-prefix {
  color: var(--ph-text-3);
}
.ph-row-typing {
  color: var(--ph-accent-soft);
  font-style: italic;
}
.ph-sig {
  flex: 0 0 auto;
  padding: 2.5px 8px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.ph-sig.is-mention {
  background: var(--ph-accent-strong);
  color: #fff;
}
.ph-sig.is-draft {
  background: var(--ph-accent-wash);
  color: var(--ph-chip-text);
}
.ph-sig.is-waiting {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
}
.ph-sig.is-portal {
  background:#f59e0b;
  color:#16120a;
  box-shadow:0 0 0 1px color-mix(in srgb, #f59e0b 36%, transparent);
}
[data-theme="light"] .ph-sig.is-waiting {
  background: #fef3c7;
  color: #b45309;
}
.ph-sig.is-snoozed {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ph-text-2);
}
[data-theme="light"] .ph-sig.is-snoozed {
  background: rgba(0, 0, 0, 0.05);
}

/* --- Avatars (canonical ContactAvatar / AvatarStack, phone-sized) --- */
.ph-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}
.ph-avatar-img,
.ph-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
}
.ph-avatar-img.is-sm,
.ph-avatar-fallback.is-sm {
  width: 34px;
  height: 34px;
}
.ph-avatar-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 19px;
  height: 19px;
  border-radius: 10px;
  color: var(--ph-text-2);
  background: var(--ph-bg);
  box-shadow: 0 0 0 1px var(--ph-hairline);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ph-avatar-badge-logo,
.ph-avatar-badge svg,
.ph-avatar-badge img {
  width: 12px;
  height: 12px;
}
.ph-mention-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 17px;
  height: 17px;
  border-radius: 9px;
  background: var(--ph-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --- Conversation --- */
.ph-convo {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
.ph-convo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--ph-hairline);
}
.ph-convo-staybar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--ph-hairline);
  background: color-mix(in srgb, var(--ph-accent) 4%, var(--ph-bg));
}
.ph-convo-staylink {
  min-width: 0;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  color: var(--ph-text);
  text-decoration: none;
}
.ph-convo-staylink > svg {
  color: var(--ph-accent-soft);
  flex: none;
}
.ph-convo-staylink > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.ph-convo-staylink strong {
  font-size: 12.5px;
  font-weight: 700;
}
.ph-convo-staylink small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-convo-staybar .inbox-flip-anchor {
  flex: none;
}
.ph-stavros-context {
  padding: 7px 10px;
  border-bottom: 1px solid var(--ph-hairline);
  background: color-mix(in srgb, var(--state-warning) 5%, var(--ph-bg));
}
.ph-stavros-context[data-verdict="available"] {
  background: color-mix(in srgb, var(--state-success) 5%, var(--ph-bg));
}
.ph-stavros-context-chip {
  display: flex;
  align-items: center;
  gap: 5px;
}
.ph-stavros-context-open {
  min-width: 0;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 28%, var(--ph-hairline));
  border-radius: 11px;
  background: color-mix(in srgb, var(--state-warning) 8%, transparent);
  color: var(--ph-text);
  text-align: left;
}
.ph-stavros-context[data-verdict="available"] .ph-stavros-context-open {
  border-color: color-mix(in srgb, var(--state-success) 28%, var(--ph-hairline));
  background: color-mix(in srgb, var(--state-success) 8%, transparent);
}
.ph-stavros-context-open > svg {
  color: var(--ph-accent-soft);
  flex: none;
}
.ph-stavros-context-open > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ph-stavros-context-open strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-stavros-context-open small {
  margin-top: 1px;
  color: var(--state-warning);
  font-size: 10.5px;
  font-weight: 650;
}
.ph-stavros-context[data-verdict="available"] .ph-stavros-context-open small {
  color: var(--state-success);
}
.ph-stavros-context-dismiss {
  width: 30px;
  height: 30px;
  /* 30px visual, 44px hit area (see ::after) — it sits at the end of the banner
     row with nothing to its right, so the overspill can't steal another tap. */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ph-text-3);
  flex: none;
}
.ph-stavros-context-dismiss::after {
  content: "";
  position: absolute;
  inset: -7px;
}
.ph-stavros-context-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 7px;
}
.ph-stavros-context-draft {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: var(--ph-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.ph-convo-back {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--ph-accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.ph-convo-id {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ph-convo-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ph-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-convo-sub {
  font-size: 12px;
  color: var(--ph-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ph-convo-lock {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  color: var(--ph-text-2, #8a8a93);
  vertical-align: middle;
}
.ph-convo-status {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-text-mid, #c9c9cf);
  flex-shrink: 0;
}
.ph-convo-status.is-accepted {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
}
.ph-convo-status.is-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
}
.ph-convo-status.is-cancelled {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.ph-typing-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--ph-accent, #6366f1);
  padding: 0 6px;
  animation: ph-typing-in 0.18s ease-out;
}
@keyframes ph-typing-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ph-convo-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 14px 10px;
}
.ph-convo-loading {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 18px;
  padding: 18px 2px;
}
.ph-convo-loading .ph-skeleton {
  width: 62%;
  height: 64px;
  border-radius: 18px 18px 18px 5px;
}
.ph-convo-loading .ph-skeleton:nth-child(2) {
  width: 76%;
  height: 82px;
}
.ph-convo-loading .ph-skeleton:nth-child(3) {
  width: 48%;
  height: 54px;
  align-self: flex-end;
  border-radius: 18px 18px 5px 18px;
}
.ph-history-sentinel {
  align-self: stretch;
  min-height: 1px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.ph-history-sentinel .inbox-history-loader {
  color: var(--ph-text-3);
  margin-block: 3px 10px;
}
.ph-date-pill {
  position: sticky;
  top: 6px;
  z-index: 3;
  align-self: center;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(30, 30, 35, 0.62);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  color: var(--ph-text-2);
  font-size: 11.5px;
  font-weight: 600;
  margin: 6px 0;
}
[data-theme="light"] .ph-date-pill {
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.ph-bubble-in {
  align-self: flex-start;
  max-width: 82%;
  background: var(--ph-bubble-in-bg);
  border: 1px solid var(--ph-bubble-in-border);
  color: var(--ph-text);
  padding: 9px 13px;
  border-radius: 18px 18px 18px 5px;
  font-size: 14.5px;
  line-height: 20px;
  overflow-wrap: break-word;
}
[data-theme="light"] .ph-bubble-in {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ph-bubble-out {
  align-self: flex-end;
  max-width: 82%;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  padding: 9px 13px;
  border-radius: 18px 18px 5px 18px;
  font-size: 14.5px;
  line-height: 20px;
  overflow-wrap: break-word;
}
.ph-bubble-in.is-photo-album,
.ph-bubble-out.is-photo-album {
  width: min(82%, 360px);
  max-width: 82%;
  padding: 4px;
}
.ph-bubble-in p,
.ph-bubble-out p {
  margin: 0;
  white-space: pre-wrap;
}
/* Staff feedback #40, phone tier: same rule as the web thread — a call card spans
   the full conversation width and sheds the bubble chrome (its own frame is the
   container). Direct-child :has() keeps the shared-message embed compact: there
   the bubble's child is the share card, not the call card. */
.ph-bubble-in:has(> .inbox-voice-card),
.ph-bubble-out:has(> .inbox-voice-card) {
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
.ph-bubble-in > .inbox-voice-card,
.ph-bubble-out > .inbox-voice-card {
  width: 100%;
  max-width: 100%;
}
.ph-bubble-time {
  font-size: 10.5px;
  color: var(--ph-text-3);
  margin: 0 4px;
}
/* Turn wrapper — desktop parity: head (avatar + name) on the first bubble of a
   turn, meta footer (channel logo · time · ticks · route) on the last. */
.ph-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
}
.ph-msg.out {
  align-items: flex-end;
}
.ph-msg-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 2px 0;
}
.ph-msg.out .ph-msg-head {
  flex-direction: row-reverse;
}
.ph-msg-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--ph-surface-2);
  color: var(--ph-text-2);
}
.ph-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
/* The ContactAvatar silhouette disc, filling the whole 22px avatar box. Without
   this it collapsed to the bare svg (14px) and floated inside a grey circle — so
   even the guest side never showed a full-size disc. Mirrors the desktop's
   `.inbox-msg-avatar-ph`. (Replaces `.ph-msg-avatar-fallback`, the old initials
   circle, removed 2026-07-26 — nothing renders initials any more.) */
.ph-msg-avatar-ph {
  width: 100%;
  height: 100%;
}
.ph-msg-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--ph-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70vw;
}
/* Name + meta on one line (desktop parity, Hakim 2026-07-23). The meta cluster wraps
   under the name only when the row is genuinely too narrow. */
.ph-msg-headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1px 6px;
  min-width: 0;
}
/* Meta cluster moved up from the old turn-end footer: channel logo · time · tick ·
   route. Same small/muted treatment the footer used. */
.ph-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ph-text-3);
}
.ph-msg-meta .workspace-platform-logo {
  width: 13px;
  height: 13px;
  flex: none;
}
/* (.ph-msg-foot removed 2026-07-23 — the meta moved up to .ph-msg-meta on the name line.) */
.ph-msg-time {
  font-size: 11px;
  color: var(--ph-text-3);
}
/* Mention / task chips inside the indigo outbound gradient — the desktop chip
   colors assume a neutral bubble; on the gradient they vanish. */
.ph-bubble-out .mention-chip {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
/* Reply-quote contrast inside the indigo outbound gradient. */
.ph-bubble-out .inbox-quote {
  background: rgba(255, 255, 255, 0.16);
  border-left-color: rgba(255, 255, 255, 0.7);
}
.ph-bubble-out .inbox-quote-label {
  color: #fff;
}
.ph-bubble-out .inbox-quote-text {
  color: rgba(255, 255, 255, 0.85);
}
/* Desktop email card, fitted to the phone canvas. */
.ph-msg .inbox-emailcard {
  width: 100%;
  max-width: 100%;
}
.ph-msg-caption {
  align-self: center;
  text-align: center;
  font-size: 11.5px;
  color: var(--ph-text-3);
  max-width: 86%;
}
.ph-event-card {
  align-self: stretch;
  background: var(--ph-surface);
  border: 1px solid var(--ph-hairline);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ph-event-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ph-text);
}
.ph-event-card-title svg {
  width: 16px;
  height: 16px;
}
.ph-event-card-title.is-danger {
  color: var(--ph-danger);
}
.ph-event-card-meta {
  font-size: 12px;
  color: var(--ph-text-3);
}
.ph-event-card-body {
  font-size: 13.5px;
  line-height: 19px;
  color: var(--ph-text-2);
}

/* --- Composer --- */
/* The composer is the tab bar's TWIN: same floating capsule, inset and bottom
   offset. Unlike the static tab bar, the complete composer moves during the
   native keyboard handover. A backdrop-filter on that moving WebKit layer
   made the conversation repaint/flash on first focus (TestFlight #5884), so
   its material is deliberately opaque while the rim and shadow preserve the
   same visual hierarchy. Do not put backdrop-filter back on this element. */
.ph-composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 16px min(max(calc(env(safe-area-inset-bottom, 0px) - 24px), 8px), 14px);
  padding: 8px 10px;
  border-radius: 32px;
  background: var(--ph-surface);
  border: 0.5px solid var(--ph-tabbar-border);
  box-shadow: var(--ph-tabbar-shadow);
}
.ph-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}
/* Same chrome as workspace-platform-logo-mini (canonical platform tile), sized
   for the toolbar dropdown. The tile keeps brand marks legible on glass. */
.ph-chip-logo {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--bg-elevated);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: none;
}
.ph-chip-logo .platform-logo-image {
  width: 16px;
  height: 16px;
  object-fit: contain;
}
.ph-composer-hint {
  font-size: 12.5px;
  color: var(--ph-text-2);
  padding: 2px 10px 0;
}

/* ── Toolbar row (desktop's .inbox-compose-actions): "+" then the canonical
   channel dropdown (+ the UOS post-type dropdown on UOS). ── */
.ph-composer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 2px;
}
.ph-tool-plus {
  width: 34px;
  height: 34px;
  border-radius: 17px;
  border: 1px solid var(--ph-hairline);
  background: transparent;
  color: var(--ph-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
/* Phone skin for the canonical ChannelSwitcher trigger — a glass pill that
   matches the tab-bar chrome, not the desktop toolbar chip. */
.ph-composer .inbox-channel-switcher-trigger {
  height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  border: 1px solid var(--ph-hairline);
  background: transparent;
  color: var(--ph-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: none;
}
.ph-composer .inbox-channel-switcher-trigger .inbox-channel-switcher-caret {
  color: var(--ph-text-3);
}

/* The body-portaled dropdown wears full liquid glass via menuClassName.
   D10: the GLASS CONTAINER never animates — WebKit fails to recompute a
   backdrop-filter while its own element transform-animates (the flagship
   tab-bar morph learned this: animate the CHILDREN, glass stays put). */
.ph-glass-menu.inbox-channel-switcher-menu {
  border-radius: 22px;
  padding: 6px;
  background: var(--ph-tabbar-bg);
  backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  border: 0.5px solid var(--ph-tabbar-border);
  box-shadow: var(--ph-tabbar-shadow);
}
@keyframes ph-menu-pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
  }
}
.ph-glass-menu .inbox-channel-switcher-item {
  border-radius: 15px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ph-text);
  animation: ph-menu-pop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.ph-glass-menu .inbox-channel-switcher-item:nth-child(2) {
  animation-delay: 0.025s;
}
.ph-glass-menu .inbox-channel-switcher-item:nth-child(3) {
  animation-delay: 0.05s;
}
.ph-glass-menu .inbox-channel-switcher-item:nth-child(4) {
  animation-delay: 0.075s;
}
.ph-glass-menu .inbox-channel-switcher-item:nth-child(n + 5) {
  animation-delay: 0.1s;
}
.ph-glass-menu .inbox-channel-switcher-item.is-active {
  background: var(--ph-accent-wash);
  color: var(--ph-chip-text);
}
.ph-glass-menu .inbox-channel-switcher-item.is-locked {
  opacity: 0.5;
}
.ph-glass-menu .inbox-channel-switcher-reason {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ph-text-3);
}

/* ── "+" menu: attach + templates, popped above the toolbar. ──
   D10: glass container static, items spring in staggered (see the
   channel-switcher menu note — backdrop roots must not self-animate). */
/* ClickUp-parity + sheet (approved 2026-07-26): the composer's + opens a real
   bottom sheet on the canonical ph-sheet chrome. Tiles = distinct upload types;
   the format row drives the UOS editor's own format(). ph-plus-item rows reuse
   their existing styling inside the sheet. */
.ph-plus-sheet {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-plus-label {
  margin: 10px 2px 6px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ph-text-3);
}
.ph-plus-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ph-plus-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border-radius: 14px;
  border: 1px solid var(--ph-hairline);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  font-size: 12.5px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
}
.ph-plus-tile:active {
  background: color-mix(in srgb, var(--ph-accent) 10%, transparent);
}
.ph-plus-tile.is-disabled {
  opacity: 0.45;
}
.ph-plus-tile svg {
  color: var(--ph-accent-soft);
}
.ph-plus-fmt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ph-plus-fmt {
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--ph-hairline);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  cursor: pointer;
}
.ph-plus-fmt:active {
  background: color-mix(in srgb, var(--ph-accent) 10%, transparent);
}
.ph-plus-sheet .ph-plus-item {
  margin-top: 2px;
}
.ph-plus-sheet .ph-plus-item:first-of-type {
  margin-top: 8px;
}

.ph-plus-menu {
  position: absolute;
  left: 10px;
  bottom: calc(100% + 6px);
  z-index: 30;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  border-radius: 22px;
  background: var(--ph-tabbar-bg);
  backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  border: 0.5px solid var(--ph-tabbar-border);
  box-shadow: var(--ph-tabbar-shadow);
}
.ph-plus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--ph-text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
  animation: ph-menu-pop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}
.ph-plus-menu .ph-plus-item:nth-child(2) {
  animation-delay: 0.03s;
}
.ph-plus-menu .ph-plus-item:nth-child(n + 3) {
  animation-delay: 0.06s;
}
.ph-plus-item.is-disabled {
  opacity: 0.5;
}

/* ── Staged attachment chips (upload-on-pick, desktop flow). ── */
.ph-att-row {
  display: flex;
  gap: 6px;
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ph-att-row::-webkit-scrollbar {
  display: none;
}
.ph-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px 0 8px;
  border-radius: 16px;
  border: 1px solid var(--ph-hairline);
  background: var(--ph-composer-bg);
  color: var(--ph-text-2);
  font-size: 12.5px;
  font-weight: 600;
  flex: none;
  max-width: 220px;
}
.ph-att-chip.is-uploading {
  animation: ph-skeleton-pulse 1.4s ease-in-out infinite;
}
.ph-att-progress {
  flex: none;
  color: var(--ph-text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.ph-att-chip.is-error {
  border-color: color-mix(in srgb, var(--ph-danger) 45%, transparent);
  color: var(--ph-danger);
}
.ph-att-thumb {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
}
.ph-att-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-att-remove {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ph-text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}

/* ── Per-transport heads. ── */
.ph-email-subject {
  height: 36px;
  border-radius: 18px;
  border: 1px solid var(--ph-composer-border);
  background: var(--ph-composer-bg);
  color: var(--ph-text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 0 14px;
  outline: none;
}
.ph-email-subject::placeholder {
  color: var(--ph-text-3);
}
.ph-uos-postbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
}
.ph-uos-posttype {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--post-c, var(--ph-accent)) 14%, transparent);
  color: var(--post-c, var(--ph-accent));
  font-size: 12px;
  font-weight: 700;
  flex: none;
  white-space: nowrap;
}
.ph-uos-posttitle {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ph-text);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 750;
  outline: none;
}
.ph-uos-posttitle::placeholder {
  color: var(--ph-text-3);
}

/* ── iOS-style switch (sheet toggle rows; the mail sheet's ⋯ menu uses it
   for "Include signature"). ── */
.ph-switch {
  width: 40px;
  height: 24px;
  border-radius: 12px;
  border: 0;
  padding: 2px;
  background: var(--ph-hairline);
  cursor: pointer;
  flex: none;
  display: inline-flex;
  transition: background 0.18s ease;
}
.ph-switch-knob {
  width: 20px;
  height: 20px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ph-switch.is-on {
  background: var(--ph-accent);
}
.ph-switch.is-on .ph-switch-knob {
  transform: translateX(16px);
}

/* ── WhatsApp window pill + template composer, phone glass skin over the
   canonical desktop components. ── */
.ph-composer .inbox-wa-window {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 12.5px;
  margin: 0;
}
.ph-composer .wa-tpl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px 4px;
}
.ph-composer .wa-tpl .properties-input-text {
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--ph-composer-border);
  background: var(--ph-composer-bg);
  color: var(--ph-text);
  font-family: inherit;
  font-size: 14px;
  padding: 0 12px;
}
.ph-composer .wa-tpl-field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ph-text-2);
}
.ph-composer .wa-tpl-preview {
  border-radius: 16px;
  border: 1px solid var(--ph-hairline);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ph-text);
}
.ph-composer .wa-tpl-actions .btn-primary {
  width: 100%;
  height: 44px;
  border-radius: 22px;
  font-weight: 800;
}

/* ── Templates sheet (bottom sheet, glass). ── */
.ph-tpl-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.35);
  animation: ph-layer-in 0.2s ease;
}
/* D10: the blurred sheet itself stays put (backdrop roots must not
   self-animate on WebKit); its CONTENT rises instead, so the open still
   reads as a spring-up. */
.ph-tpl-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  border-radius: 28px 28px 0 0;
  background: var(--ph-tabbar-bg);
  backdrop-filter: blur(28px) saturate(1.9) brightness(1.05);
  -webkit-backdrop-filter: blur(28px) saturate(1.9) brightness(1.05);
  border-top: 0.5px solid var(--ph-tabbar-border);
  box-shadow: var(--ph-tabbar-shadow);
  padding: 14px 14px max(env(safe-area-inset-bottom, 0px), 14px);
}
.ph-tpl-sheet > * {
  animation: ph-sheet-up 0.32s cubic-bezier(0.32, 0.72, 0.28, 1) backwards;
}
@keyframes ph-sheet-up {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
}
.ph-tpl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--ph-text);
}
.ph-tpl-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 15px;
  background: var(--ph-hairline);
  color: var(--ph-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ph-tpl-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-tpl-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ph-text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.ph-tpl-label {
  font-size: 14.5px;
  font-weight: 750;
}
.ph-tpl-body {
  font-size: 12.5px;
  color: var(--ph-text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ph-tpl-empty {
  padding: 18px 12px;
  font-size: 13.5px;
  color: var(--ph-text-3);
}
.ph-composer-field {
  width: 100%;
  min-height: 42px;
  max-height: 132px;
  border-radius: 21px;
  background: var(--ph-composer-bg);
  border: 1px solid var(--ph-composer-border);
  color: var(--ph-text);
  font-size: 14.5px;
  line-height: 20px;
  font-family: inherit;
  padding: 10px 15px;
  resize: none;
  outline: none;
  overflow-y: auto;
}
.ph-composer-field-shell {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: 1;
  min-width: 0;
  min-height: 42px;
}
.ph-composer-language-shell {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
}
.ph-composer-field-shell .ph-composer-field {
  flex: 1;
  min-width: 0;
}
.ph-composer-field-shell.has-predictive-reply {
  min-height: 92px;
}
.ph-composer-field-shell.has-predictive-reply .ph-composer-field {
  min-height: 92px;
}
.ph-composer-field-shell.has-agent-intervention,
.ph-composer-field-shell.has-agent-intervention .ph-composer-field {
  min-height: 126px;
}
.ph-composer-field-shell.has-agent-intervention {
  border-radius: 21px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ph-accent, #6366f1) 38%, transparent);
}
.ph-composer-field-shell .inbox-predictive-ghost.is-phone {
  inset: 1px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  padding: 9px 14px 8px;
  border-radius: 20px;
  color: color-mix(in srgb, var(--ph-text) 43%, transparent);
  touch-action: pan-y;
  transition: transform 120ms ease, opacity 120ms ease;
}
.ph-composer-field-shell .inbox-predictive-ghost-text {
  font-size: 14.5px;
  line-height: 20px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.inbox-predictive-ghost-phone-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  color: var(--ph-text-3);
  font-size: 11.5px;
}
.inbox-predictive-ghost-phone-actions button {
  min-width: 42px;
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 3px 10px;
  background: color-mix(in srgb, var(--ph-accent, #6366f1) 18%, var(--ph-composer-bg));
  color: var(--ph-text);
  font: inherit;
  font-weight: 650;
}
.ph-composer-field-shell .inbox-agent-intervention-ghost.is-phone {
  min-height: 124px;
  pointer-events: none;
}
.ph-composer-field-shell .inbox-agent-working-ghost.is-phone {
  min-height: 124px;
  justify-content: space-between;
}
.ph-composer-field-shell .inbox-agent-working-copy {
  color: var(--ph-text-2);
  font-size: 13px;
}
.ph-composer-field-shell .inbox-agent-intervention-ghost .inbox-predictive-ghost-text {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.ph-composer-field-shell .inbox-agent-intervention-actions {
  position: static;
  flex-wrap: wrap;
  pointer-events: auto;
}
.ph-composer-field-shell .inbox-agent-intervention-state {
  flex: 1 1 100%;
  color: var(--ph-text-3);
  font-size: 10.5px;
}
.ph-composer-field-shell .inbox-agent-intervention-actions button {
  flex: 1 1 0;
  min-height: 30px;
  border-color: var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  font-size: 11px;
}
.ph-composer-field-shell.has-agent-handoff {
  flex-wrap: wrap;
  gap: 5px;
}
.ph-composer-field-shell.has-agent-handoff .inbox-agent-handoff-notice {
  flex: 1 0 100%;
  padding: 5px 3px 0;
  border-top: 0;
  color: var(--ph-text-3);
  font-size: 10.5px;
}
.ph-composer-field-shell.has-agent-handoff .inbox-agent-handoff-notice button {
  min-height: 30px;
  border-color: var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  font-size: 10.5px;
}
.ph-composer > .inbox-agent-review-panel.is-phone {
  overflow: hidden;
  max-height: min(62dvh, 34rem);
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--ph-accent, var(--accent)) 52%, var(--ph-border));
  border-radius: 22px;
  background: var(--ph-composer-bg);
  color: var(--ph-text);
}
.ph-composer > .inbox-agent-review-panel.is-phone > header {
  padding: 11px 12px;
  border-color: var(--ph-border);
  background: color-mix(in srgb, var(--ph-accent, var(--accent)) 8%, var(--ph-composer-bg));
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-heading strong {
  color: var(--ph-text);
  font-size: 14px;
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-heading small,
.ph-composer > .inbox-agent-review-panel.is-phone > footer > small {
  color: var(--ph-text-3);
  font-size: 11px;
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-preview {
  padding: 12px;
  color: var(--ph-text-2);
  font-size: 13.5px;
  line-height: 19px;
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-preview > strong {
  color: var(--ph-text-3);
  font-size: 11px;
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-preview > p {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}
.ph-composer > .inbox-agent-review-panel.is-phone .agent-review-translation {
  margin: 0 12px 12px;
  padding: 10px 11px;
  border-color: color-mix(in srgb, var(--ph-accent, var(--accent)) 30%, var(--ph-border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--ph-accent, var(--accent)) 7%, var(--ph-surface-2));
  color: var(--ph-text-2);
  font-size: 12.5px;
}
.ph-composer > .inbox-agent-review-panel.is-phone .agent-review-translation.is-translated > header strong,
.ph-composer > .inbox-agent-review-panel.is-phone .agent-review-translation.is-translated > p,
.ph-composer > .inbox-agent-review-panel.is-phone .agent-review-translation.is-unavailable strong {
  color: var(--ph-text);
}
.ph-composer > .inbox-agent-review-panel.is-phone .agent-review-translation.is-translated > header small,
.ph-composer > .inbox-agent-review-panel.is-phone .agent-review-translation.is-unavailable small {
  color: var(--ph-text-3);
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-editor {
  padding: 12px;
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-editor > span,
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-reason strong {
  color: var(--ph-text-2);
  font-size: 11.5px;
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-editor > p {
  padding: 11px 12px;
  border-color: var(--ph-composer-border);
  border-radius: 14px;
  background: var(--ph-surface-2);
  color: var(--ph-text);
  font-size: 14.5px;
  line-height: 20px;
}
.ph-composer > .inbox-agent-review-panel.is-phone .inbox-agent-review-reason {
  padding: 0 12px 12px;
  color: var(--ph-text-3);
  font-size: 11.5px;
}
.ph-composer > .inbox-agent-review-panel.is-phone > footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 10px 12px 12px;
  border-color: var(--ph-border);
}
.ph-composer > .inbox-agent-review-panel.is-phone > footer > small {
  grid-column: 1 / -1;
  white-space: normal;
}
.ph-composer > .inbox-agent-review-panel.is-phone button {
  min-height: 42px;
  border-color: var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text-2);
  font-size: 12.5px;
}
.ph-composer > .inbox-agent-review-panel.is-phone button.is-review,
.ph-composer > .inbox-agent-review-panel.is-phone button.is-approve {
  border-color: var(--ph-accent, var(--accent));
  background: var(--ph-accent, var(--accent));
  color: #fff;
}
.ph-composer > .inbox-agent-review-panel.is-phone.is-expanded button.is-approve {
  grid-column: 1 / -1;
}
@media (prefers-reduced-motion: reduce) {
  .ph-composer-field-shell .inbox-predictive-ghost.is-phone {
    transition: none;
  }
}
.ph-composer-field::placeholder {
  color: var(--ph-text-3);
}
.ph-composer-send {
  width: 42px;
  height: 42px;
  border-radius: 21px;
  border: 0;
  background: #4f46e5;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.ph-composer-send:disabled {
  opacity: 0.45;
  cursor: default;
}

/* --- Loading / empty states --- */
.ph-skeleton-row {
  display: flex;
  gap: 12px;
  padding: 11px 10px;
  align-items: center;
}
.ph-skeleton {
  border-radius: 8px;
  background: var(--ph-hairline);
  animation: ph-skeleton-pulse 1.4s ease-in-out infinite;
}
/* The calendar's placeholder stay bars. A 34px block at --ph-hairline is
   invisible against the grid lines it sits on, so it gets its own weight —
   mixed from --ph-text rather than hardcoded, so it reads the same in light
   and dark. Small pills stay subtle; only the bars carry this. */
.ph-skeleton.is-bar {
  background: color-mix(in srgb, var(--ph-text) 12%, transparent);
}
@keyframes ph-skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.ph-stale-build {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ph-danger) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ph-danger) 38%, transparent);
  color: var(--ph-text);
  font-size: 13.5px;
  line-height: 19px;
}
.ph-stale-build svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--ph-danger);
}
.ph-stale-build strong {
  font-weight: 700;
}

.ph-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 64px 32px;
  text-align: center;
}
.ph-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ph-text);
}
.ph-empty-body {
  font-size: 13.5px;
  line-height: 19px;
  color: var(--ph-text-2);
}
/* Shown only when the list FAILED — an empty list has nothing to retry. The whole
   point is that the two states are distinguishable; see lib/inbox/list-state.ts. */
.ph-empty-retry {
  margin-top: 6px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  border: 1px solid var(--ph-hairline);
  background: var(--ph-surface);
  color: var(--ph-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ph-empty-retry:active {
  opacity: 0.6;
}
.ph-convo-failure {
  flex: 1;
}
.ph-convo-failure-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}
.ph-convo-failure-actions .ph-empty-retry {
  margin-top: 0;
}
.ph-convo-failure-actions .ph-empty-retry.is-primary {
  border-color: transparent;
  background: var(--ph-accent);
  color: #fff;
}

/* --- Phone tab bar overlay mode (legacy compact routes) + More sheet --- */
.ph-tabbar.is-fixed {
  position: fixed;
  z-index: 70;
}
.ph-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  /* --ph-sheet-dim is 1 at rest and driven toward 0 by the swipe-down drag in
     PhoneEdgeBack, so the dim lifts in step with the sheet. Expressed as a
     multiplier rather than a whole colour so the 0.5 stays defined once here
     and the drag never has to parse a computed rgba() back apart. */
  background: rgba(0, 0, 0, calc(0.5 * var(--ph-sheet-dim, 1)));
  display: flex;
  align-items: flex-end;
}
.ph-sheet {
  width: 100%;
  border-radius: 24px 24px 0 0;
  background: var(--ph-surface, #1b1b20);
  color: var(--ph-text, #ededee);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  animation: ph-sheet-in 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  font-family: var(--font-manrope), "Manrope", -apple-system, system-ui, sans-serif;
  /* D15 — a sheet may never become a full-screen page: a strip of backdrop
     always stays visible (and tappable) above it, content scrolls inside. */
  max-height: calc(100% - env(safe-area-inset-top, 0px) - 44px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@keyframes ph-sheet-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.ph-sheet-grab {
  /* Visual bar stays 36x5 — the padded box is the swipe-down hit target. */
  width: 72px;
  height: 21px;
  padding: 8px 18px;
  border-radius: 11px;
  background: var(--ph-border, rgba(255, 255, 255, 0.1));
  background-clip: content-box;
  margin: 0 auto 6px;
  flex: 0 0 auto;
}
/* D15 — every sheet shows its way out, pinned while the sheet scrolls. */
.ph-sheet-close {
  position: sticky;
  top: 2px;
  z-index: 6;
  align-self: flex-end;
  margin: -27px 0 6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ph-text-2, #8a8a93);
  cursor: pointer;
  flex: 0 0 auto;
}
[data-theme="light"] .ph-sheet-close {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.55);
}
/* D16 — the seconds a send takes must LOOK like sending. */
.ph-composer-send.is-sending {
  opacity: 0.75;
}
.ph-send-spin {
  animation: ph-send-spin 0.8s linear infinite;
}
@keyframes ph-send-spin {
  to { transform: rotate(360deg); }
}
/* D17 — phone: composer-anchored popup menus span the width and never leave
   the visual viewport (top/left/max-height come inline from the editor). */
@media (max-width: 640px) {
  .inbox-slash-menu,
  .inbox-mention-menu {
    right: 12px;
    max-width: none;
    z-index: 12000;
  }
}
.ph-sheet-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 10px;
  border-radius: 14px;
  border: 0;
  background: transparent;
  color: var(--ph-text, #ededee);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.ph-sheet-row svg {
  color: var(--ph-text-2, #8a8a93);
}
.ph-sheet-row:active {
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
}
.ph-sheet-row:disabled {
  cursor: wait;
  opacity: 0.48;
}
.ph-sheet-footer {
  margin-top: 6px;
  padding: 10px;
  border-top: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
}
/* Thread action sheet (parity C1) — the desktop row's "⋯" menu as a glass sheet. */
.ph-tsheet-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 10px 12px;
  border-bottom: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  margin-bottom: 6px;
}
.ph-tsheet-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ph-tsheet-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ph-text, #ededee);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-tsheet-meta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ph-text-2, #8a8a93);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-tsheet-sep {
  height: 1px;
  background: var(--ph-hairline, rgba(255, 255, 255, 0.06));
  margin: 6px 10px;
}

/* ---- Quick-look (Hakim 2026-07-24): the press-and-hold thread sheet is two
   SHORT pages — Details (who they are + their stay) and Actions (tags + the
   thread actions). Tabs pick the page so neither is ever a wall of text. */
.ph-tsheet-tabs {
  display: flex;
  gap: 6px;
  padding: 2px;
  margin: 4px 10px 2px;
  border-radius: 12px;
  background: var(--ph-hairline, rgba(255, 255, 255, 0.06));
}
.ph-tsheet-tab {
  flex: 1 1 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ph-text-2, #b4b4bc);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ph-tsheet-tab.is-active {
  background: var(--ph-surface, #1b1b1f);
  color: var(--ph-text, #ededee);
}
[data-theme="light"] .ph-tsheet-tab.is-active {
  background: #ffffff;
  color: #18181b;
}
.ph-tsheet-page {
  display: flex;
  flex-direction: column;
}
.ph-tsheet-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
}
.ph-tsheet-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-text, #ededee);
  font-size: 11.5px;
  font-weight: 700;
}
.ph-tsheet-fact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ph-text-2, #b4b4bc);
  font-size: 13.5px;
  font-weight: 600;
}
.ph-tsheet-fact.is-link {
  color: var(--ph-accent, #818cf8);
  text-decoration: none;
}
.ph-tsheet-stay {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 6px 12px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
}
.ph-tsheet-stay-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ph-text-3);
}
.ph-tsheet-stay-dates {
  color: var(--ph-text, #ededee);
  font-size: 15px;
  font-weight: 700;
}
.ph-tsheet-stay-prop,
.ph-tsheet-stay-status {
  color: var(--ph-text-2, #b4b4bc);
  font-size: 13px;
  font-weight: 600;
}
.ph-tsheet-empty {
  margin: 8px 12px 12px;
  color: var(--ph-text-3);
  font-size: 13.5px;
}
/* Quick-look money card (slice 2b) — same inset/card as .ph-tsheet-stay, same
   money-row typography as the calendar booking sheet (.ph-cal-sheet-m*). All
   theme tokens, so light + dark come free. Figures are the viewer's waterfall. */
.ph-tsheet-money {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 6px 12px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
}
.ph-tsheet-mtpl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ph-text-3);
  margin-bottom: 2px;
}
.ph-tsheet-mrow {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ph-text-2);
  font-weight: 600;
}
.ph-tsheet-mrow .is-strong {
  color: var(--ph-text);
  font-weight: 700;
  font-size: 15px;
}
.ph-tsheet-mrow.is-net {
  border-top: 1px solid var(--ph-hairline);
  padding-top: 8px;
  margin-top: 3px;
  font-weight: 700;
}
.ph-tsheet-mnote {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ph-text-3);
}
.ph-tsheet-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 4px;
}
.ph-tsheet-tags .ph-filter-chips {
  flex-wrap: wrap;
}
.ph-tag-scope-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.ph-tag-scope-head small {
  color: var(--ph-text-3);
  font-size: 11.5px;
  line-height: 1.3;
  text-align: right;
}
.ph-contact-tags-scope {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}
.ph-contact-tags-link {
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  border-radius: 12px;
}
.ph-contact-tags-link > span {
  font-weight: 650;
}
.ph-contact-tags-link > small {
  margin-left: auto;
  color: var(--ph-text-3);
  font-size: 11.5px;
  text-align: right;
}
/* Tag chip: the .ph-fchip shape, plus the tag's own colour as a dot. */
.ph-tag-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: #b4b4bc;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
[data-theme="light"] .ph-tag-chip {
  border-color: rgba(0, 0, 0, 0.08);
  background: #ffffff;
  color: #52525b;
}
.ph-tag-chip.is-on {
  background: var(--ph-accent-strong);
  border-color: transparent;
  color: #ffffff;
}
.ph-tag-chip:disabled {
  opacity: 0.55;
}
.ph-tag-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ph-text-3, #8a8a93);
}
/* Row tag strip stays inside the existing one-line title rail. Assignments are
   hydrated after first paint, so this rail must never add vertical row geometry
   when its chips arrive. */
.ph-row-tags {
  display: flex;
  flex: 0 1 42%;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.ph-row-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ph-hairline, rgba(255, 255, 255, 0.06));
  color: var(--ph-text-2, #b4b4bc);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-row-tag .ph-tag-dot {
  width: 6px;
  height: 6px;
}
.ph-row-tag.is-more {
  color: var(--ph-text-3);
}
/* Conversation header tag strip (slice 2c) — a full-width scrollable rail of the
   thread's tags directly under the header. Reuses .ph-row-tag chips; relaxes the
   list row's 42% clamp since the strip owns the whole width and scrolls. Theme
   tokens throughout = light/dark parity. */
.ph-convo-tagbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--ph-hairline);
}
.ph-convo-tagbar::-webkit-scrollbar {
  display: none;
}
.ph-convo-tagbar .ph-row-tag {
  max-width: none;
  flex: 0 0 auto;
}
.ph-tsheet-rename {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.ph-tsheet-input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-text, #ededee);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 0 12px;
  outline: none;
}
.ph-tsheet-presets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
}
.ph-tsheet-error {
  padding: 8px 10px 2px;
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
}
/* Message action sheet + reactions (parity C2). */
.ph-sheet-row.is-danger {
  color: #ef4444;
}
.ph-sheet-row.is-danger svg {
  color: #ef4444;
}
.ph-react-strip {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 10px 10px;
  border-bottom: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  margin-bottom: 6px;
}
.ph-react-strip.is-feedback {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.ph-react-strip.is-feedback .ph-react-pick {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}
.ph-react-pick {
  width: 46px;
  height: 46px;
  border-radius: 23px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: transparent;
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.32, 0.72, 0, 1);
}
.ph-react-pick:active {
  transform: scale(1.18);
}
.ph-react-pick.is-mine {
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  border-color: var(--ph-accent, #6366f1);
}
.ph-react-row {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.ph-react-row.out {
  justify-content: flex-end;
}
.ph-react-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 12px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: var(--ph-surface, #1b1b20);
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  color: var(--ph-text, #ededee);
}
/* ClickUp-parity ghost add-reaction (approved 2026-07-26): rides an existing
   reactions row only; dashed + muted so it reads as an invitation, not a count. */
.ph-react-chip.ph-react-add {
  border-style: dashed;
  background: transparent;
  color: var(--ph-text-3);
  padding: 2px 7px;
}
.ph-react-chip.ph-react-add:active {
  background: color-mix(in srgb, var(--ph-accent) 10%, transparent);
}
.ph-react-chip.ph-reply-add {
  color: var(--ph-text, #ededee);
  border-color: color-mix(in srgb, #25d366 42%, var(--ph-hairline, rgba(255, 255, 255, 0.08)));
}
.ph-composer .wa-reply-context {
  margin: 3px 0 6px;
  background: color-mix(in srgb, #25d366 8%, var(--ph-surface, #1b1b20));
}
.ph-react-chip.is-mine {
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  border-color: var(--ph-accent, #6366f1);
}
.ph-react-n {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ph-text-2, #8a8a93);
}
/* Who-reacted sheet — long-press a reaction chip. Compact list of reactor names. */
.ph-react-who-sheet {
  padding-bottom: 14px;
}
.ph-react-who-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 20px 12px;
  border-bottom: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
}
.ph-react-who-emoji {
  font-size: 26px;
  line-height: 1;
}
.ph-react-who-count {
  font-size: 13px;
  font-weight: 650;
  color: var(--ph-text-2, #8a8a93);
}
.ph-react-who-list {
  list-style: none;
  margin: 0;
  padding: 6px 0 0;
  max-height: 40vh;
  overflow-y: auto;
}
.ph-react-who-name {
  padding: 10px 20px;
  font-size: 15px;
  color: var(--ph-text, #ededee);
}
.ph-react-who-name + .ph-react-who-name {
  border-top: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.045));
}
/* Thread sheet (parity C2) — header identity is a tappable button now. */
.ph-convo-id {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.ph-tags-block {
  padding: 2px 10px 8px;
  border-bottom: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ph-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ph-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: transparent;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ph-text-mid, #c9c9cf);
  font-family: inherit;
}
.ph-tag-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
}
.ph-tag-chip.is-addable {
  cursor: pointer;
}
.ph-tags-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ph-tag-create {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.ph-color-dot.is-active {
  border-color: var(--ph-text, #ededee);
}
.ph-sheet-row-toggle {
  width: 100%;
}
.ph-sheet-row-toggle .ph-switch {
  margin-left: auto;
}
.ph-translated-note {
  display: block;
  border: 0;
  background: transparent;
  padding: 2px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ph-text-2, #8a8a93);
  font-family: inherit;
  cursor: pointer;
  text-align: inherit;
}
.inbox-recipient-language.is-compact {
  width: 100%;
  margin: 4px 0 0;
  padding: 7px 9px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ph-accent, #6366f1) 6%, var(--ph-composer-bg, var(--bg-elevated)));
}
.inbox-recipient-language.is-compact .inbox-recipient-language-label,
.inbox-recipient-language.is-compact .inbox-recipient-language-select,
.inbox-recipient-language.is-compact .inbox-recipient-language-preview-text {
  font-size: 12px;
}
.inbox-recipient-language.is-compact .inbox-recipient-language-preview-text {
  max-height: 88px;
}
.ph-composer-toolbar > .inbox-recipient-language-slot {
  margin-left: auto;
}
.ph-composer .inbox-recipient-language-control.is-toolbar .inbox-recipient-language-select {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 17px;
  border-color: var(--ph-hairline);
  background: transparent;
  color: var(--ph-text-2);
}
.ph-composer .inbox-recipient-language-control.is-toolbar.is-active .inbox-recipient-language-select {
  border-color: color-mix(in srgb, var(--ph-accent, var(--accent)) 46%, var(--ph-hairline));
  background: color-mix(in srgb, var(--ph-accent, var(--accent)) 10%, transparent);
  color: var(--ph-accent, var(--accent));
}
.ph-composer .inbox-recipient-language-control.is-toolbar .inbox-recipient-language-select > svg,
.ph-mailsheet-language-slot .inbox-recipient-language-select > svg {
  display: none;
}
.ph-mailsheet-language-slot {
  display: inline-flex;
  flex: none;
}
.ph-mailsheet-language-slot .inbox-recipient-language-select {
  display: inline-flex;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
}
.ph-mailsheet-language-slot .inbox-recipient-language-control.is-active .inbox-recipient-language-select {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.inbox-outbound-language.is-compact {
  align-self: flex-end;
  max-width: min(82vw, 520px);
  margin: 3px 0 0;
  color: var(--ph-text-2, var(--text-muted));
  font-size: 11.5px;
  text-align: right;
}
.inbox-outbound-language.is-compact .inbox-outbound-language-body {
  text-align: left;
}
/* PARITY C5b — in-conversation search + contact filters. */
.ph-search-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}
.ph-search-hit {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.ph-search-hit:active {
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
}
.ph-search-hit-who {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ph-text-2, #8a8a93);
}
.ph-search-hit-text {
  font-size: 13.5px;
  color: var(--ph-text, #ededee);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-msg-flash {
  animation: ph-msg-flash 1.5s ease-out;
}
@keyframes ph-msg-flash {
  0%,
  35% {
    background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
    border-radius: 14px;
  }
  100% {
    background: transparent;
  }
}
.ph-contact-filters {
  padding: 2px 6px 8px;
}

/* PARITY C5b — second brain chrome. The header is ONE native row (see
   .ph-brain-head); New chat, the labelled Tools picker and Close sit as normal
   flex children in it. Never absolutely position these or recreate the old
   four-icon pile as a second stacked row. */
.ph-brain-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.ph-brain-tool {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: transparent;
  color: var(--ph-text-2, #8a8a93);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ph-brain-tool.is-on {
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-accent, #6366f1);
  border-color: var(--ph-accent, #6366f1);
}
.ph-brain-tools-trigger {
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  border-radius: 20px;
  background: transparent;
  color: var(--ph-text-2, #8a8a93);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ph-brain-tools-trigger.is-active {
  border-color: var(--ph-accent, #6366f1);
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-accent, #6366f1);
}
.ph-brain-tools-trigger.is-active .selectmenu-label.is-placeholder {
  color: var(--ph-accent, #6366f1);
}

/* PARITY C5 — presence facepile + flip row. */
.ph-presence {
  display: flex;
  align-items: center;
  margin-right: 4px;
}
.ph-presence-dot {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  border: 2px solid var(--ph-bg, #101014);
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-text, #ededee);
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-left: -6px;
}
.ph-presence-dot:first-child {
  margin-left: 0;
}
.ph-presence-dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ph-flip-row {
  padding: 0 10px 8px;
}
.ph-bubble-media {
  display: block;
  position: relative;
  width: min(240px, 100%);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  border-radius: 12px;
  background: var(--ph-card, rgba(255, 255, 255, 0.04));
}
/* #32 parity (web PR #1183) — 3+ photos on one message render as a square-tile
   mosaic, not a stack. Fixed aspect-ratio tiles = zero post-load layout shift.
   The scrim is fixed white-on-dark, readable on any photo. */
.ph-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 4px;
  width: 100%;
  margin-bottom: 4px;
}
.ph-photo-grid.is-whatsapp-album {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}
.ph-photo-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: var(--ph-card, rgba(255, 255, 255, 0.04));
  padding: 0;
  cursor: pointer;
}
.ph-photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ph-photo-more-scrim {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
.ph-photo-grid-less {
  align-self: flex-start;
  margin: 0 0 4px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ph-accent, #8b8bf5);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.ph-file-card {
  position: relative;
}

/* PARITY C4 — Details sheet (pane-4 port). */
.ph-details {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--ph-bg, #101014);
  display: flex;
  flex-direction: column;
  animation: ph-sheet-in 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  font-family: var(--font-manrope), "Manrope", -apple-system, system-ui, sans-serif;
}
.ph-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  border-bottom: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
}
.ph-details-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ph-text, #ededee);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-details-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Desktop pane-4 cards inherit their own styles; keep them full-width here. */
.ph-details-body .inbox-crm-card,
.ph-details-body .inbox-detail-section {
  width: 100%;
  box-sizing: border-box;
}
.ph-details-note-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.ph-sheet-row-primary {
  color: var(--ph-accent, #6366f1);
}
.ph-sheet-row-primary svg {
  color: var(--ph-accent, #6366f1);
}

/* PARITY C3 — composer completion. */
.ph-email-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ph-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ph-email-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ph-text-2, #8a8a93);
  width: 34px;
  flex-shrink: 0;
}
.ph-email-row .ph-email-input,
.ph-email-row select.ph-email-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border-radius: 12px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: transparent;
  color: var(--ph-text, #ededee);
  font-family: inherit;
  font-size: 14px;
  padding: 0 10px;
  outline: none;
}
.ph-email-row .ph-email-input:focus {
  border-color: var(--ph-accent, #6366f1);
}
.ph-email-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ph-ctx-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-text-mid, #c9c9cf);
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
}
.ph-ctx-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  display: inline-flex;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.ph-sendvia-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ph-sendvia-from {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ph-text-2, #8a8a93);
}
.ph-sendvia-agent {
  color: var(--ph-text-2, #8a8a93);
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
  white-space: nowrap;
}
.ph-sendvia-from select {
  max-width: 170px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: transparent;
  color: var(--ph-text, #ededee);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 0 6px;
}
.ph-sendvia-single {
  font-size: 12px;
  font-weight: 600;
  color: var(--ph-text-2, #8a8a93);
}
.ph-inter-builder {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px dashed var(--ph-hairline, rgba(255, 255, 255, 0.1));
}
.ph-inter-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ph-inter-row .ph-tsheet-input.is-desc {
  flex: 1.4;
}
.ph-inter-x {
  border: 0;
  background: transparent;
  color: var(--ph-text-2, #8a8a93);
  display: inline-flex;
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
}
.ph-call-confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
}
.ph-call-confirm-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ph-text, #ededee);
}
.ph-call-confirm-actions {
  display: flex;
  gap: 8px;
}
.ph-char-counter {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--ph-text-3, #6f6f77);
  flex-shrink: 0;
}
.ph-tpl-manage {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  margin-right: 8px;
  border: 0;
  background: transparent;
  color: var(--ph-accent, #6366f1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
/* Canonical recipient bar, phone glass skin (scoped like the channel switcher). */
.ph-composer .crb {
  min-width: 0;
}
.ph-composer .crb-trigger {
  height: 30px;
  border-radius: 15px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: transparent;
  color: var(--ph-text, #ededee);
  font-size: 12.5px;
  font-weight: 600;
  padding: 0 10px;
}
.ph-composer .crb-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ph-text-2, #8a8a93);
}
.ph-jump-pill {
  position: sticky;
  bottom: 10px;
  align-self: center;
  margin: 8px auto 0;
  display: block;
  padding: 7px 15px;
  border-radius: 17px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: var(--ph-tabbar-bg, rgba(27, 27, 32, 0.82));
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
  color: var(--ph-accent, #6366f1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  z-index: 5;
}
/* D10: entrance rides the label, not the blurred pill (backdrop roots must
   not self-animate on WebKit). */
.ph-jump-pill > span {
  display: inline-block;
  animation: ph-typing-in 0.18s ease-out;
}

/* --- Phone inbox extras --- */
.ph-search-field {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin-top: 12px;
  height: 42px;
  border-radius: 21px;
  background: var(--ph-composer-bg);
  border: 1px solid var(--ph-composer-border);
  color: var(--ph-text);
  font-size: 14.5px;
  font-family: inherit;
  padding: 0 15px;
  outline: none;
}
.ph-search-field::placeholder {
  color: var(--ph-text-3);
}
/* Clear button (Hakim, build 18: "the search bar has no x to clear button").
   `type="search"` gets no native clear control in an iOS WKWebView, and the
   glass capsule's -webkit-appearance:none removes the last chance of one, so
   it is drawn here. 🔴 The wrapper deliberately has NO box of its own and the
   button is absolutely positioned OVER the field: the native glass head
   measures the input's rect once to place its real UIKit capsule, so anything
   that changes that rect moves the native head off the web one. */
.ph-search-wrap {
  position: relative;
  display: block;
  min-width: 0;
}
.ph-search-wrap .ph-search-field {
  /* Long queries stop short of the button instead of running under it. */
  padding-right: 42px;
}
.ph-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  color: var(--ph-text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
/* D23 press grammar: a quiet iOS highlight, never a scale bounce. Literals
   rather than a token because there is no defined press token — `--ph-press`
   appears twice in this file and is declared nowhere. */
.ph-search-clear:active {
  background: rgba(255, 255, 255, 0.055);
  color: var(--ph-text);
}
[data-theme="light"] .ph-search-clear:active {
  background: rgba(0, 0, 0, 0.05);
}
.ph-bubble-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}
.ph-send-error {
  margin: 0 14px 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--ph-danger) 14%, transparent);
  color: var(--ph-danger);
  font-size: 12.5px;
  font-weight: 600;
}
.ph-composer--hint {
  justify-content: center;
  align-items: center;
  color: var(--ph-text-3);
  font-size: 13px;
  font-weight: 600;
  min-height: 52px;
}

/* --- Filter sheet (2f) --- */
.ph-filter-sheet {
  max-height: 88dvh;
}
.ph-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px;
}
.ph-filter-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ph-text);
}
.ph-filter-reset {
  border: 0;
  background: transparent;
  color: var(--ph-accent-soft);
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.ph-filter-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* 72px bottom clearance: the shell's floating Ask-Stavros pill hovers over
     the sheet's scroll area, and without it the LAST section (the whole-inbox
     sweeps) can never scroll out from underneath the pill. */
  padding: 0 4px 72px;
}
.ph-filter-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ph-filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ph-text-3);
}
.ph-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ph-filter-apply {
  margin-top: 12px;
  padding: 14px 0;
  border: 0;
  border-radius: 19px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.35);
}

/* --- Conversation extras: day groups, activity feed, attachments --- */
.ph-day-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: stretch;
}
/* In the UOS room the feed rows carry their own padding, so the group gap
   halves — ClickUp-parity density (approved 2026-07-26). Guest threads keep
   the 8px bubble rhythm.
   Round 2: this is now the ONLY meaningful space between two messages (the rows
   themselves are near-flush), so it does the grouping work — roughly 10× the
   1px gap inside a message. Dense inside, separated between: that ratio is what
   makes ClickUp scan quickly, not small numbers everywhere. */
.ph-convo.is-uos-room .ph-day-group {
  gap: 6px;
}
/* The gap BETWEEN day groups (and the slab of air above the first message) is
   the scroll container's, not the group's — halving the group gap alone left
   both untouched, which is why round 1 still read as loose. Guest bubble
   threads keep the roomier 8px/14px rhythm. */
.ph-convo.is-uos-room .ph-convo-scroll {
  gap: 4px;
  padding-top: 8px;
}
.ph-activity-row {
  align-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  max-width: 92%;
  text-align: center;
  font-size: 11.5px;
  line-height: 16px;
  color: var(--ph-text-2);
  margin: 2px 0;
}
.ph-activity-row.is-overstay .ph-activity-text {
  color: var(--ph-danger);
  font-weight: 700;
}
.ph-activity-meta {
  color: var(--ph-text-3);
  font-size: 10.5px;
}
.ph-bubble-media {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  max-width: 100%;
}
.ph-bubble-video,
.ph-bubble-audio {
  display: block;
  max-width: 100%;
  border-radius: 12px;
  margin: 2px 0 4px;
}
.ph-bubble-video {
  width: min(280px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
}
.ph-bubble-audio {
  width: 230px;
  max-width: 100%;
}
.ph-file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 180px;
  padding: 9px 11px;
  margin: 2px 0 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.07);
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
[data-theme="light"] .ph-bubble-in .ph-file-card {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
}
.ph-bubble-out .ph-file-card {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.ph-file-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
}
.ph-bubble-out .ph-file-card-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.ph-file-card-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ph-file-card-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-file-card-kind {
  font-size: 11px;
  color: var(--ph-text-3);
}
.ph-bubble-out .ph-file-card-kind {
  color: rgba(255, 255, 255, 0.75);
}

/* --- Room / internal message rendering --- */
/* TestFlight #41, Hakim: "Get rid of that horrendous blue outline around messages."
   Internal / UOS posts used to wear an accent wash + a dashed accent border here.
   Desktop has never done that — `.inbox-bubble.in.is-internal` renders them FLAT
   (transparent, borderless) and lets the avatar + name + time head carry identity.
   The phone only flattened them inside a ROOM (via .is-uos-feed), so a team message
   in a mixed guest thread showed the raw dashed outline. Flat everywhere now, so no
   context can bring it back; the distinction from a guest bubble is the absence of
   bubble chrome, exactly as on desktop. */
.ph-bubble--internal {
  background: transparent;
  border: none;
  color: var(--ph-text);
}

/* UOS room messages read as a continuous team feed: avatar in a left rail,
   identity and message in the content column, no speech-bubble card. External
   guest transports deliberately keep the bubble treatment above. */
.ph-msg.is-uos-feed {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  column-gap: 10px;
  /* Round 2 (Hakim 2026-07-26, annotated screenshot): the name must sit
     DIRECTLY on top of its own words. Any real gap here and the eye stops
     reading "person + what they said" as one block, which is what made the
     feed look sparse even after round 1 halved the padding. */
  row-gap: 1px;
  align-items: start;
  width: 100%;
  /* ClickUp-parity density (approved 2026-07-26): was 8px/10px, then 4px/6px.
     Separation between messages now comes from the day-group gap alone, so the
     row's own padding stays hairline. */
  padding: 1px 4px 3px;
  border-radius: 10px;
}
.ph-msg.is-uos-feed > * {
  grid-column: 2;
  min-width: 0;
}
.ph-msg.is-uos-feed .ph-msg-head {
  display: contents;
}
.ph-msg.is-uos-feed .ph-msg-avatar {
  grid-column: 1;
  /* 🔴 LOAD-BEARING for density. The avatar is 34px and the name line is ~18px.
     Confined to row 1, the avatar sizes the row, so the name floats in the
     middle of a 34px band and lands ~20px above its own text — the gap Hakim
     circled. Spanning into row 2 lets the name row collapse to the text's own
     line height while the avatar still runs down the left rail beside the first
     lines, exactly as ClickUp does it. Revert this and the gap comes straight
     back no matter what the paddings say. */
  grid-row: 1 / span 2;
  align-self: start;
  width: 34px;
  height: 34px;
  margin-top: 1px;
  border: 1px solid var(--ph-hairline);
  background: var(--ph-surface-2);
}
/* The feed variant's avatar box is 34px, but TurnHead asks ContactAvatar for a
   22px avatar (it has no idea which box it landed in), so the silhouette would
   come out at 14px — 41% of the disc instead of the 64% every other avatar in
   the app uses. Scale it here rather than teaching TurnHead about its context.
   2026-07-26; replaces the old initials font-size override. */
.ph-msg.is-uos-feed .ph-msg-avatar-ph > svg {
  width: 22px;
  height: 22px;
}
.ph-msg.is-uos-feed .ph-msg-headline {
  grid-column: 2;
  grid-row: 1;
  /* Was min-height:35px + align-content:center, to match the avatar's height.
     That padding WAS the wasted space — see the avatar rule above. The name now
     takes exactly one tight line and the message begins on the next one. */
  min-height: 0;
  align-content: start;
  line-height: 18px;
  gap: 0 7px;
}
.ph-msg.is-uos-feed .ph-msg-sender {
  color: var(--ph-text);
  font-size: 14px;
  font-weight: 750;
}
.ph-msg.is-uos-feed .ph-msg-meta,
.ph-msg.is-uos-feed .ph-msg-time {
  font-size: 11.5px;
}
.ph-msg.is-uos-feed .ph-bubble-in,
.ph-msg.is-uos-feed .ph-bubble--internal {
  align-self: stretch;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ph-text);
  font-size: 15px;
  line-height: 21px;
}
.ph-msg.is-uos-feed .ph-msg-task-row,
.ph-msg.is-uos-feed .ph-react-row,
.ph-msg.is-uos-feed .ph-feedback-status,
.ph-msg.is-uos-feed .inbox-replies-chip,
.ph-msg.is-uos-feed .ph-uos-retry {
  justify-self: start;
  align-self: start;
  margin-left: 0;
}

/* A message that names the current User remains visibly marked even after the
   room itself is read. The rail answers “where was I mentioned?”; read state
   still controls the inbox-level unread badge separately. */
/* ClickUp-parity flatten (approved 2026-07-26): edge + @pill only, no tinted
   card — every message keeps the same silhouette (matches the desktop rule). */
.ph-msg.is-mention-for-me {
  box-shadow: inset 3px 0 0 var(--ph-accent);
}
.ph-msg.is-uos-feed.is-mention-for-me {
  width: calc(100% + 20px);
  margin-left: -10px;
  padding-left: 14px;
  padding-right: 14px;
}

.ph-reply-facepile {
  display: inline-flex;
  align-items: center;
  padding-right: 2px;
}
.ph-reply-avatar {
  width: 19px;
  height: 19px;
  margin-left: -5px;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  flex: none;
  border: 1.5px solid var(--ph-surface);
  border-radius: 50%;
  background: var(--ph-surface-2);
  color: var(--ph-accent-soft);
  font-size: 9px;
  font-weight: 750;
}
.ph-reply-avatar:first-child {
  margin-left: 0;
}
.ph-reply-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.ph-msg.is-uos-feed .inbox-replies-chip {
  min-height: 30px;
  margin-top: 2px;
  padding: 4px 10px 4px 5px;
  border-color: transparent;
  background: transparent;
}
.ph-msg.is-uos-feed .inbox-replies-chip:hover,
.ph-msg.is-uos-feed .inbox-replies-chip:active {
  background: color-mix(in srgb, var(--ph-accent) 10%, transparent);
}

/* Dedicated phone reply page. The header and composer stay put while parent and
   replies scroll as one flat UOS feed. */
.ph-uos-thread-header {
  min-height: 62px;
}
.ph-uos-thread-title {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ph-uos-thread-title strong {
  color: var(--ph-text);
  font-size: 16px;
  line-height: 20px;
}
.ph-uos-thread-title span {
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-convo.is-uos-thread-view .ph-convo-scroll {
  gap: 0;
  padding: 0 14px 12px;
}
.ph-uos-thread-parent {
  margin: 0 -14px;
  padding: 0 14px 10px;
  border-bottom: 1px solid var(--ph-hairline);
}
.ph-uos-thread-section-label,
.ph-uos-thread-replies-label {
  margin: 0 -14px 4px;
  padding: 8px 18px;
  background: color-mix(in srgb, var(--ph-surface-2) 72%, transparent);
  color: var(--ph-text-3);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.ph-uos-thread-replies-label {
  margin-top: 0;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--ph-hairline);
}
.ph-convo.is-uos-thread-view > .inbox-td-composer.is-phone-thread {
  flex: 0 0 auto;
  gap: 4px;
  margin: 6px 14px min(max(calc(env(safe-area-inset-bottom, 0px) - 24px), 8px), 14px);
  padding: 8px 10px;
  border: 0.5px solid var(--ph-tabbar-border);
  border-radius: 26px;
  background: var(--ph-tabbar-bg);
  box-shadow: var(--ph-tabbar-shadow);
  backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
}
.inbox-td-composer.is-phone-thread .inbox-td-composer-editor .inbox-rich-editor {
  min-height: 42px;
  padding: 8px 10px;
  color: var(--ph-text);
  font-size: 15px;
}
.inbox-td-composer.is-phone-thread .inbox-td-composer-tool,
.inbox-td-composer.is-phone-thread .inbox-td-composer-send {
  width: 40px;
  height: 40px;
  border-radius: 20px;
}
.inbox-td-composer.is-phone-thread .inbox-td-composer-send {
  background: var(--ph-accent);
}
.ph-convo.is-uos-room .ph-date-pill {
  position: relative;
  top: auto;
  /* Round 2 (Hakim's first circle): the band around "Today" was the widest gap
     on the screen — its own margins stacked on the day-group gap above AND the
     scroll container's gap between groups. */
  margin: 1px 0 3px;
  padding: 2px 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* --- Calls (slice 2): in-call screen (2b), collapsed pill (2d), dialer (2a) ---
   The call layer mounts from SoftphoneProvider OUTSIDE .phone-app, so it is in
   the ph-variable scope lists above and paints its own bg/font. Values lifted
   from artboards 2a/2b/2d (dark) and their light twins. */
.ph-call-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0a0a0b;
  color: var(--ph-text);
  --ph-call-btn: rgba(255, 255, 255, 0.09);
  --ph-call-chipbg: rgba(255, 255, 255, 0.06);
  --ph-call-chipborder: rgba(255, 255, 255, 0.08);
  --ph-call-live: #4ade80;
  --ph-call-end: #ef4444;
  font-family: var(--font-manrope), "Manrope", -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
}
[data-theme="light"] .ph-call-layer {
  background: #f5f5f4;
  --ph-call-btn: #ffffff;
  --ph-call-chipbg: #ffffff;
  --ph-call-chipborder: rgba(0, 0, 0, 0.08);
  --ph-call-live: #16a34a;
  --ph-call-end: #dc2626;
}
.ph-call-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  height: 340px;
  background: radial-gradient(closest-side, rgba(99, 102, 241, 0.22), transparent);
  pointer-events: none;
}
[data-theme="light"] .ph-call-glow {
  background: radial-gradient(closest-side, rgba(79, 70, 229, 0.12), transparent);
}
.ph-call-min {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  right: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--ph-text-2);
  cursor: pointer;
  z-index: 2;
}
.ph-call-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 44px 24px 0;
  position: relative;
}
.ph-call-via {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 13px;
  background: var(--ph-call-chipbg);
  border: 1px solid var(--ph-call-chipborder);
  font-size: 11.5px;
  color: var(--ph-text-2);
  font-weight: 600;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-call-avatar-img,
.ph-call-avatar-fallback,
.ph-call-avatar-initials {
  width: 104px;
  height: 104px;
  border-radius: 52px;
  object-fit: cover;
}
.ph-call-avatar-fallback,
.ph-call-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  font-size: 34px;
  font-weight: 700;
}
.ph-call-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: center;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-call-sub {
  font-size: 13.5px;
  color: var(--ph-text-2);
  margin-top: -8px;
  text-align: center;
  max-width: 92%;
}
.ph-call-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ph-text-2);
  margin-top: -4px;
  min-height: 22px;
}
/* Phone-tier twin of .softphone-quality-warning — parity in the same cycle. */
.ph-call-quality {
  align-self: center;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--state-warning) 18%, transparent);
  color: var(--state-warning);
}
.ph-call-status.is-live {
  color: var(--ph-call-live);
}
.ph-call-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: var(--ph-call-live);
}
.ph-call-recpill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.14);
  color: #f87171;
  font-size: 11px;
  font-weight: 700;
}
.ph-call-recpill.is-paused {
  background: var(--ph-call-chipbg);
  color: var(--ph-text-2);
}
.ph-call-recdot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: currentColor;
}
.ph-call-lower {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding-bottom: 6px;
  position: relative;
}
.ph-call-grid {
  display: grid;
  grid-template-columns: repeat(3, 96px);
  gap: 16px 22px;
}
.ph-call-ctl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ph-text-2);
  font-weight: 600;
}
.ph-call-ctl-btn {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  border: 0;
  background: var(--ph-call-btn);
  color: var(--ph-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
[data-theme="light"] .ph-call-ctl-btn {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
}
.ph-call-ctl-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.ph-call-ctl-btn.is-on {
  background: var(--ph-text);
  color: var(--ph-bg);
}
.ph-call-chips {
  display: flex;
  gap: 10px;
}
.ph-call-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 17px;
  background: var(--ph-call-chipbg);
  border: 1px solid var(--ph-call-chipborder);
  color: var(--ph-text-mid);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.ph-call-chip:disabled {
  opacity: 0.45;
  cursor: default;
}
.ph-call-chip.is-ok {
  background: var(--ph-accent-strong);
  border-color: transparent;
  color: #fff;
}
.ph-call-chip-recdot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: #f87171;
}
.ph-call-chip.is-rec {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.4);
}
.ph-call-round {
  width: 72px;
  height: 72px;
  border-radius: 36px;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
}
.ph-call-round.is-end,
.ph-call-round.is-decline {
  background: var(--ph-call-end);
  box-shadow: 0 10px 26px rgba(239, 68, 68, 0.35);
}
.ph-call-round.is-accept {
  background: #22c55e;
  box-shadow: 0 10px 26px rgba(34, 197, 94, 0.35);
}
.ph-call-answer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 300px;
  align-self: center;
  padding-bottom: 24px;
}
.ph-call-answer-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ph-text-2);
}
.ph-call-dtmf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.ph-call-dtmf-display {
  min-height: 26px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ph-text);
  max-width: 320px;
  overflow: hidden;
  white-space: nowrap;
}
.ph-call-dtmf-grid {
  display: grid;
  grid-template-columns: repeat(3, 68px);
  gap: 10px 20px;
}
.ph-call-dtmf-key {
  width: 68px;
  height: 56px;
  border-radius: 28px;
  border: 0;
  background: var(--ph-call-btn);
  color: var(--ph-text);
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ph-call-consult {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ph-text-2);
}
.ph-call-sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  border-radius: 22px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.4);
  padding: 14px 14px calc(14px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3;
}
.ph-call-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
}
.ph-call-sheet-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 17px;
  background: var(--ph-call-chipbg);
  color: var(--ph-text-2);
  cursor: pointer;
}
.ph-call-roster {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.ph-call-roster-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ph-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.ph-call-roster-row.is-selected {
  background: var(--ph-accent-wash);
  border-color: color-mix(in srgb, var(--ph-accent) 35%, transparent);
}
.ph-call-roster-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--ph-text-3);
}
.ph-call-roster-dot.is-idle,
.ph-call-roster-dot.is-available {
  background: #4ade80;
}
.ph-call-roster-dot.is-on_call,
.ph-call-roster-dot.is-busy {
  background: #f87171;
}
.ph-call-sheet-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
}
.ph-call-sheet-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.ph-call-toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 120px);
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  color: var(--ph-text);
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  max-width: 86%;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 4;
}

/* A minimised call is app chrome, not a floating card. The bar owns one slim
   row above every phone screen and the root is moved down by exactly that row,
   so Inbox controls, messages and composers remain fully usable. CallKit keeps
   its own Dynamic Island/status indicator outside this web layout. */
.ph-active-call-bar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 89;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 4px;
  min-height: calc(env(safe-area-inset-top, 0px) + var(--ph-active-call-bar-height));
  padding:
    env(safe-area-inset-top, 0px)
    8px
    0;
  border-bottom: 1px solid var(--ph-border);
  background: var(--ph-surface);
  color: var(--ph-text);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  font-family: var(--font-manrope), "Manrope", -apple-system, system-ui, sans-serif;
}
.ph-active-call-bar-main {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: var(--ph-active-call-bar-height);
  padding: 0 4px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ph-active-call-bar-main:active {
  background: color-mix(in srgb, var(--ph-text) 7%, var(--ph-surface));
}
.ph-active-call-bar-end {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #e14343;
  box-shadow: 0 5px 14px rgba(225, 67, 67, 0.28);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ph-active-call-bar-end:active {
  transform: scale(0.94);
}
.ph-active-call-bar-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #052e16;
  background: #22c55e;
}
.ph-active-call-bar-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.ph-active-call-bar-copy strong,
.ph-active-call-bar-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-active-call-bar-copy strong {
  color: var(--ph-text);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
}
.ph-active-call-bar-copy small {
  color: var(--ph-text-2);
  font-size: 10.5px;
  font-weight: 620;
  line-height: 1.2;
}
.ph-active-call-bar-time {
  color: var(--ph-success);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 760;
}
.ph-active-call-bar-open {
  color: var(--ph-text-2);
}
:root[data-phone-call-docked="true"] .phone-app {
  top: var(--ph-active-call-bar-height);
}
@media (min-width: 641px) {
  .ph-active-call-bar {
    display: none;
  }
}

/* 2a: the new-call keypad sheet. Mounts inside .phone-app (inherits ph vars). */
.ph-dialer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: var(--ph-bg);
  color: var(--ph-text);
  padding-top: calc(env(safe-area-inset-top, 0px) + 4px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
}
.ph-dialer-header {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  flex: none;
}
.ph-dialer-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}
.ph-dialer-header-spacer {
  width: 36px;
  height: 36px;
  flex: none;
}
.ph-dialer-via-row {
  display: flex;
  justify-content: center;
  padding: 6px 20px 0;
  position: relative;
}
.ph-dialer-via {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 19px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  color: var(--ph-text-2);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  max-width: 100%;
}
.ph-dialer-via-dot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: #4ade80;
  flex: none;
}
.ph-dialer-via-value {
  color: var(--ph-text);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-dialer-via-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 20px;
  right: 20px;
  border-radius: 16px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-border);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
}
.ph-dialer-via-opt {
  border: 0;
  background: transparent;
  color: var(--ph-text);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-radius: 11px;
  cursor: pointer;
}
.ph-dialer-via-opt.is-selected {
  background: var(--ph-accent-wash);
  color: var(--ph-chip-text);
}
.ph-dialer-display {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 26px 24px 8px;
  min-height: 76px;
}
.ph-dialer-number {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.ph-dialer-caret {
  display: inline-block;
  width: 2px;
  height: 30px;
  background: var(--ph-accent);
  margin-left: 2px;
  animation: ph-caret-blink 1.1s steps(1) infinite;
}
@keyframes ph-caret-blink {
  50% {
    opacity: 0;
  }
}
.ph-dialer-match {
  margin: 6px 20px 0;
  display: flex;
  gap: 12px;
  padding: 11px 12px;
  align-items: center;
  border-radius: 16px;
  background: var(--ph-surface);
  border: 1px solid color-mix(in srgb, var(--ph-accent) 25%, transparent);
  color: var(--ph-text);
  cursor: pointer;
  text-align: left;
}
.ph-dialer-match-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ph-dialer-match-name {
  font-size: 14.5px;
  font-weight: 700;
}
.ph-dialer-match-sub {
  font-size: 12px;
  color: var(--ph-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-dialer-match > svg {
  color: var(--ph-text-3);
  flex: none;
}
.ph-dialer-error {
  margin: 8px 20px 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ph-danger);
}
.ph-dialer-pad {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 8px;
}
.ph-dialer-grid {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 12px 26px;
}
.ph-dialer-key {
  width: 76px;
  height: 76px;
  border-radius: 38px;
  border: 0;
  background: var(--ph-surface);
  color: var(--ph-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
[data-theme="light"] .ph-dialer-key {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.ph-dialer-key:active {
  background: var(--ph-accent-wash);
}
.ph-dialer-key-digit {
  font-size: 30px;
  font-weight: 600;
  line-height: 32px;
}
.ph-dialer-key-sub {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ph-text-3);
  min-height: 11px;
}
.ph-dialer-actions {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  gap: 12px 26px;
  align-items: center;
  justify-items: center;
}
.ph-dialer-go {
  width: 76px;
  height: 76px;
  border-radius: 38px;
}
.ph-dialer-go:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}
.ph-dialer-back {
  border: 0;
  background: transparent;
  color: var(--ph-text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
.ph-dialer-back:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Thread header action button — was the call button (slice 2); calling moved
   into the composer's channel dropdown, and AI took the top-right spot. */
.ph-convo-call,
.ph-convo-ai {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 19px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface);
  color: var(--ph-success);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ph-convo-ai {
  border-color: transparent;
  background: var(--ph-accent-wash);
  color: var(--ph-chip-text);
}
.ph-convo-ai.is-working {
  border-color: color-mix(in srgb, var(--ph-accent, #6366f1) 46%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ph-accent, #6366f1) 10%, transparent);
}
.ph-convo-call:disabled {
  opacity: 0.4;
  cursor: default;
}

/* --- Phone calendar (slice 3): 2g multicalendar grid, 2h1 day agenda, 2h2
   booking sheet. Channel tints follow the booking source, same rule as the
   desktop chips. --- */
.ph-cal-toggle {
  display: flex;
  padding: 2px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--ph-text) 4%, transparent);
  border: 0;
}
.ph-cal-toggle-btn {
  min-width: 56px;
  height: 36px;
  gap: 4px;
  padding: 0 7px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: var(--ph-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.ph-cal-toggle-btn.is-active {
  background: var(--ph-accent-wash);
  color: var(--ph-chip-text);
}
.ph-cal-command-head {
  padding: 2px 12px 0;
}
.ph-cal-command-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 48px;
  padding: 3px;
  border: 0.5px solid var(--ph-tabbar-border);
  border-radius: 16px;
  background: var(--ph-tabbar-bg);
  -webkit-backdrop-filter: blur(18px) saturate(1.8);
  backdrop-filter: blur(18px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.14);
}
[data-theme="light"] .ph-cal-command-row {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -0.5px 0 rgba(0, 0, 0, 0.06);
}
.ph-cal-scope-trigger {
  min-width: 0;
  min-height: 40px;
  padding: 3px 7px 3px 9px;
  border: 0;
  background: transparent;
  color: var(--ph-text);
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.ph-cal-command-scope {
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  color: var(--ph-text);
  font-size: 13px;
  font-weight: 760;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-command-scope svg {
  flex: none;
  color: var(--ph-accent-soft);
}
.ph-cal-command-summary {
  max-width: 100%;
  display: block;
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 9.5px;
  font-weight: 620;
  line-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-command-clear {
  width: 34px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  cursor: pointer;
}
.ph-cal-command-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
.ph-cal-command-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  box-shadow: none;
  color: var(--ph-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  cursor: pointer;
}
.ph-cal-command-icon:last-child {
  border-left: 1px solid var(--ph-border);
  border-radius: 0 11px 11px 0;
}
.ph-cal-command-icon.is-active,
.ph-cal-command-icon[aria-pressed="true"] {
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
}
.ph-cal-scope-trigger,
.ph-cal-command-clear,
.ph-cal-command-icon {
  transition: background 0.14s ease, opacity 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}
.ph-cal-scope-trigger:active,
.ph-cal-command-clear:active,
.ph-cal-command-icon:active {
  background: var(--ph-press);
  opacity: 0.82;
}
.ph-cal-context-head {
  padding: 0 12px;
}
.ph-cal-scope-sheet {
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}
.ph-cal-scope-list {
  display: grid;
  gap: 5px;
}
.ph-cal-scope-row {
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--ph-text);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.ph-cal-scope-row.is-active {
  border-color: color-mix(in srgb, var(--ph-accent) 38%, var(--ph-border));
  background: var(--ph-accent-wash);
  color: var(--ph-chip-text);
}
.ph-cal-scope-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--ph-border);
  border-radius: 11px;
  background: var(--ph-surface-2);
  color: var(--ph-text-mid);
  display: grid;
  place-items: center;
}
.ph-cal-scope-row.is-active .ph-cal-scope-icon {
  border-color: color-mix(in srgb, var(--ph-accent) 38%, var(--ph-border));
  background: color-mix(in srgb, var(--ph-accent) 14%, var(--ph-surface-2));
  color: var(--ph-accent-soft);
}
.ph-cal-scope-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.ph-cal-scope-copy strong {
  font-size: 13.5px;
  font-weight: 760;
}
.ph-cal-scope-copy small {
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 11px;
  font-weight: 540;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-search-sheet {
  height: min(82dvh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ph-cal-search-field {
  min-height: 46px;
  margin: 0 1px 8px;
  padding: 0 10px;
  border: 1px solid var(--ph-border);
  border-radius: 14px;
  background: var(--ph-surface-2);
  color: var(--ph-text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.ph-cal-search-field input {
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ph-text);
  flex: 1;
  font: inherit;
  font-size: 14px;
}
.ph-cal-search-field input::placeholder {
  color: var(--ph-text-3);
}
.ph-cal-search-field > button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--ph-surface);
  color: var(--ph-text-2);
  display: grid;
  place-items: center;
}
.ph-cal-search-results {
  min-height: 0;
  padding: 2px 1px calc(12px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.ph-cal-search-section + .ph-cal-search-section {
  margin-top: 10px;
}
.ph-cal-search-section h3 {
  margin: 0;
  padding: 5px 9px;
  color: var(--ph-text-3);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ph-cal-search-row {
  width: 100%;
  min-height: 50px;
  padding: 6px 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--ph-text);
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.ph-cal-search-row:active {
  background: var(--ph-accent-wash);
}
.ph-cal-search-row > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 1px;
}
.ph-cal-search-row strong,
.ph-cal-search-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-search-row strong {
  font-size: 13px;
  font-weight: 730;
}
.ph-cal-search-row small {
  color: var(--ph-text-2);
  font-size: 10.5px;
}
.ph-cal-search-row > svg {
  color: var(--ph-text-3);
}
.ph-cal-search-avatar,
.ph-cal-search-glyph {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.ph-cal-search-avatar {
  object-fit: cover;
}
.ph-cal-search-glyph {
  border: 1px solid var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text-mid);
  display: grid;
  place-items: center;
}
.ph-cal-search-stream-dot {
  width: 12px;
  height: 12px;
  margin-left: 12px;
  border: 2px solid color-mix(in srgb, currentColor 20%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 6px var(--ph-surface-2);
}
.ph-cal-search-empty {
  min-height: 150px;
  padding: 30px 18px;
  color: var(--ph-text-2);
  display: grid;
  place-content: center;
  gap: 5px;
  text-align: center;
}
.ph-cal-search-empty strong {
  color: var(--ph-text);
  font-size: 14px;
}
.ph-cal-search-empty span {
  font-size: 12px;
}
.ph-cal-search-status,
.ph-listpick-status {
  margin: 10px 8px;
  color: var(--ph-text-2);
  font-size: 12px;
  text-align: center;
}
.ph-cal-search-retry,
.ph-listpick-retry {
  width: calc(100% - 16px);
  min-height: 44px;
  margin: 8px;
  border: 1px solid var(--ph-border);
  border-radius: 11px;
  background: var(--ph-surface-2);
  color: var(--ph-text-2);
  font: inherit;
  font-size: 12px;
}
.ph-cal-search-retry strong,
.ph-listpick-retry strong {
  color: var(--ph-accent-soft);
}
.ph-cal-directory-retry {
  min-height: 44px;
  margin-top: 10px;
  padding: 0 16px;
  border: 1px solid var(--ph-border);
  border-radius: 999px;
  background: var(--ph-accent-wash);
  color: var(--ph-chip-text);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}
@media (max-width: 360px) {
  .ph-cal-toggle-btn {
    min-width: 38px;
    padding-inline: 6px;
  }
  .ph-cal-toggle-btn span {
    display: none;
  }
  .ph-cal-command-actions {
    gap: 1px;
  }
}
.ph-cal-nav {
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 2px;
  padding: 2px 0 0;
}
.ph-cal-nav-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ph-text-2);
  display: flex;
  align-items: center;
  cursor: pointer;
  justify-content: center;
}
.ph-cal-nav-label {
  font-size: 14.5px;
  font-weight: 740;
  letter-spacing: -0.01em;
}
.ph-cal-nav-spacer {
  flex: 1;
}
.ph-cal-today {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 12px;
  border: 0;
  background: var(--ph-accent-wash);
  color: var(--ph-chip-text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ph-cal-filter-chips {
  gap: 7px;
  margin: 0 -12px;
  padding: 1px 12px 3px;
}

/* Cleaner-first Stream week. Seven vertical day sections are readable on a
   narrow screen while still giving the whole week's workload, property and
   owner in one pass — unlike a flat task list or seven squeezed columns. */
.ph-cal-workweek {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px calc(152px + env(safe-area-inset-bottom, 0px));
}
.ph-cal-workweek-summary {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 8px;
  color: var(--ph-text-2);
  font-size: 12px;
}
.ph-cal-workday {
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid var(--ph-border);
  border-radius: 15px;
  background: var(--ph-surface);
}
.ph-cal-workday.is-today {
  border-color: color-mix(in srgb, var(--ph-accent) 48%, var(--ph-border));
  box-shadow: inset 3px 0 0 var(--ph-accent);
}
.ph-cal-workday.is-undated { border-style: dashed; }
.ph-cal-workday-head {
  min-height: 44px;
  padding: 7px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--ph-border);
}
.ph-cal-workday-head span { font-size: 14px; font-weight: 750; }
.ph-cal-workday-head strong { color: var(--ph-text-2); font-size: 12px; }
.ph-cal-workday-head small {
  min-width: 23px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ph-glass-sheen);
  color: var(--ph-text-3);
  font-size: 10.5px;
  text-align: center;
}
.ph-cal-workday-list { display: flex; flex-direction: column; }
.ph-cal-worktask {
  position: relative;
  min-height: 74px;
  padding: 10px 10px 10px 8px;
  border: 0;
  border-bottom: 1px solid var(--ph-border);
  background: transparent;
  color: var(--ph-text);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  row-gap: 5px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.ph-cal-worktask::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ph-task-tint, var(--ph-accent));
}
.ph-cal-worktask:last-child { border-bottom: 0; }
.ph-cal-worktask:active { background: var(--ph-press); }
.ph-cal-worktask-time {
  grid-column: 1;
  grid-row: 1 / 3;
  color: var(--ph-text-2);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
}
.ph-cal-worktask-main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-cal-worktask-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 720;
}
.ph-cal-flip-tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 42%, var(--ph-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-warning) 12%, transparent);
  color: var(--state-warning);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  vertical-align: 1px;
  white-space: nowrap;
}
.ph-cal-worktask-main small { color: var(--ph-text-3); font-size: 11px; }
.ph-cal-worktask-owner {
  grid-column: 2 / 4;
  grid-row: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ph-text-2);
  font-size: 11.5px;
  line-height: 1.3;
}
.ph-cal-worktask-owner > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-worktask-owner.is-unassigned {
  color: var(--ph-danger, #ef4444);
  font-weight: 700;
}
.ph-cal-worktask-faces { display: inline-flex; flex: none; }
.ph-cal-worktask-face {
  width: 24px;
  height: 24px;
  margin-left: -5px;
  border: 2px solid var(--ph-surface);
  border-radius: 50%;
  object-fit: cover;
  overflow: hidden;
}
.ph-cal-worktask-face:first-child { margin-left: 0; }
.ph-cal-worktask > svg { grid-column: 3; grid-row: 1; color: var(--ph-text-3); }
.ph-cal-grid-scroll,
.ph-cal-agenda-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 16px 130px;
}
.ph-cal-dayhead {
  display: flex;
  height: 34px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--ph-bg);
}
.ph-cal-dayhead-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ph-text-2);
}
.ph-cal-dayhead-cell.is-today {
  color: var(--ph-accent-soft);
  font-weight: 700;
}
.ph-cal-dayhead-num {
  color: var(--ph-text-mid);
}
.ph-cal-dayhead-num.is-today {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--ph-accent);
  color: #fff;
  align-items: center;
  justify-content: center;
}
.ph-cal-rows {
  position: relative;
}
.ph-cal-todayband {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--ph-accent-wash);
  opacity: 0.55;
  border-radius: 6px;
  pointer-events: none;
}
.ph-cal-row {
  position: relative;
  height: 62px;
  border-top: 1px solid var(--ph-hairline);
  display: flex;
  align-items: center;
}
.ph-cal-rows > .ph-cal-row:last-child {
  border-bottom: 1px solid var(--ph-hairline);
}
.ph-cal-prop {
  width: 96px;
  flex: none;
  display: flex;
  flex-direction: column;
  padding-right: 6px;
}
.ph-cal-prop-name {
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-bar {
  position: absolute;
  box-sizing: border-box;
  top: 50%;
  transform: translateY(-50%);
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  min-width: 20px;
}
.ph-cal-bar-text {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Stay continues beyond the visible week — square that edge off. */
.ph-cal-bar.is-clip-left {
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
}
.ph-cal-bar.is-clip-right {
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
}
.ph-cal-bar-logo {
  width: 12px;
  height: 12px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Unknown channels render bare two-letter initials in this wrapper
     (PlatformLogo's last-resort branch) — keep them chip-sized. */
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 4px;
}
.ph-cal-bar-logo .platform-logo-image {
  width: 12px;
  height: 12px;
}
.ph-cal-bar-logo .platform-logo-fallback {
  font-size: 7px;
  font-weight: 800;
  line-height: 12px;
  letter-spacing: 0.02em;
}
.ph-cal-bar.is-airbnb {
  background: rgba(255, 90, 95, 0.18);
  border-color: rgba(255, 90, 95, 0.4);
  color: #ff9a9e;
}
.ph-cal-bar.is-booking {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.4);
  color: #93c5fd;
}
.ph-cal-bar.is-vrbo {
  background: rgba(20, 184, 166, 0.16);
  border-color: rgba(20, 184, 166, 0.4);
  color: #5eead4;
}
.ph-cal-bar.is-direct {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
  color: var(--ph-accent-soft);
}
[data-theme="light"] .ph-cal-bar.is-airbnb {
  color: #b3373b;
}
[data-theme="light"] .ph-cal-bar.is-booking {
  color: #1d4ed8;
}
[data-theme="light"] .ph-cal-bar.is-vrbo {
  color: #0f766e;
}
[data-theme="light"] .ph-cal-bar.is-direct {
  color: #4338ca;
}
.ph-cal-bar.is-block {
  border: 1px dashed var(--ph-border);
  background: repeating-linear-gradient(45deg, var(--ph-glass-sheen) 0 5px, transparent 5px 10px);
  justify-content: center;
  color: var(--ph-text-2);
  /* Was `cursor: default` while this was an inert span. It opens its detail
     sheet now, exactly like a stay bar does. (2026-07-26.) */
  cursor: pointer;
}
.ph-cal-bar.is-block .ph-cal-bar-text {
  font-size: 10.5px;
}

/* Agenda (2h1) */
.ph-cal-strip {
  display: flex;
  justify-content: space-between;
  padding: 10px 4px 4px;
}
.ph-cal-strip-day {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  color: inherit;
  font-family: inherit;
}
.ph-cal-strip-wd {
  font-size: 11px;
  font-weight: 600;
  color: var(--ph-text-3);
}
.ph-cal-strip-wd.is-selected {
  color: var(--ph-accent-soft);
  font-weight: 700;
}
.ph-cal-strip-num {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--ph-text-mid);
}
.ph-cal-strip-num.is-selected {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}
.ph-cal-strip-dot {
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: transparent;
}
.ph-cal-strip-dot.is-on {
  background: var(--ph-text-3);
}
.ph-cal-agenda-head {
  padding: 10px 4px 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.ph-cal-agenda-title {
  font-size: 16px;
  font-weight: 700;
}
.ph-cal-agenda-sub {
  font-size: 12.5px;
  color: var(--ph-text-2);
}
.ph-cal-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ph-cal-ev {
  display: flex;
  gap: 12px;
  padding: 11px 10px;
  align-items: center;
  border-radius: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.ph-cal-ev.is-card {
  background: var(--ph-surface);
}
.ph-cal-ev.is-task {
  min-height: 78px;
}
.ph-cal-agenda-owner {
  display: grid;
  min-width: 72px;
  max-width: 120px;
  justify-items: end;
  gap: 3px;
  margin-left: auto;
}
.ph-cal-agenda-owner > span:last-child {
  max-width: 100%;
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-agenda-owner.is-unassigned > span:last-child {
  color: var(--ph-danger, #ef4444);
  font-weight: 760;
}
/* (`.ph-cal-ev.is-muted` removed 2026-07-26. Its only job was `cursor: default`
   for the blocked-period row, which is now a real button that opens the block's
   detail. `.ph-cal-ev-title.is-muted` is a different rule and still in use.) */
.ph-cal-ev-glyph {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-cal-ev-glyph.is-out {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
}
.ph-cal-ev-glyph.is-in {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 21px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
}
.ph-cal-ev-channel {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--ph-bg);
  border-radius: 7px;
  background: var(--ph-bg);
  box-sizing: border-box;
  color: var(--ph-text-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 6px;
  font-weight: 800;
}
.ph-cal-ev-channel .platform-logo-image {
  width: 100%;
  height: 100%;
  border-radius: 5px;
}
.ph-cal-ev-channel .platform-logo-fallback {
  font-size: 6px;
  line-height: 1;
}
.ph-cal-ev-glyph.is-block {
  border: 1px dashed var(--ph-border);
  color: var(--ph-text-2);
}
.ph-cal-ev-glyph.is-event {
  border: 1px solid color-mix(in srgb, #8b7cf6 42%, var(--ph-border));
  background: color-mix(in srgb, #8b7cf6 13%, transparent);
  color: #a99cff;
}
.ph-cal-ev-glyph.is-task {
  border: 1px solid color-mix(
    in srgb,
    var(--ph-task-tint, var(--ph-accent-soft)) 44%,
    var(--ph-border)
  );
  color: var(--ph-task-tint, var(--ph-accent-soft));
  background: color-mix(
    in srgb,
    var(--ph-task-tint, var(--ph-accent-soft)) 13%,
    transparent
  );
}
.ph-cal-ev-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-cal-ev-title {
  font-size: 14px;
  font-weight: 700;
}
.ph-cal-ev-title.is-muted {
  font-weight: 600;
  color: var(--ph-text-mid);
}
.ph-cal-ev-sub {
  font-size: 12px;
  color: var(--ph-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-ev-sub.has-time-change {
  overflow: visible;
  white-space: normal;
}
.ph-cal-time-change {
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 42%, var(--ph-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--state-warning) 12%, transparent);
  color: var(--state-warning);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  vertical-align: 1px;
}
.ph-cal-ev-chev {
  color: var(--ph-text-3);
  flex: none;
}

/* Booking sheet (2h2) */
.ph-cal-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
}
.ph-cal-sheet {
  width: 100%;
  border-radius: 24px 24px 0 0;
  background: var(--ph-bg);
  border-top: 1px solid var(--ph-border);
  padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + 22px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ph-cal-sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.ph-cal-sheet-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ph-cal-sheet-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ph-cal-sheet-src {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ph-text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-sheet-status {
  flex: none;
  padding: 4px 11px;
  border-radius: 11px;
  background: var(--ph-success-wash);
  color: var(--ph-success);
  font-size: 11.5px;
  font-weight: 700;
}
.ph-cal-sheet-close {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  border: 0;
  background: var(--ph-surface);
  color: var(--ph-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ph-cal-sheet-dates {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-hairline);
}
.ph-cal-sheet-date {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-cal-sheet-date.is-right {
  text-align: right;
}
.ph-cal-sheet-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ph-text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ph-cal-sheet-value {
  font-size: 14px;
  font-weight: 700;
}
.ph-cal-sheet-nights {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ph-chip-text);
  background: var(--ph-accent-wash);
  padding: 4px 10px;
  border-radius: 11px;
}
.ph-cal-sheet-money {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px;
}
.ph-cal-sheet-mrow {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--ph-text-2);
  font-weight: 600;
}
.ph-cal-sheet-mrow .is-strong {
  color: var(--ph-text);
  font-weight: 700;
  font-size: 15px;
}
.ph-cal-sheet-meta {
  font-size: 12.5px;
  color: var(--ph-text-2);
  padding: 0 4px;
}
.ph-cal-sheet-assignment {
  display: grid;
  gap: 8px;
}
.ph-cal-sheet-assignment > span:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ph-text);
  font-weight: 650;
}
.ph-cal-sheet-assignment > span:last-child.is-unassigned { color: var(--ph-danger, #ef4444); }
/* Blocked-period sheet (TestFlight `ALfMFxL1`). The chrome is the booking
   sheet's; only the status pill's colour and these two text blocks differ — a
   block is not a confirmed stay, so the green pill would read as good news. */
.ph-cal-sheet-status.is-block {
  background: var(--ph-surface-2);
  color: var(--ph-text-2);
  /* In light mode `--ph-surface-2` is white and the sheet behind it is #f5f5f4,
     so the pill all but vanished without an edge. The green "Confirmed" pill
     carries its own wash and needs none. */
  border: 1px solid var(--ph-border);
  padding: 3px 10px;
}
/* The person's own words about why they blocked it — the reason someone taps a
   block at all, so it gets the card treatment rather than a grey caption. */
.ph-cal-sheet-blocknote {
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--ph-surface-2);
  color: var(--ph-text);
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ph-cal-sheet-blockline {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ph-text-2);
  padding: 0 4px;
}
.ph-cal-sheet-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border-radius: 16px;
  border: 0;
  background: var(--ph-accent-strong);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* --- Phone owner financials (slice 4): 2i statement + 2j reports. Pure skin
   over the owner-statement engine output. --- */
.ph-fin-owner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ph-text-2);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
}
.ph-fin-seg {
  display: flex;
  gap: 6px;
  padding: 12px 0 0;
}
.ph-fin-seg-btn,
.ph-mkt-seg-btn {
  flex: 1;
  padding: 9px 0;
  border-radius: 15px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface);
  color: var(--ph-text-2);
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.ph-fin-seg-btn.is-active,
.ph-mkt-seg-btn.is-active {
  background: var(--ph-accent-strong);
  border-color: transparent;
  color: #fff;
}
.ph-fin-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 16px 130px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ph-fin-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 16px 16px;
  border-radius: 20px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-hairline);
}
.ph-fin-hero-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ph-text-3);
}
.ph-fin-hero-amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.ph-fin-hero-sub {
  font-size: 12.5px;
  color: var(--ph-text-2);
  text-align: center;
}
.ph-fin-props {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-hairline);
  overflow: hidden;
}
.ph-fin-prop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.ph-fin-prop + .ph-fin-prop {
  border-top: 1px solid var(--ph-hairline);
}
.ph-fin-prop-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-fin-prop-name {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-fin-prop-sub {
  font-size: 12px;
  color: var(--ph-text-2);
}
.ph-fin-prop-amount {
  font-size: 14.5px;
  font-weight: 700;
}
.ph-fin-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-hairline);
}
.ph-fin-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ph-text-2);
}
.ph-fin-line > span:last-child {
  color: var(--ph-text);
  font-weight: 700;
}
.ph-fin-line > span.is-neg {
  color: var(--ph-danger);
}
.ph-fin-line.is-net {
  border-top: 1px solid var(--ph-hairline);
  padding-top: 12px;
  font-size: 15px;
  color: var(--ph-text);
}
.ph-fin-line.is-net > span:last-child {
  font-size: 16px;
}
.ph-fin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ph-fin-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-hairline);
}
.ph-fin-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ph-text-2);
}
.ph-fin-stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ph-fin-mix,
.ph-fin-narrative {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  background: var(--ph-surface);
  border: 1px solid var(--ph-hairline);
}
.ph-fin-mix-title {
  font-size: 13.5px;
  font-weight: 700;
}
.ph-fin-mix-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ph-text-3);
}
.ph-fin-mix-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ph-fin-mix-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ph-text-2);
}
.ph-fin-mix-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--ph-accent-wash);
  overflow: hidden;
}
.ph-fin-mix-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
}
.ph-fin-narrative .owner-stmt-narrative {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ph-text-mid);
}
.ph-fin-owner-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
}
/* --- Saved views (2f, slice 5) — composite chips in the filter sheet. --- */
.ph-fchip.is-view {
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.ph-view-apply {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 8px 4px 8px 14px;
  cursor: pointer;
}
.ph-view-del {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.6;
  font-size: 14px;
  font-family: inherit;
  padding: 0 10px 0 4px;
  cursor: pointer;
}
.ph-view-save-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ph-view-save-input {
  width: 130px;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
}

/* --- Second brain (2l, slice 6): full-screen pull-down sheet hosting the
   canonical AiOpsChat at phone width. --- */
.ph-brain {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: var(--ph-bg);
  color: var(--ph-text);
  padding-top: calc(env(safe-area-inset-top, 0px) + 6px);
  animation: ph-brain-drop 0.28s cubic-bezier(0.32, 0.72, 0.28, 1);
}
@keyframes ph-brain-drop {
  from {
    transform: translateY(-24px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/* Single native header row: title left, New chat / Tools / Close right. The old
   four-icon shape and the earlier absolutely pinned close both overcrowded the
   narrowest phone widths; never reintroduce either. */
.ph-brain-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid var(--ph-hairline);
  flex: none;
}
.ph-brain-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ph-brain-title > span {
  display: grid;
  gap: 1px;
}
.ph-brain-title strong {
  font: inherit;
}
.ph-brain-title small {
  color: var(--ph-text-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}
.ph-brain-title svg {
  color: var(--ph-accent-soft);
}
.ph-brain-close {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  /* Hairline + fallbacks: this close button appears on body-portaled sheets,
     so it must stay visible even if a future portal root misses the ph
     variable scope lists (the D8 trap — an invisible close is a dead end). */
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  background: var(--ph-surface, #1b1b20);
  color: var(--ph-text-2, #8a8a93);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ph-brain-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 4px calc(env(safe-area-inset-bottom, 0px) + 4px);
}
.ph-brain-body .aiops-chat {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.ph-brain.is-thread-focus .ph-brain-head {
  padding-block: 12px;
}
.ph-brain.is-thread-focus .ph-brain-body {
  padding-top: 6px;
}
.ph-brain.is-rule-builder {
  padding-top: env(safe-area-inset-top, 0px);
}
.ph-brain.is-rule-builder .autobuild {
  min-height: 0;
  background: var(--ph-bg);
}
.ph-brain.is-rule-builder .autobuild-head {
  min-height: 54px;
  padding-inline: 10px 14px;
}
.ph-brain.is-rule-builder .autobuild-x {
  width: 40px;
  height: 40px;
}
.ph-brain.is-rule-builder .autobuild-save {
  min-height: 40px;
}
.ph-brain.is-rule-builder .autobuild-body {
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 760px) {
  .autobuild-dialog-backdrop { padding: 0; }
  .autobuild-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .autobuild-dialog .autobuild-body { padding: 14px; }
}

/* ── Phone keep-alive hosts + conversation push layer ─────────────────── */
/* Hidden screens stay mounted (data + scroll survive) but render nothing. */
.ph-screen-host {
  display: contents;
}
.ph-screen-host[hidden] {
  display: none;
}

/* Listing commercial-model editor reused inside the phone Calendar action
   sheet. The business control stays canonical; these rules only let its
   desktop section chrome breathe in the full-screen phone surface. */
.ph-commercial-model .ph-details-body {
  padding: 12px 14px calc(28px + env(safe-area-inset-bottom, 0px));
}
.ph-commercial-model .properties-subsection {
  padding: 0;
  border: 0;
  background: transparent;
}
.ph-commercial-model .properties-management-stack {
  gap: 14px;
}
.ph-commercial-model .properties-input-text,
.ph-commercial-model .btn {
  min-height: 44px;
}
.ph-list-layer {
  display: contents;
}
/* The conversation opens OVER the list; the list stays mounted behind it so
   back is instant with scroll preserved. The LAYER only fades (fast) so the
   glass capsule at the bottom reads as one continuous bar; the header and
   messages slide in iOS-push style; the capsule's CONTENTS rise in — the
   tab bar morphing into the type bar. */
.ph-convo-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--ph-bg);
  animation: ph-layer-in 0.14s ease;
}
/* Early keyboard lift — set by initShellKeyboard while the Keyboard plugin
   waits to resize the native webview. The custom property is a viewport-linked
   residual, not a fixed pixel value: as 100vh shrinks, the web lift reaches
   zero in the SAME layout pass, so web and native offsets can never overlap for
   one painted frame. The persistent keyboard-open class pins the composer's
   bottom margin across that handover; the message list re-pins itself. */
.ph-kb-lift .ph-convo-layer {
  padding-bottom: var(--ph-kb-lift, 0px);
}
html.ph-kb-open .ph-convo-layer .ph-composer {
  margin-bottom: 12px;
}
@keyframes ph-layer-in {
  from {
    opacity: 0;
  }
}
.ph-convo-layer .ph-convo-header,
.ph-convo-layer .ph-convo-scroll {
  animation: ph-convo-push 0.3s cubic-bezier(0.32, 0.72, 0.28, 1);
}
@keyframes ph-convo-push {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
.ph-convo-layer .ph-composer > * {
  animation: ph-morph-content 0.22s ease 0.08s backwards;
}
@keyframes ph-morph-content {
  from {
    opacity: 0;
    transform: translateY(7px) scale(0.96);
  }
}
/* D19 — the reverse morph: back holds the layer for a beat while the composer
   capsule shrinks into tab bar geometry (inline height, set by the component)
   and the layer fades to reveal the real tab bar in the exact same spot. */
.ph-convo-layer.is-exiting {
  animation: ph-layer-out 0.22s ease forwards;
  pointer-events: none;
}
@keyframes ph-layer-out {
  to {
    opacity: 0;
  }
}
.ph-convo-layer.is-exiting .ph-composer > * {
  animation: ph-morph-content-out 0.16s ease forwards;
}
@keyframes ph-morph-content-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
}

/* ── D26: calendar answers a sideways swipe — new week/day slides in from
   the direction of travel (plain content, no backdrop-filter, transform OK). */
.ph-cal-enter-fwd {
  animation: ph-cal-enter-fwd 0.24s cubic-bezier(0.25, 0.8, 0.35, 1);
}
.ph-cal-enter-back {
  animation: ph-cal-enter-back 0.24s cubic-bezier(0.25, 0.8, 0.35, 1);
}
@keyframes ph-cal-enter-fwd {
  from {
    opacity: 0.3;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes ph-cal-enter-back {
  from {
    opacity: 0.3;
    transform: translateX(-36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Liquid-glass press feedback — everything tappable responds. List rows
   deliberately NOT here (D23): full-width rows get the iOS background
   highlight on .ph-row itself, a scale bounce on a row reads cheap. ───── */
.ph-tab,
.ph-icon-btn,
.ph-fchip,
.ph-filter-apply,
.ph-filter-reset,
.ph-cal-ev,
.ph-cal-strip-day,
.ph-cal-nav-btn,
.ph-cal-today,
.ph-cal-toggle-btn,
.ph-cal-sheet-cta,
.ph-tool-plus,
.ph-plus-item,
.ph-tpl-item,
.ph-tpl-close,
.ph-convo-ai,
.ph-composer .inbox-channel-switcher-trigger,
.ph-composer-send {
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.ph-tab:active,
.ph-icon-btn:active,
.ph-fchip:active,
.ph-filter-apply:active,
.ph-filter-reset:active,
.ph-cal-ev:active,
.ph-cal-strip-day:active,
.ph-cal-nav-btn:active,
.ph-cal-today:active,
.ph-cal-toggle-btn:active,
.ph-cal-sheet-cta:active,
.ph-tool-plus:active,
.ph-plus-item:not(.is-disabled):active,
.ph-tpl-item:active,
.ph-tpl-close:active,
.ph-convo-ai:active,
.ph-composer .inbox-channel-switcher-trigger:active,
.ph-composer-send:active {
  transform: scale(0.94);
  opacity: 0.85;
}
/* Calendar bars carry a permanent translateY — compose, don't clobber. */
.ph-cal-bar {
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.ph-cal-bar:active {
  transform: translateY(-50%) scale(0.96);
}
/* Lane-packed bars in the day view's stay band (2026-07-26): `top` and `height`
   come from the lane, so the vertical centring the grid's bars rely on has to
   be switched off here — including in :active, which would otherwise re-apply
   the -50% and jump the bar half its height on every tap. */
.ph-cal-bar.is-laned {
  transform: none;
}
.ph-cal-bar.is-laned:active {
  transform: scale(0.96);
}

/* ── Appearance control (More sheet): Auto | Light | Dark segmented row.
   Auto follows the iPhone's system setting (the default, defect D7). ── */
.ph-theme-row {
  justify-content: space-between;
}
.ph-theme-label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.ph-theme-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 14px;
  background: var(--ph-surface-2);
  border: 1px solid var(--ph-hairline);
}
.ph-theme-seg button {
  border: 0;
  background: transparent;
  color: var(--ph-text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 7px 13px;
  border-radius: 11px;
  cursor: pointer;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.16s;
}
.ph-theme-seg button:active {
  transform: scale(0.94);
  opacity: 0.85;
}
.ph-theme-seg button.is-active {
  background: var(--ph-surface);
  color: var(--ph-text);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.18);
}

/* ── D4: the desktop rich editor (TipTap) inside the phone UOS composer.
   Skinned as the .ph-composer-field twin: same bubble, same bounds; the
   contenteditable auto-grows natively so D9's JS is textarea-only. ── */
.ph-composer-row .inbox-rich-editor {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 132px;
  border-radius: 21px;
  background: var(--ph-composer-bg);
  border: 1px solid var(--ph-composer-border);
  color: var(--ph-text);
  font-size: 14.5px;
  line-height: 20px;
  padding: 10px 15px;
  overflow-y: auto;
}
.ph-composer-row .inbox-rich-editor .ProseMirror {
  outline: none;
  min-height: 20px;
}
.ph-composer-row .inbox-rich-editor p {
  margin: 0;
}
/* Suggestion popovers at phone width: the slash menu already has a narrow
   rule; the mention menu needs one too or its 240-320px fixed width can run
   off a 393px viewport. */
@media (max-width: 640px) {
  .message-composer-mention-menu,
  .task-desc-mention-menu {
    min-width: 0;
    width: min(88vw, 320px);
    max-width: calc(100vw - 24px);
  }
}

/* ── PHONE HOME — the day at a glance (Claude-designed; artboards waived
   2026-07-19). Dark = base, light via [data-theme="light"] overrides. ──── */
.ph-home-date {
  margin: 0 0 2px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ph-accent-soft);
}
.ph-home-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  /* Bottom padding must clear the floating Ask bar + tab bar INCLUDING the
     device safe-area (round 5: a flat 186px left the ask chips buried behind
     the glass on real iPhones — env() is 0 in desktop browsers, ~34px on
     device, and the bars themselves ride up by it). */
  padding: 10px 16px calc(196px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 22px;
}
/* Round 5 scroll-collapse fix: this is a COLUMN FLEX container, so its children
   default to flex-shrink:1 — and the two horizontal scroll rows inside it
   (.ph-home-props, .ph-sv-asks) have overflow-x:auto, which zeroes their
   automatic min-height. When the day's content overflowed the screen, those
   two rows silently absorbed ALL the shrinkage: they collapsed to their
   padding, their children painted over the content below as clipped ghosts,
   and scrollHeight collapsed back toward clientHeight so the screen "wouldn't
   scroll". Never let the day's cards shrink — overflow is what the scroll is for. */
.ph-home-scroll > * {
  flex: 0 0 auto;
}
.ph-home-skeletons {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ph-home-today {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 22px;
  padding: 16px 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.05) 55%, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--ph-hairline);
  color: inherit;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.ph-home-today:active {
  transform: scale(0.985);
}
[data-theme="light"] .ph-home-today {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(79, 70, 229, 0.03) 55%, rgba(0, 0, 0, 0.015));
}
.ph-home-today-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ph-home-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.ph-home-stat-glyph {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ph-home-stat-glyph.is-in { background: rgba(52, 211, 153, 0.16); color: #34d399; }
.ph-home-stat-glyph.is-out { background: rgba(251, 146, 60, 0.16); color: #fb923c; }
.ph-home-stat-glyph.is-flip { background: rgba(96, 165, 250, 0.16); color: #60a5fa; }
.ph-home-stat-glyph.is-night { background: rgba(167, 139, 250, 0.16); color: #a78bfa; }
[data-theme="light"] .ph-home-stat-glyph.is-in { background: rgba(5, 150, 105, 0.1); color: #059669; }
[data-theme="light"] .ph-home-stat-glyph.is-out { background: rgba(234, 88, 12, 0.1); color: #ea580c; }
[data-theme="light"] .ph-home-stat-glyph.is-flip { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
[data-theme="light"] .ph-home-stat-glyph.is-night { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.ph-home-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--ph-text);
  line-height: 1;
}
.ph-home-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ph-text-3);
}
.ph-home-next {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ph-text-2);
}
.ph-home-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ph-home-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ph-text-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-home-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.18);
  color: var(--ph-accent-soft);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ph-home-attn {
  border-radius: 18px;
  background: var(--ph-surface);
  overflow: hidden;
}
.ph-home-attn-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: transparent;
  border: 0;
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.ph-home-attn-row + .ph-home-attn-row {
  border-top: 1px solid var(--ph-hairline);
}
.ph-home-attn-row:active {
  background: rgba(255, 255, 255, 0.05);
  transition-duration: 0.04s;
}
[data-theme="light"] .ph-home-attn-row:active {
  background: rgba(0, 0, 0, 0.04);
}
.ph-home-attn-glyph {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ph-home-attn-glyph.is-message {
  background: rgba(99, 102, 241, 0.15);
  color: var(--ph-accent-soft);
}
.ph-home-attn-glyph.is-task {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
[data-theme="light"] .ph-home-attn-glyph.is-task {
  background: rgba(217, 119, 6, 0.1);
  color: #d97706;
}
/* Guest avatar on a Needs-attention message row (canonical ContactAvatar).
   Sized to the same 32px footprint as the task glyph so the row never shifts;
   applied to BOTH the <img> and the fallback silhouette span. */
.ph-home-attn-avatar {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  flex: 0 0 auto;
  object-fit: cover;
}
/* Same-day operational flag ("Checks out today"). Apricot, never red — the
   attention mood colour ([[project_ai_ops_living_pane]]/StavrosPresence). */
.ph-home-attn-flag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
  color: #fb923c;
  background: rgba(251, 146, 60, 0.16);
  border-radius: 5px;
  padding: 0 5px;
  margin-right: 6px;
}
[data-theme="light"] .ph-home-attn-flag {
  color: #c2410c;
  background: rgba(251, 146, 60, 0.14);
}
.ph-home-attn-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ph-home-attn-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ph-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-home-attn-sub {
  font-size: 12.5px;
  color: var(--ph-text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-home-attn-time {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ph-text-3);
}
.ph-home-attn-chev {
  flex: 0 0 auto;
  color: var(--ph-text-3);
}
.ph-home-clear {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #34d399;
  padding: 4px 2px;
}
[data-theme="light"] .ph-home-clear {
  color: #059669;
}
.ph-home-pulse {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ph-home-pill {
  border-radius: 16px;
  background: var(--ph-surface);
  padding: 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ph-home-pill-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--ph-text);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.ph-home-pill-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ph-text-3);
}
.ph-home-delta {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
}
.ph-home-delta.is-up { color: #34d399; }
.ph-home-delta.is-down { color: #f87171; }
[data-theme="light"] .ph-home-delta.is-up { color: #059669; }
[data-theme="light"] .ph-home-delta.is-down { color: #dc2626; }

/* The earnings pill is a button (it opens the breakdown), so it must reset the
   button chrome and still sit flush in the pill row. */
.ph-home-pill-tap {
  border: 0;
  text-align: left;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, background 120ms ease;
}
.ph-home-pill-tap:active {
  transform: scale(0.97);
  background: var(--ph-surface-2);
}

/* Money breakdown sheet — "where is this figure from" */
.ph-money-hero {
  font-size: 30px;
  font-weight: 800;
  color: var(--ph-text);
  margin: 2px 0 4px;
  letter-spacing: -0.02em;
}
.ph-money-sub {
  font-size: 12.5px;
  color: var(--ph-text-2);
  margin: 0 0 4px;
}
.ph-money-lines {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ph-surface);
}
.ph-money-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--ph-border);
}
.ph-money-line:last-child { border-bottom: 0; }
.ph-money-line-label {
  font-size: 13.5px;
  color: var(--ph-text-2);
  min-width: 0;
}
.ph-money-line-amt {
  font-size: 14px;
  font-weight: 700;
  color: var(--ph-text);
  white-space: nowrap;
}
/* The line the tile's figure is taken from, so the eye can find it. */
.ph-money-line.is-headline {
  background: color-mix(in srgb, var(--ph-accent) 14%, transparent);
}
.ph-money-line.is-headline .ph-money-line-label,
.ph-money-line.is-headline .ph-money-line-amt {
  color: var(--ph-text);
  font-weight: 800;
}
.ph-money-line.is-payout .ph-money-line-amt { font-weight: 800; }
.ph-money-note {
  font-size: 12px;
  color: var(--ph-text-2);
  margin: 10px 0 0;
  line-height: 1.45;
}
.ph-money-warn {
  font-size: 12px;
  color: #f59e0b;
  margin: 8px 0 0;
  line-height: 1.45;
}
[data-theme="light"] .ph-money-warn { color: #b45309; }
.ph-home-props {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ph-home-props::-webkit-scrollbar {
  display: none;
}
.ph-home-prop {
  flex: 0 0 auto;
  max-width: 200px;
  border-radius: 16px;
  border: 1px solid var(--ph-hairline);
  background: var(--ph-surface);
  color: inherit;
  font-family: inherit;
  text-align: left;
  padding: 10px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.ph-home-prop:active {
  background: rgba(255, 255, 255, 0.08);
  transition-duration: 0.04s;
}
[data-theme="light"] .ph-home-prop:active {
  background: rgba(0, 0, 0, 0.05);
}
.ph-home-prop-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ph-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-home-prop-city {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ph-text-3);
}

/* ── Phone: "In progress" stand-in for routes with no phone screen yet ── */
.ph-inprogress {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 32px calc(96px + env(safe-area-inset-bottom));
  text-align: center;
}
.ph-inprogress-glyph {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(129, 140, 248, 0.16);
  color: #a5b4fc;
  margin-bottom: 6px;
}
.ph-inprogress-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ph-text, #f4f4f5);
}
.ph-inprogress-body {
  font-size: 14px;
  line-height: 1.45;
  max-width: 300px;
  color: var(--ph-text-dim, rgba(244, 244, 245, 0.6));
}
.ph-inprogress-home {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 18px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.ph-inprogress-home:active {
  transform: scale(0.97);
  opacity: 0.92;
}
[data-theme="light"] .ph-inprogress-glyph {
  background: rgba(79, 70, 229, 0.1);
  color: #4f46e5;
}
[data-theme="light"] .ph-inprogress-title {
  color: #18181b;
}
[data-theme="light"] .ph-inprogress-body {
  color: rgba(24, 24, 27, 0.58);
}

/* ── Phone calendar: continuous pan grid (round 4 D29 + D27) ── */
.ph-cal-pan {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ph-cal-canvas {
  position: relative;
  min-height: 100%;
  --ph-cal-grid-line: color-mix(in srgb, var(--ph-text-2) 24%, var(--ph-hairline));
  --ph-cal-grid-line-strong: color-mix(in srgb, var(--ph-text-2) 36%, var(--ph-hairline));
  /* Clears the floating Ask bar, which sits 86px off the bottom and is 46px
     tall, plus a gap. At 120px it fell 12px short: with the pan scrolled as far
     as it goes, the LAST row still sat under the bar. Harmless while rows were
     only readable, load-bearing now that tapping a row creates a job there —
     the day view's "No property" row was a target you could never hit. */
  padding-bottom: calc(146px + env(safe-area-inset-bottom));
}
.ph-cal-dayhead2 {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  background: var(--ph-bg);
  border-bottom: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
}
.ph-cal-corner {
  position: sticky;
  left: 0;
  z-index: 6;
  width: var(--ph-prop-col, 128px);
  flex: none;
  background: var(--ph-bg);
  border-right: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
}
.ph-cal-dh2 {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 14px 0 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ph-text-2);
  overflow: hidden;
  border-right: 1px solid var(--ph-cal-grid-line, var(--ph-hairline));
}
.ph-cal-dh2.is-today {
  color: var(--ph-accent-soft);
  font-weight: 700;
}
.ph-cal-dh2-month {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ph-accent-soft);
  white-space: nowrap;
}
.ph-cal-dh2-num {
  position: relative;
  z-index: 1;
  color: var(--ph-text-mid);
}
.ph-cal-dh2-num.is-today {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--ph-accent);
  color: #fff;
  align-items: center;
  justify-content: center;
}
.ph-cal-body2 {
  position: relative;
  z-index: 0;
  isolation: isolate;
}
.ph-cal-todayband2 {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--ph-accent-wash);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
/* The overview has one unmistakable elapsed region ending at the start of
   today. It mutes old objects without blacking them out. Stay/event edges and
   Task pins can still sit at real within-day positions underneath it. */
.ph-cal-pastband2 {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 5;
  background: color-mix(in srgb, #111318 32%, transparent);
  -webkit-backdrop-filter: grayscale(0.82) saturate(0.32) brightness(0.86);
  backdrop-filter: grayscale(0.82) saturate(0.32) brightness(0.86);
  pointer-events: none;
}
[data-theme="light"] .ph-cal-pastband2 {
  background: color-mix(in srgb, #eef0f3 42%, transparent);
  -webkit-backdrop-filter: grayscale(0.82) saturate(0.3) brightness(0.99);
  backdrop-filter: grayscale(0.82) saturate(0.3) brightness(0.99);
}
.ph-cal-nowline2 {
  position: absolute;
  inset-block: 0;
  z-index: 6;
  width: 2px;
  background: #f59e0b;
  box-shadow: 0 0 0 1px color-mix(in srgb, #f59e0b 18%, transparent);
  pointer-events: none;
}
.ph-cal-dh2.is-past {
  opacity: 0.58;
  filter: grayscale(1) saturate(0.1);
}
/* Grid-view day-header cells are BUTTONS: tap one to keep only property rows
   matching the contextual chip selection on that date. The hour view's
   header cells stay plain spans, so the chrome reset rides the element, not
   the class. */
button.ph-cal-dh2 {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  margin: 0;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Active filter date — amber, matching the desktop calendar's treatment so
   the two surfaces read as one feature. Wins over the is-past dim (a past
   date you are filtering to must read fully lit); today's accent number
   circle keeps its own colours underneath the amber wash. */
.ph-cal-dh2.is-calendar-filtered {
  background: color-mix(in srgb, #d97706 26%, transparent);
  box-shadow: inset 0 -2px 0 #d97706;
  opacity: 1;
}
.ph-cal-dh2.is-calendar-filtered .ph-cal-dh2-dow,
.ph-cal-dh2.is-calendar-filtered .ph-cal-dh2-num:not(.is-today) {
  color: #f59e0b;
}
[data-theme="light"] .ph-cal-dh2.is-calendar-filtered {
  background: color-mix(in srgb, #d97706 16%, transparent);
}
[data-theme="light"] .ph-cal-dh2.is-calendar-filtered .ph-cal-dh2-dow,
[data-theme="light"] .ph-cal-dh2.is-calendar-filtered .ph-cal-dh2-num:not(.is-today) {
  color: #b45309;
}
.ph-cal-groups-retry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 36px;
  margin: 8px 0 2px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, #d97706 48%, var(--ph-hairline));
  border-radius: 10px;
  background: color-mix(in srgb, #d97706 11%, var(--ph-bg));
  color: var(--ph-text-2);
  font: inherit;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.ph-cal-groups-retry strong {
  color: #f59e0b;
  font-size: 11px;
}
[data-theme="light"] .ph-cal-groups-retry strong {
  color: #b45309;
}
/* Press feedback for the long-press-to-open-actions affordance — a background
   highlight, never a scale bounce (scale on rows reads cheap). */
.ph-cal-prop2.is-pressing {
  background: var(--ph-accent-wash);
}
.ph-cal-group2 {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  width: 100%;
  height: 30px;
  border-top: 1px solid color-mix(in srgb, var(--ph-accent-soft) 30%, var(--ph-hairline));
  border-bottom: 1px solid var(--ph-hairline);
  background: color-mix(in srgb, var(--ph-accent) 8%, var(--ph-bg));
}
.ph-cal-group2-label {
  position: sticky;
  left: 8px;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 24px);
  min-width: 0;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--ph-accent-soft) 32%, var(--ph-hairline));
  border-radius: 999px;
  background: color-mix(in srgb, var(--ph-accent) 13%, var(--ph-bg));
  color: var(--ph-accent-soft);
  box-shadow: 0 2px 8px color-mix(in srgb, #000 12%, transparent);
}
.ph-cal-group2-label strong {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.ph-cal-group2-label small {
  flex: none;
  color: var(--ph-text-2);
  font-size: 9px;
  font-weight: 800;
}
.ph-cal-row2 {
  display: flex;
  height: 56px;
  border-top: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
}
.ph-cal-row2.is-alternate,
.ph-cal-row2.is-alternate .ph-cal-prop2 {
  background-color: color-mix(in srgb, var(--ph-text) 3.5%, var(--ph-bg));
}
.ph-cal-row2.is-final-resource {
  border-bottom: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
}
.ph-cal-prop2 {
  position: sticky;
  left: 0;
  /* The elapsed-date wash is z-5 and moves with the scrolled date canvas.
     Property identity is not dated content, so keep its opaque sticky rail
     above that wash instead of desaturating thumbnails and names. */
  z-index: 7;
  width: var(--ph-prop-col, 128px);
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 6px 0 10px;
  background: var(--ph-bg);
  border-right: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
  color: var(--ph-text);
}
.ph-cal-thumb {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: var(--ph-accent-wash);
}
.ph-cal-thumb.is-mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--ph-accent-soft);
}
.ph-cal-prop2-name {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.18;
  overflow: hidden;
  display: block;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-track {
  position: relative;
  height: 100%;
  flex: none;
  background-image:
    repeating-linear-gradient(90deg, transparent 0 230px, rgba(255, 255, 255, 0.025) 230px 322px),
    repeating-linear-gradient(90deg, transparent 0 45px, var(--ph-cal-grid-line, var(--ph-hairline)) 45px 46px);
}
/* Exact object positions do not require a prison-bar ruler. Date boundaries
   remain explicit; quarter-hour and hour guides stay out of the broad view.
   Agenda and item details carry the written clock values. */
.ph-cal-track:not(.is-hours)::before,
.ph-cal-track:not(.is-hours)::after {
  content: none;
}
[data-theme="light"] .ph-cal-track {
  background-image:
    repeating-linear-gradient(90deg, transparent 0 230px, rgba(17, 17, 20, 0.03) 230px 322px),
    repeating-linear-gradient(90deg, transparent 0 45px, var(--ph-cal-grid-line, var(--ph-hairline)) 45px 46px);
}
.ph-cal-rate {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  pointer-events: none;
}
.ph-cal-rate-p {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ph-text-2);
  font-variant-numeric: tabular-nums;
}
.ph-cal-rate-m {
  font-size: 9px;
  font-weight: 600;
  color: var(--ph-text-mid);
}

/* ── Phone booking sheet: waterfall money (round 4 D28) ── */
.ph-cal-sheet-mtpl {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ph-text-mid);
  margin-bottom: 2px;
}
.ph-cal-sheet-mnote {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ph-text-mid);
}
.ph-cal-sheet-mrow.is-net {
  border-top: 1px solid var(--ph-hairline);
  padding-top: 8px;
  margin-top: 4px;
  font-weight: 700;
}

/* ── Phone Home: Ask Stavros bar (round 4 D31) ── */
.ph-home-ask {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: var(--ph-tabbar-stack-bottom);
  z-index: 6;
  height: 46px;
  border-radius: 23px;
  background: var(--ph-tabbar-bg);
  backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  border: 0.5px solid var(--ph-tabbar-border);
  box-shadow: var(--ph-tabbar-shadow);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 6px 0 14px;
}
.ph-home-ask-spark {
  flex: none;
  color: var(--ph-accent-soft);
}
.ph-home-ask-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ph-text, #f4f4f5);
  outline: none;
}
/* The Ask bar's field is a textarea since 2026-07-26 (return key = new line on
   phones; the arrow button sends). JS auto-grows it to scrollHeight; this caps
   the growth at ~4 lines, after which it scrolls internally. */
textarea.ph-home-ask-input {
  resize: none;
  line-height: 1.35;
  max-height: 84px;
  overflow-y: auto;
}
.ph-home-ask-input::placeholder {
  color: var(--ph-text-mid);
}
.ph-home-ask-send {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.ph-home-ask-send:disabled {
  opacity: 0.35;
}
.ph-home-ask-send:active {
  transform: scale(0.94);
}
[data-theme="light"] .ph-home-ask-input {
  color: #18181b;
}

/* ── Stavros canvas (fold §6): presence, brief, callouts, asks, reveal ── */
.ph-sv-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ph-text-mid);
  margin-top: 2px;
}
/* Round 6 D42: the pulsing eyebrow orb dot is GONE (Hakim: cheap, unnecessary
   on top of his face). The keyframes below stay — .ph-sv-reading-dot uses them. */
@keyframes ph-sv-orb-breathe {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.82);
    opacity: 0.75;
  }
}
.ph-sv-brief {
  margin: 2px 0 4px;
  font-size: 21px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ph-text, #f4f4f5);
  text-wrap: balance;
}
.ph-sv-reading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ph-text-mid);
  margin: -2px 0 2px;
}
.ph-sv-reading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6366f1;
  animation: ph-sv-orb-breathe 1.1s ease-in-out infinite;
}
.ph-sv-note {
  margin: 8px 2px 0;
  padding-left: 10px;
  border-left: 2px solid var(--ph-accent-soft, #6366f1);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ph-text-mid);
}
.ph-sv-callout {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 0.5px solid var(--ph-hairline);
  border-radius: 18px;
  padding: 13px 14px;
  background: rgba(99, 102, 241, 0.09);
  color: inherit;
  font: inherit;
}
.ph-sv-callout.is-warn {
  background: rgba(217, 119, 6, 0.12);
}
.ph-sv-callout.is-good {
  background: rgba(22, 163, 74, 0.12);
}
button.ph-sv-callout:active {
  transform: scale(0.985);
}
.ph-sv-callout-glyph {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.16);
}
.ph-sv-callout-glyph.is-warn {
  color: #fbbf24;
  background: rgba(217, 119, 6, 0.18);
}
.ph-sv-callout-glyph.is-good {
  color: #4ade80;
  background: rgba(22, 163, 74, 0.18);
}
.ph-sv-callout-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-sv-callout-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ph-text, #f4f4f5);
}
.ph-sv-callout-body {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ph-text-mid);
}
.ph-sv-callout-chev {
  flex: none;
  color: var(--ph-text-mid);
}
.ph-sv-asks {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 2px -16px 0;
  padding: 2px 16px 4px;
}
.ph-sv-asks::-webkit-scrollbar {
  display: none;
}
.ph-sv-ask-chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 18px;
  border: 0.5px solid var(--ph-hairline);
  background: rgba(99, 102, 241, 0.1);
  color: var(--ph-text, #f4f4f5);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.ph-sv-ask-chip svg {
  color: var(--ph-accent-soft, #818cf8);
}
.ph-sv-ask-chip:active {
  transform: scale(0.96);
}
.ph-sv-reveal {
  animation: ph-sv-rise 0.42s cubic-bezier(0.22, 0.9, 0.3, 1) both;
}
@keyframes ph-sv-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ph-sv-reveal {
    animation: none;
  }
  .ph-sv-reading-dot {
    animation: none;
  }
}

/* The Home header face button — Stavros's head mark in the glass circle,
   tinted by the day's mood. Round 6: CALM palette only (D41 — attention is
   warm apricot, never rose/red: red reads as him being pissed off), and the
   glyph keeps its blink but does NOT breathe/throb (D42). */
.ph-sv-face-btn {
  color: #a5b4fc;
}
.ph-sv-face-btn.is-busy {
  color: #f59e0b;
}
.ph-sv-face-btn.is-attention {
  color: #fb923c;
}
[data-theme="light"] .ph-sv-face-btn {
  color: #4f46e5;
}
[data-theme="light"] .ph-sv-face-btn.is-busy {
  color: #d97706;
}
[data-theme="light"] .ph-sv-face-btn.is-attention {
  color: #c2410c;
}

/* ── Stavros — the assistant's face (ported from his original app, re-themed
   indigo; components/ai/StavrosAvatar.tsx). Works on BOTH tiers: mood tints
   follow the Home canvas (calm indigo / busy amber / attention APRICOT —
   round 6 D41: no red/rose may ever reach his face; red reads angry). ── */
.stavros-avatar {
  position: relative;
  line-height: 0;
  --av-accent: #818cf8;
  --av-line: rgba(148, 156, 248, 0.5);
}
.stavros-avatar[data-mood="busy"] {
  --av-accent: #f59e0b;
  --av-line: rgba(245, 158, 11, 0.45);
}
.stavros-avatar[data-mood="attention"] {
  --av-accent: #fb923c;
  --av-line: rgba(251, 146, 60, 0.45);
}
[data-theme="light"] .stavros-avatar {
  --av-accent: #4f46e5;
  --av-line: rgba(79, 70, 229, 0.42);
}
[data-theme="light"] .stavros-avatar[data-mood="busy"] {
  --av-accent: #d97706;
  --av-line: rgba(217, 119, 6, 0.4);
}
[data-theme="light"] .stavros-avatar[data-mood="attention"] {
  --av-accent: #c2410c;
  --av-line: rgba(194, 65, 12, 0.4);
}
.stavros-avatar .av-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
  --head-rot: 0deg;
  --head-x: 0px;
  --head-y: 0px;
  --fig-dim: 1;
}
.stavros-avatar .struct {
  fill: none;
  stroke: var(--av-line);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stavros-avatar .hair {
  fill: none;
  stroke: var(--av-line);
  stroke-width: 1.1;
  stroke-linecap: round;
}
.stavros-avatar .node {
  fill: var(--av-line);
}
.stavros-avatar .bright {
  fill: none;
  stroke: var(--av-accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.4s;
}
.stavros-avatar .node-b {
  fill: var(--av-accent);
  transition: fill 0.4s;
}
.stavros-avatar .glow {
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--av-accent) 70%, transparent));
}
.stavros-avatar .av-figure {
  transform-box: fill-box;
  transform-origin: center;
  animation: svBreathe 5.5s ease-in-out infinite;
  opacity: var(--fig-dim);
  transition: opacity 0.6s;
}
.stavros-avatar .av-headPivot {
  transform: translate(var(--head-x), var(--head-y)) rotate(var(--head-rot));
  transform-origin: 180px 208px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.stavros-avatar .av-headShake {
  transform-origin: 180px 150px;
}
.stavros-avatar .eye {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.4s;
}
.stavros-avatar .ov {
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.stavros-avatar .mouth {
  opacity: 0;
  transition: opacity 0.3s;
}
.stavros-avatar .av-mouthNeutral {
  opacity: 1;
}
.stavros-avatar .av-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: svCorePulse 3.2s ease-in-out infinite;
}
.stavros-avatar .av-svg[data-state="listening"] { --head-rot: -7deg; --head-x: 4px; }
.stavros-avatar .av-svg[data-state="thinking"] { --head-rot: 5deg; --head-y: -3px; }
.stavros-avatar .av-svg[data-state="working"] { --head-y: -2px; }
.stavros-avatar .av-svg[data-state="alert"] { --head-y: -5px; }
.stavros-avatar .av-svg[data-state="success"] { --head-y: -2px; }
.stavros-avatar .av-svg[data-state="greeting"] { --head-rot: -6deg; }
.stavros-avatar .av-svg[data-state="sleeping"] { --head-rot: 11deg; --head-y: 7px; --fig-dim: 0.5; }
.stavros-avatar .av-svg[data-state="alert"] .eye {
  transform: scaleY(1.28);
}
.stavros-avatar .av-svg[data-state="success"] .eye,
.stavros-avatar .av-svg[data-state="greeting"] .eye {
  transform: scaleY(0.62) translateY(-1px);
}
.stavros-avatar .av-svg[data-state="sleeping"] .eye {
  transform: scaleY(0.07);
}
.stavros-avatar .av-svg[data-state="success"] .av-mouthSmile,
.stavros-avatar .av-svg[data-state="greeting"] .av-mouthSmile {
  opacity: 1;
}
.stavros-avatar .av-svg[data-state="success"] .av-mouthNeutral,
.stavros-avatar .av-svg[data-state="greeting"] .av-mouthNeutral {
  opacity: 0;
}
.stavros-avatar .av-svg[data-state="alert"] .av-mouthO {
  opacity: 1;
}
.stavros-avatar .av-svg[data-state="alert"] .av-mouthNeutral {
  opacity: 0;
}
.stavros-avatar .av-svg[data-state="speaking"] .av-mouthWave {
  opacity: 1;
}
.stavros-avatar .av-svg[data-state="speaking"] .av-mouthNeutral {
  opacity: 0;
}
.stavros-avatar .av-svg[data-state="sleeping"] .av-mouthNeutral {
  opacity: 0.4;
}
.stavros-avatar .av-svg[data-state="thinking"] .ov-dots { opacity: 1; }
.stavros-avatar .av-svg[data-state="listening"] .ov-listen { opacity: 1; }
.stavros-avatar .av-svg[data-state="working"] .ov-progress { opacity: 1; }
.stavros-avatar .av-svg[data-state="alert"] .ov-bang { opacity: 1; animation: svPop 0.42s ease-out both; }
.stavros-avatar .av-svg[data-state="success"] .ov-spark { opacity: 1; }
.stavros-avatar .av-svg[data-state="greeting"] .ov-hand { opacity: 1; }
.stavros-avatar .av-svg[data-state="sleeping"] .ov-zzz { opacity: 1; }
.stavros-avatar .av-svg[data-state="speaking"] .av-core,
.stavros-avatar .av-svg[data-state="working"] .av-core {
  animation-duration: 1s;
}
.stavros-avatar .av-svg[data-state="alert"] .av-core {
  animation-duration: 0.7s;
}
.stavros-avatar .av-svg[data-state="sleeping"] .av-core {
  animation-duration: 6s;
}
.stavros-avatar .ov-dots circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: svDot 1.4s ease-in-out infinite;
}
.stavros-avatar .ov-dots circle:nth-child(2) { animation-delay: 0.18s; }
.stavros-avatar .ov-dots circle:nth-child(3) { animation-delay: 0.36s; }
.stavros-avatar .ov-listen circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: svRipple 1.8s ease-out infinite;
}
.stavros-avatar .ov-listen circle:nth-child(2) { animation-delay: 0.6s; }
.stavros-avatar .ov-listen circle:nth-child(3) { animation-delay: 1.2s; }
.stavros-avatar .ov-progress circle {
  stroke-dasharray: 471;
  stroke-dashoffset: 471;
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(-90deg);
  animation: svProg 2.3s linear infinite;
}
.stavros-avatar .ov-bang {
  transform-box: fill-box;
  transform-origin: center bottom;
}
.stavros-avatar .av-svg[data-state="success"] .av-figure {
  animation: svBreathe 5.5s ease-in-out infinite, svBob 0.85s cubic-bezier(0.34, 1.4, 0.5, 1) 2;
}
.stavros-avatar .ov-spark * {
  transform-box: fill-box;
  transform-origin: center;
  animation: svTwinkle 1.3s ease-in-out infinite;
}
.stavros-avatar .ov-spark *:nth-child(2) { animation-delay: 0.32s; }
.stavros-avatar .ov-spark *:nth-child(3) { animation-delay: 0.64s; }
.stavros-avatar .ov-spark *:nth-child(4) { animation-delay: 0.96s; }
.stavros-avatar .ov-hand {
  transform-box: fill-box;
  transform-origin: 270px 250px;
}
/* Round 6 D43: the greeting wave is a ONE-SHOT (3 cycles ≈ 1.8s). The
   component listens for this animation's end (name svWave) and settles the
   whole face to idle — never put `infinite` back here. */
.stavros-avatar .av-svg[data-state="greeting"] .ov-hand {
  animation: svWave 0.6s ease-in-out 3;
}
.stavros-avatar .ov-zzz text {
  animation: svZzz 2.6s ease-out infinite;
}
.stavros-avatar .ov-zzz text:nth-child(2) { animation-delay: 0.85s; }
.stavros-avatar .ov-zzz text:nth-child(3) { animation-delay: 1.7s; }
@keyframes svBreathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.012); }
}
@keyframes svCorePulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.18); opacity: 1; }
}
@keyframes svDot {
  0%, 80%, 100% { opacity: 0.18; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
@keyframes svRipple {
  0% { transform: scale(0.4); opacity: 0; }
  30% { opacity: 0.8; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes svProg {
  from { stroke-dashoffset: 471; }
  to { stroke-dashoffset: 0; }
}
@keyframes svPop {
  0% { transform: translateY(3px) scale(0.55); }
  62% { transform: translateY(-2px) scale(1.14); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes svBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes svTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes svWave {
  0%, 100% { transform: rotate(-9deg); }
  50% { transform: rotate(16deg); }
}
@keyframes svZzz {
  0% { opacity: 0; transform: translate(0, 0) scale(0.7); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(14px, -26px) scale(1.1); }
}
/* The head-only mark for small chrome — inherits currentColor from its slot;
   the eyes blink on a slow CSS loop so even the tiny Stavros feels awake. */
.stavros-glyph {
  flex: none;
}
.stavros-glyph .stavros-glyph-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: svGlyphBlink 6.4s ease-in-out infinite;
}
@keyframes svGlyphBlink {
  0%, 94.4%, 100% { transform: scaleY(1); }
  96.2%, 97.4% { transform: scaleY(0.12); }
}
@media (prefers-reduced-motion: reduce) {
  .stavros-avatar .av-figure,
  .stavros-avatar .av-core,
  .stavros-avatar .ov *,
  .stavros-avatar .ov,
  .stavros-glyph .stavros-glyph-eyes {
    animation: none !important;
  }
}
[data-theme="light"] .ph-sv-brief,
[data-theme="light"] .ph-sv-callout-title,
[data-theme="light"] .ph-sv-ask-chip {
  color: #18181b;
}
[data-theme="light"] .ph-sv-callout {
  background: rgba(79, 70, 229, 0.07);
  border-color: rgba(24, 24, 27, 0.1);
}
[data-theme="light"] .ph-sv-callout.is-warn {
  background: rgba(217, 119, 6, 0.1);
}
[data-theme="light"] .ph-sv-callout.is-good {
  background: rgba(22, 163, 74, 0.1);
}
[data-theme="light"] .ph-sv-callout-glyph {
  color: #4f46e5;
}
[data-theme="light"] .ph-sv-callout-glyph.is-warn {
  color: #b45309;
}
[data-theme="light"] .ph-sv-callout-glyph.is-good {
  color: #15803d;
}
[data-theme="light"] .ph-sv-ask-chip {
  background: rgba(79, 70, 229, 0.08);
  border-color: rgba(24, 24, 27, 0.1);
}
[data-theme="light"] .ph-sv-ask-chip svg {
  color: #4f46e5;
}

/* ── Shared Stavros presence — one quiet entry on every phone screen.
   Shell-mounted OUTSIDE every .phone-app box, so it is position:fixed and its
   class sits in both ph-variable scope lists near the top of the phone section.
   The previous full-width composer covered list rows and competed with whichever
   screen the operator was already using. The canonical composer now lives only
   in the full-screen Stavros surface; this small presence opens it.
   Z: every .phone-app screen is itself a fixed z-60 layer, so the presence must
   sit above 60 and below the Stavros sheet (70).
   Hidden by the shell whenever a thread's composer owns the bottom, and while
   any OTHER field owns the keyboard (lib/phone/keyboard-focus.ts). ── */
.ph-stavros-bar {
  position: fixed;
  left: auto;
  right: 16px;
  bottom: var(--ph-tabbar-stack-bottom);
  z-index: 62;
  height: var(--ph-stavros-bar-height);
  min-width: 46px;
  border-radius: 23px;
  background: var(--ph-tabbar-bg);
  backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  border: 0.5px solid var(--ph-tabbar-border);
  box-shadow: var(--ph-tabbar-shadow);
  color: var(--ph-text);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 5px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
/* Availability is a delivery control, not a profile detail. Keep the effective
   quiet state visible across every phone screen, including builds where UIKit
   owns the tab bar. */
.ph-alert-delivery-pill {
  position: fixed;
  left: 16px;
  bottom: var(--ph-tabbar-stack-bottom);
  z-index: 63;
  min-height: 42px;
  max-width: calc(100vw - 138px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 0.5px solid color-mix(in srgb, #f59e0b 52%, var(--ph-tabbar-border));
  border-radius: 21px;
  background: color-mix(in srgb, #f59e0b 16%, var(--ph-tabbar-bg));
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  box-shadow: var(--ph-tabbar-shadow);
  color: #f6a817;
  font: inherit;
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ph-alert-delivery-pill > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-alert-delivery-pill.is-paused {
  border-color: color-mix(in srgb, #ef4444 58%, var(--ph-tabbar-border));
  background: color-mix(in srgb, #ef4444 17%, var(--ph-tabbar-bg));
  color: #f87171;
}
.ph-alert-delivery-pill.is-unknown {
  border-color: color-mix(in srgb, var(--ph-text-2) 45%, var(--ph-tabbar-border));
  background: var(--ph-tabbar-bg);
  color: var(--ph-text-2);
}
.ph-alert-delivery-pill:active {
  transform: scale(0.96);
  opacity: 0.88;
}
/* One owner for the strip above the phone tab bar. These transient surfaces
   render only while active, so their existing root class is the ownership
   signal. Task and Calendar screens stay mounted while hidden; their notice
   only counts inside the visible host. */
body:has(
  .ph-action-toast,
  .ph-share-toast,
  .ph-update-card,
  .voice-presence-rail,
  .ph-call-layer,
  .uos-call-backdrop,
  .uos-call-toast,
  .global-call-float-error
) .ph-stavros-bar,
body:has(.ph-screen-host:not([hidden]) .ph-task-completion-undo) .ph-stavros-bar,
html.ph-kb-open .ph-alert-delivery-pill,
body:has(
  .ph-action-toast,
  .ph-share-toast,
  .voice-presence-rail,
  .ph-call-layer,
  .uos-call-backdrop,
  .uos-call-toast,
  .global-call-float-error
) .ph-alert-delivery-pill,
body:has(.ph-screen-host:not([hidden]) .ph-task-completion-undo) .ph-alert-delivery-pill {
  display: none;
}
/* A delivery limit outranks a release-note card. Keep the card's state mounted
   so it can appear later, but never cover the only persistent quiet warning. */
body:has(.ph-alert-delivery-pill) .ph-update-card {
  display: none;
}
.ph-stavros-bar-main,
.ph-agent-patrol-toggle,
.ph-agent-patrol-panel button {
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ph-stavros-bar-main {
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px 0 0;
}
.ph-stavros-bar-main:active,
.ph-agent-patrol-toggle:active {
  transform: scale(0.94);
  opacity: 0.86;
}
/* This is normally removed while another field owns the keyboard. Keep the
   geometry safe during the short native resize handoff so it never flashes in
   the middle of the screen. */
html.ph-kb-open .ph-stavros-bar {
  bottom: calc(var(--ph-tabbar-lift) + var(--ph-kb-lift, 0px));
}
.ph-stavros-bar-face {
  flex: none;
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  color: var(--ph-accent-soft, #a5b4fc);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ph-stavros-bar-label {
  font-size: 12.5px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.01em;
}
/* Unread replies from Stavros, same badge grammar as the tab bar's. Nudged in
   from the face's edge so it sits over the glyph's corner, not the bar's. */
.ph-stavros-bar-face .ph-tab-badge {
  top: -1px;
  right: -1px;
}
.ph-agent-patrol-toggle {
  position: relative;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
  border-left: 0.5px solid var(--ph-tabbar-border);
  color: var(--ph-text-muted);
  font-size: 11px;
  font-weight: 800;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.16s ease;
}
.ph-agent-patrol-toggle > span {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--state-success);
}
.ph-agent-patrol-toggle.is-working {
  color: var(--state-warning);
}
.ph-agent-patrol-toggle.is-working > span {
  background: var(--state-warning);
  animation: agentPatrolPulse 1.35s ease-in-out infinite;
}
.ph-agent-patrol-toggle.is-attention { color: var(--state-error); }
.ph-agent-patrol-toggle.is-attention > span { background: var(--state-error); }
.ph-agent-patrol-toggle.is-paused > span { background: var(--ph-text-muted); }
.ph-agent-patrol-panel {
  position: absolute;
  right: 0;
  bottom: 54px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(52dvh, 440px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0.5px solid var(--ph-tabbar-border);
  border-radius: 18px;
  background: var(--ph-sheet-bg, var(--bg-elevated));
  box-shadow: var(--ph-sheet-shadow, 0 18px 50px rgba(0, 0, 0, 0.38));
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
}
.ph-agent-patrol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px 10px;
  border-bottom: 0.5px solid var(--ph-tabbar-border);
}
.ph-agent-patrol-head > span { min-width: 0; display: grid; gap: 2px; }
.ph-agent-patrol-head strong { font-size: 13px; }
.ph-agent-patrol-head small { color: var(--ph-text-muted); font-size: 10.5px; }
.ph-agent-patrol-head button { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 16px; }
.ph-agent-patrol-agents {
  display: grid;
  gap: 5px;
  max-height: 190px;
  overflow-y: auto;
  padding: 9px;
  border-bottom: 0.5px solid var(--ph-tabbar-border);
}
.ph-agent-patrol-agents > strong,
.ph-agent-patrol-section-title {
  padding: 0 4px 3px;
  color: var(--ph-text-muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.ph-agent-patrol-agents > p { margin: 0; padding: 8px 4px; color: var(--ph-text-muted); font-size: 11px; }
.ph-agent-patrol-agent {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: start;
  gap: 7px;
  padding: 8px;
  border-radius: 11px;
  background: var(--ph-surface-2);
}
.ph-agent-patrol-agent > span:first-child { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--state-success); }
.ph-agent-patrol-agent.is-review > span:first-child { background: var(--state-warning); }
.ph-agent-patrol-agent.is-attention > span:first-child { background: var(--state-error); }
.ph-agent-patrol-agent.is-paused > span:first-child { background: var(--ph-text-muted); }
.ph-agent-patrol-agent > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.ph-agent-patrol-agent > span:nth-child(2) strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.ph-agent-patrol-agent > span:nth-child(2) small { color: var(--ph-text-muted); font-size: 9.5px; line-height: 1.35; }
.ph-agent-patrol-agent > small:last-child { color: var(--ph-text-muted); font-size: 9px; font-weight: 750; white-space: nowrap; }
.ph-agent-patrol-list { min-height: 0; overflow-y: auto; padding: 6px; }
.ph-agent-patrol-list > .ph-agent-patrol-section-title { display: block; padding-top: 4px; }
.ph-agent-patrol-list > button {
  width: 100%;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 12px;
  text-align: left;
}
.ph-agent-patrol-list > button:active:not(:disabled) { background: var(--ph-surface-2); }
.ph-agent-patrol-list > button:disabled { cursor: default; }
.ph-agent-patrol-list > button > span:last-child { min-width: 0; display: grid; gap: 3px; }
.ph-agent-patrol-list strong { overflow: hidden; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; }
.ph-agent-patrol-list small { color: var(--ph-text-muted); font-size: 10px; }
.ph-agent-patrol-list > p { margin: 0; padding: 18px 10px; color: var(--ph-text-muted); font-size: 12px; }
.ph-agent-patrol-dot { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--ph-text-muted); }
.ph-agent-patrol-dot.is-started { background: var(--state-warning); }
.ph-agent-patrol-dot.is-waiting { background: var(--ph-accent, #6366f1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ph-accent, #6366f1) 16%, transparent); }
.ph-agent-patrol-dot.is-completed { background: var(--state-success); }
.ph-agent-patrol-dot.is-failed { background: var(--state-error); }
.ph-agent-patrol-dot.is-interrupted { background: var(--ph-text-muted); }
.ph-agent-patrol-refresh {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 8px 8px;
  border-radius: 12px;
  color: var(--ph-accent-soft, #a5b4fc) !important;
  background: var(--ph-surface-2) !important;
  font-size: 11px !important;
  font-weight: 750 !important;
}
@media (max-width: 360px) {
  .ph-stavros-bar {
    padding-right: 3px;
  }
  .ph-stavros-bar-label {
    display: none;
  }
}
@media (max-width: 640px) {
  /* Round 6 D44 defence-in-depth: cap the "/" and "@" popup inside the visual
     viewport on a keyboard-open phone (a static 300px max-height could paint
     above y=0 on short views — the D17 class of bug). */
  .aiops-cmd-pop {
    max-height: min(300px, calc(100dvh - 230px));
  }
}

/* Round 6 D49: the dialer number is a real input so iOS offers Paste on
   long-press; visually the same as the old span, and inputMode="none" keeps
   the custom keypad as the only keyboard. */
.ph-dialer-number-field {
  background: transparent;
  border: 0;
  outline: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-align: center;
  width: 100%;
  caret-color: var(--ph-accent, #6366f1);
}

/* ── Phone semantic camera ─────────────────────────────────────────────────
   The sticky header and free-rate cells are horizontally windowed. Pinch
   applies real widths at rAF cadence, so the old whole-track scaleX preview
   and stretched labels no longer exist. */
.ph-cal-dh2-cells {
  display: flex;
}
.ph-cal-stickyhead .ph-cal-dh2-cells {
  position: relative;
  display: block;
  flex: 0 0 auto;
  height: 52px;
}
.ph-cal-stickyhead .ph-cal-dh2 {
  position: absolute;
  top: 0;
  bottom: 0;
  flex: none;
}
.ph-cal-stickyhead .ph-cal-dh2-dow {
  /* A weekday is part of the date's identity, not optional operational prose.
     At the normal Month camera the old secondary-detail fade made these labels
     almost transparent even though the day numbers were fully visible. */
  color: var(--ph-text-mid);
  font-weight: 700;
  opacity: var(--calendar-date-detail, 1);
}
.ph-cal-stickyhead .ph-cal-dh2.is-today .ph-cal-dh2-dow {
  color: var(--ph-accent-soft);
}
.ph-cal-dh2-num {
  opacity: var(--calendar-date-detail, 1);
}
.ph-cal-bar-text,
.ph-cal-task-text {
  opacity: var(--calendar-primary-detail, 1);
}
.ph-cal-task-type {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  margin-right: 3px;
  border-radius: 4px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.ph-cal-rate-p {
  opacity: var(--calendar-primary-detail, 1);
}
.ph-cal-rate-m {
  /* Minimum stay is equal truth to price, not optional secondary prose. */
  opacity: var(--calendar-primary-detail, 1);
}
.ph-cal-turnover-label {
  opacity: var(--calendar-secondary-detail, 1);
}
.ph-cal-rate::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ph-accent-soft) 62%, var(--ph-text-mid));
  content: "";
  opacity: var(--calendar-overview-detail, 0);
  transform: translate(-50%, -50%);
}
.ph-cal-day-camera > .ph-cal-canvas {
  transition:
    opacity 150ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ph-cal-day-camera.is-camera-exiting > .ph-cal-canvas {
  opacity: var(--calendar-day-exit-opacity, 1);
  transform: translateY(var(--calendar-day-exit-y, 0));
}
/* Weekend wash + day separators follow the variable width (was hardcoded
   230/322/45/46px = 5x46/7x46 periods, week-aligned to rangeStart's Monday). */
.ph-cal-track {
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(var(--ph-dayw, 46px) * 5),
      rgba(255, 255, 255, 0.025) calc(var(--ph-dayw, 46px) * 5) calc(var(--ph-dayw, 46px) * 7)
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(var(--ph-dayw, 46px) - 1px),
      var(--ph-cal-grid-line, var(--ph-hairline)) calc(var(--ph-dayw, 46px) - 1px) var(--ph-dayw, 46px)
    );
}
[data-theme="light"] .ph-cal-track {
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(var(--ph-dayw, 46px) * 5),
      rgba(17, 17, 20, 0.03) calc(var(--ph-dayw, 46px) * 5) calc(var(--ph-dayw, 46px) * 7)
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0 calc(var(--ph-dayw, 46px) - 1px),
      var(--ph-cal-grid-line, var(--ph-hairline)) calc(var(--ph-dayw, 46px) - 1px) var(--ph-dayw, 46px)
    );
}
/* The 24h day timeline: fixed hour columns, separators only (no weekend wash),
   in BOTH themes — declared after the theme overrides above so it wins. */
.ph-cal-dh2.is-hour {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
}
.ph-cal-hour-notches {
  position: absolute;
  inset: auto 0 0;
  height: 7px;
  pointer-events: none;
}
.ph-cal-hour-notches i {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 3px;
  background: color-mix(in srgb, var(--ph-text-2) 34%, transparent);
}
.ph-cal-hour-notches i:nth-child(1) { left: 25%; }
.ph-cal-hour-notches i:nth-child(2) {
  left: 50%;
  height: 6px;
}
.ph-cal-hour-notches i:nth-child(3) { left: 75%; }
.ph-cal-track.is-hours,
[data-theme="light"] .ph-cal-track.is-hours {
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0 11px,
      color-mix(in srgb, var(--ph-hairline) 48%, transparent) 11px 12px,
      transparent 12px 22px,
      color-mix(in srgb, var(--ph-hairline) 72%, transparent) 22px 23px,
      transparent 23px 34px,
      color-mix(in srgb, var(--ph-hairline) 48%, transparent) 34px 35px,
      transparent 35px 45px,
      var(--ph-cal-grid-line, var(--ph-hairline)) 45px 46px
    );
}

/* ---- Round 7 D59 (widened 2026-07-24): a long-press anywhere in the phone
   shell must read as a gesture, never a text selection. iOS snaps a long-press
   on a `user-select:none` element to the NEAREST still-selectable text, so the
   old scroll-region-only suppression left the thread header, the action sheets
   (message actions, who-reacted) and every other phone screen selectable — a
   hold near them grabbed "random" spans (reported 2026-07-24, opening the
   who-reacted sheet). So suppress selection + the iOS callout across the WHOLE
   .phone-app shell; there is then no selectable neighbour for a hold to snap to.
   Real text fields opt back in below so typing/editing still works, and Copy
   lives in the long-press menus — nothing is lost. */
.phone-app,
.phone-app * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.phone-app input,
.phone-app textarea,
.phone-app [contenteditable],
.phone-app [contenteditable] * {
  -webkit-user-select: text;
  user-select: text;
}

/* ---- Highlight text in a message (2026-08-05). The D59 rule above is right by
   default, but it also means a User can only ever copy a WHOLE message — the
   thing one of them complained about. So PhoneConversation has an explicit
   highlight-text mode (long-press a message → "Highlight text"), and while it
   is on, the message list ALONE opts back into real selection: iOS handles,
   iOS copy menu, exactly like any other text on the phone.

   Two selectors, both needed: the container (its own text nodes) and every
   descendant (`.phone-app *` above would otherwise re-suppress each child).
   Specificity beats the D59 rule without !important. Gestures are suspended in
   JS while the mode is on, so nothing fights the finger. */
.phone-app .ph-convo-scroll.is-selecting-text,
.phone-app .ph-convo-scroll.is-selecting-text * {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* The mode's banner: sits in normal flow between the thread header and the
   message list, so no ancestor transform can clip it. */
.ph-selectbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--ph-hairline);
  background: var(--ph-accent-wash);
}
.ph-selectbar-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ph-text-2);
  font-size: 12.5px;
  font-weight: 600;
}
.ph-selectbar-done {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ph-accent);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.ph-selectbar-done:active {
  background: var(--ph-accent-strong);
}

/* ---- Round 7 D54: swipeable list rows (PhoneSwipeRow). touch-action pan-y
   keeps vertical scrolling native while horizontal travel reaches the JS
   recognizer — never preventDefault against the scroller. */
.ph-swipe {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.ph-swipe-row {
  position: relative;
  z-index: 1;
  background: var(--ph-bg, #111114);
}
.ph-swipe-under {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  opacity: 0;
  pointer-events: none;
}
.ph-swipe-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
}
.ph-swipe-label.is-left {
  margin-right: auto;
  background: #4f46e5;
}
.ph-swipe-label.is-right {
  margin-left: auto;
  background: rgb(194, 65, 12);
}
.ph-swipe-label.is-calm {
  background: rgba(120, 120, 135, 0.85);
}
[data-theme="light"] .ph-swipe-row {
  background: var(--ph-bg, #f5f5f4);
}

/* D54 desktop parity: hover dismiss on Home needs-attention message rows.
   Theme tokens only — light + dark both inherit. */
.home-attn-rowwrap {
  position: relative;
}
.home-attn-rowwrap .home-attn-row {
  width: 100%;
}
.home-attn-x {
  position: absolute;
  right: 42px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
  cursor: pointer;
}
.home-attn-rowwrap:hover .home-attn-x,
.home-attn-x:focus-visible {
  opacity: 1;
}
.home-attn-x:hover {
  color: var(--text);
}

/* D55: the Today stats became four real buttons (chips deep-link into the
   filtered inbox). Their flex layout lives in the original .ph-home-stat rule
   (54127); this only neutralises button chrome and adds press feedback. The
   footer line is a button now too. */
button.ph-home-stat {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  transition: transform 120ms ease, opacity 120ms ease;
}
button.ph-home-stat:active {
  transform: scale(0.94);
  opacity: 0.8;
}
button.ph-home-next {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
}
button.ph-home-next:active {
  opacity: 0.75;
}

/* ---- Round 7 D61: Add billable sheet (phone skin over the desktop charges
   machinery). Reuses the ph-sheet frame + ph-filter section/chip grammar. */
.ph-billable-sheet {
  max-height: 86dvh;
  /* The sheet is a fixed frame; its inner .ph-filter-scroll owns the scroll.
     Without this the sheet AND the inner region both scrolled, so the form
     floated / spilled its rounded container. */
  overflow: hidden;
}
/* The shared .ph-filter-scroll reserves 72px at the bottom for the floating Ask
   pill — but that pill unmounts whenever a sheet is open, so on this form it was
   just dead space under the Save button, adding to the "floaty" feel. */
.ph-billable-sheet .ph-filter-scroll {
  padding-bottom: 8px;
}
/* Listing actions menu (long-press a calendar property). Rows reuse the
   canonical .ph-sheet-row; only the listing header needs its own styling. */
.ph-actions-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 14px;
}
.ph-actions-thumb {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  object-fit: cover;
  flex: none;
  background: var(--ph-accent-wash);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  color: var(--ph-text-2);
}
.ph-actions-name {
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ph-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-actions-empty {
  padding: 6px 10px 18px;
  color: var(--ph-text-2);
  font-size: 14px;
}
.ph-actions-error {
  margin: 0 10px 6px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, #ef4444 34%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, #ef4444 9%, transparent);
  color: #fca5a5;
  font-size: 12.5px;
  line-height: 1.4;
}
[data-theme="light"] .ph-actions-error {
  color: #b91c1c;
}
.ph-billable-prop {
  font-size: 12.5px;
  color: var(--ph-text-dim, rgba(237, 237, 238, 0.55));
  font-weight: 600;
}
.ph-billable-input {
  width: 100%;
  border: 1px solid var(--ph-border, rgba(255, 255, 255, 0.1));
  background: var(--ph-surface-2, #17171a);
  color: var(--ph-text, #ededee);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}
.ph-billable-input:focus {
  outline: none;
  border-color: #4f46e5;
}
.ph-billable-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ph-billable-rate {
  width: 72px;
  padding: 6px 10px;
  font-size: 13px;
}
.ph-billable-desc {
  resize: none;
}
.ph-billable-hint {
  font-size: 12.5px;
  color: var(--ph-text-dim, rgba(237, 237, 238, 0.55));
}
.ph-billable-finalised {
  display: grid;
  gap: 0.2rem;
  margin: 0 2px;
  padding: 10px 11px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 42%, var(--ph-border, rgba(255, 255, 255, 0.1)));
  border-radius: 11px;
  background: color-mix(in srgb, var(--state-warning) 9%, var(--ph-surface-2, #17171a));
  color: color-mix(in srgb, var(--state-warning) 80%, var(--ph-text, #ededee));
  font-size: 12.5px;
  line-height: 1.4;
}
.ph-billable-finalised strong {
  color: var(--ph-text, #ededee);
  font-size: 13px;
}
.ph-billable-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ph-billable-acctgroup .ph-billable-accttype {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ph-text-dim, rgba(237, 237, 238, 0.5));
  margin: 2px 0 5px;
}
.ph-billable-error {
  color: #f87171;
  font-size: 13px;
  margin-bottom: 10px;
}
.ph-billable-save {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 13px;
  font-size: 15.5px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.ph-billable-save:disabled {
  opacity: 0.6;
}
.ph-billable-saved {
  padding: 26px 16px 34px;
  text-align: center;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.45;
  color: #34d399;
}

/* ---- D60 notifications (round 8): Home bell + full-screen feed sheet ------
   .ph-notif is body-portaled (fixed-overlay clipping trap) and lives in BOTH
   ph-variable scope lists above. z 70 = sheet layer (screens are 60, Ask bar
   62); the Ask bar unmounts anyway via the back-stack any-sheet-open rule. */
.ph-bell-btn { position: relative; }
.ph-bell-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4f46e5;
  border: 2px solid var(--ph-bg);
}
.ph-notif {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: var(--ph-bg);
  color: var(--ph-text, #f4f4f5);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ph-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.ph-notif-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ph-notif-actions { display: flex; gap: 8px; }
.ph-notif-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ph-notif-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.08));
}
.ph-notif-row:active { background: var(--ph-press, rgba(255, 255, 255, 0.06)); }
.ph-notif-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  background: transparent;
}
.ph-notif-row.is-unread .ph-notif-dot { background: #4f46e5; }
.ph-notif-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-notif-main strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.ph-notif-row.is-unread .ph-notif-main strong { font-weight: 750; }
.ph-notif-main span {
  font-size: 13px;
  line-height: 1.35;
  color: var(--ph-muted, rgba(244, 244, 245, 0.65));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ph-notif-row time {
  flex: none;
  font-size: 12px;
  color: var(--ph-muted, rgba(244, 244, 245, 0.55));
  margin-top: 2px;
}
.ph-notif-empty {
  padding: 48px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--ph-muted, rgba(244, 244, 245, 0.6));
}
.ph-notif-retry {
  margin-top: 12px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.14));
  background: var(--ph-surface, rgba(255, 255, 255, 0.06));
  color: inherit;
  font: inherit;
  font-weight: 600;
}
[data-theme="light"] .ph-notif-row { border-bottom-color: rgba(17, 17, 20, 0.08); }
[data-theme="light"] .ph-notif-row:active { background: rgba(17, 17, 20, 0.05); }
[data-theme="light"] .ph-notif-main span,
[data-theme="light"] .ph-notif-row time,
[data-theme="light"] .ph-notif-empty { color: rgba(17, 17, 20, 0.6); }
[data-theme="light"] .ph-notif-retry {
  border-color: rgba(17, 17, 20, 0.14);
  background: rgba(17, 17, 20, 0.04);
}
[data-theme="light"] .ph-bell-dot { border-color: var(--ph-bg); }

/* Desktop bell rows became actionable (D60 deep links). */
.workspace-channel-note.is-linked { cursor: pointer; }
.workspace-channel-note.is-linked:hover { background: var(--bg-hover, rgba(127, 127, 127, 0.08)); }

/* ================= PHONE TASKS (Round 8 T1) =================
   The phone /tasks screen (components/phone/PhoneTasksApp.tsx) and its
   detail sheet (components/phone/PhoneTaskSheet.tsx, hosting the CANONICAL
   TaskDrawer in mode="pane" — see that file's banner comment). Dark is the
   base; [data-theme="light"] overrides follow each block, matching the rest
   of this file. */

/* --- Header quick-add (the "+" trigger opens this inline row) --- */
/* (.ph-task-buckets went with the due-date filter row on 2026-07-27 — those
   filters are chips in the glasshead now.) */
.ph-task-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.ph-task-calendar-btn {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ph-tabbar-border);
  border-radius: 21px;
  background: var(--ph-tabbar-bg);
  color: var(--ph-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.ph-task-quickadd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 8px;
  margin-top: 10px;
}
.ph-task-quickadd-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 20px;
  background: var(--ph-composer-bg);
  border: 1px solid var(--ph-composer-border);
  color: var(--ph-text);
  font-size: 14.5px;
  font-family: inherit;
  padding: 0 14px;
  outline: none;
}
.ph-task-quickadd-input::placeholder {
  color: var(--ph-text-3);
}
.ph-task-quickadd-submit {
  flex: none;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.ph-task-quickadd-submit:disabled {
  opacity: 0.5;
  cursor: default;
}
.ph-task-quickadd-cancel {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  border: 0;
  background: transparent;
  color: var(--ph-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ph-task-quickadd-error {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 600;
  color: var(--ph-danger);
}
.ph-task-quickadd .task-tag-requirement-field {
  grid-column: 1 / -1;
}

/* --- List rows: a NEW phone card (the desktop .task-row is column-
   templated for a wide viewport and can't reflow — see TaskRowCard's banner
   comment in PhoneTasksApp.tsx). Every signal the desktop row shows is
   present here: complete toggle, priority, type, T-number/title/subtask
   badge/tags, listings, assignees, due, status. Card chrome takes cues from
   the dormant PR #829 mobile .task-row treatment (margin/padding/radius)
   WITHOUT dropping the listing chips it dropped — no feature-stripping on
   phone is a hard product rule. --- */
.ph-task-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 14px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--ph-hairline);
  background: var(--ph-surface);
  cursor: pointer;
}
.ph-task-row:active {
  background: var(--ph-surface-2);
}
/* Footer under a paged task list on the phone. Same card geometry as a task
   row so it reads as part of the list, using the phone's own surface tokens so
   light and dark both follow. */
.ph-task-more {
  display: block;
  width: calc(100% - 28px);
  margin: 6px 14px 18px;
  padding: 12px 13px;
  border-radius: 14px;
  border: 1px solid var(--ph-hairline);
  background: var(--ph-surface);
  color: var(--ph-text-2);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.ph-task-more:active {
  background: var(--ph-surface-2);
}
.ph-task-more:disabled {
  opacity: 0.6;
  cursor: default;
}
/* Said while the list fills itself in, in place of the "Show more" button.
   Quieter than the button on purpose — it reports, it does not invite a tap.
   Theme tokens only, so light and dark both follow. */
.ph-task-more-note {
  margin: 10px 14px 18px;
  color: var(--ph-text-3);
  font-size: 12.5px;
  text-align: center;
}
.ph-task-row.is-closed .ph-task-title {
  text-decoration: line-through;
  color: var(--ph-text-3);
}

.ph-task-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-task-complete {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--ph-border);
  background: transparent;
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.ph-task-complete.is-checked {
  background: var(--ph-success, #22c55e);
  border-color: var(--ph-success, #22c55e);
  color: #fff;
}
.ph-task-priority {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  opacity: 0.9;
}
.ph-task-priority[data-priority="none"] {
  opacity: 0.3;
}
.ph-task-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 120px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ph-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-task-type-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.ph-task-due-chip {
  margin-left: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--ph-text-2);
  white-space: nowrap;
}
.ph-task-due-chip.is-empty {
  color: var(--ph-text-3);
}
.ph-task-due-chip[data-due="overdue"] {
  color: var(--ph-danger);
}
.ph-task-due-chip[data-due="today"] {
  color: #fbbf24;
}
.ph-task-due-chip[data-due="soon"] {
  color: #93c5fd;
}

.ph-task-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 32px;
}
.ph-task-number {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ph-text-3);
  flex: none;
}
.ph-task-title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ph-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}
.ph-task-subcount {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--ph-surface-2);
  border: 1px solid var(--ph-hairline);
  color: var(--ph-text-2);
  font-size: 11px;
  font-weight: 600;
}

.ph-task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-left: 32px;
}
.ph-task-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ph-surface-2);
  border: 1px solid var(--ph-hairline);
  color: var(--ph-text-2);
  white-space: nowrap;
}
.ph-task-tag.is-muted {
  opacity: 0.6;
}
.ph-task-assignment-summary {
  margin-left: 32px;
  padding: 7px 9px;
  border: 1px solid var(--ph-hairline);
  border-radius: 8px;
  background: var(--ph-surface-2);
  color: var(--ph-text-2);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
  white-space: normal;
}
.ph-task-assignment-summary.is-accepted,
.ph-task-assignment-summary.is-in_progress,
.ph-task-assignment-summary.is-finished {
  border-color: color-mix(in srgb, var(--state-success) 38%, var(--ph-hairline));
  color: var(--state-success);
}
.ph-task-assignment-summary.is-declined {
  border-color: color-mix(in srgb, var(--state-danger) 42%, var(--ph-hairline));
  color: var(--state-danger);
}

.ph-task-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 32px;
}
.ph-task-listings {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.ph-task-listing-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, #06b6d4 14%, var(--ph-surface-2));
  border: 1px solid color-mix(in srgb, #06b6d4 30%, transparent);
  color: #67e8f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.ph-task-listing-chip.is-muted {
  background: var(--ph-surface-2);
  border-color: var(--ph-hairline);
  color: var(--ph-text-3);
}
.ph-task-row-signals {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph-task-group-chip {
  flex: none;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary, #7c3aed) 40%, var(--ph-hairline));
  background: color-mix(in srgb, var(--primary, #7c3aed) 14%, var(--ph-surface-2));
  color: color-mix(in srgb, var(--primary, #7c3aed) 76%, var(--ph-text-1));
  font-size: 10.5px;
  font-weight: 700;
}
.ph-task-avatars {
  display: flex;
  align-items: center;
  gap: 3px;
}
.ph-task-avatar-wrap {
  flex: none;
  display: inline-flex;
}
.ph-task-avatar-more {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ph-text-2);
}
.ph-task-status-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ph-surface-2);
  border: 1px solid var(--ph-hairline);
  color: var(--ph-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

[data-theme="light"] .ph-task-listing-chip {
  background: color-mix(in srgb, #06b6d4 10%, #ffffff);
  color: #0e7490;
}
[data-theme="light"] .ph-task-due-chip[data-due="overdue"] {
  color: #dc2626;
}
[data-theme="light"] .ph-task-due-chip[data-due="today"] {
  color: #d97706;
}
[data-theme="light"] .ph-task-due-chip[data-due="soon"] {
  color: #2563eb;
}

/* --- Swipe action color: Complete reads success-green. Archive keeps the
   existing default is-right (swipe-left) color and Reopen keeps the default
   is-left (swipe-right) indigo — same convention Home's Read/Clear rows
   already established. --- */
.ph-swipe-label.is-success {
  background: var(--ph-success, #16a34a);
}

/* --- Dense-list avatar size (assignee stacks) — extends the canonical
   ContactAvatar sizing block above (.ph-avatar-img / .ph-avatar-fallback,
   "Avatars (canonical ContactAvatar / AvatarStack, phone-sized)"). --- */
.ph-avatar-img.is-xs,
.ph-avatar-fallback.is-xs {
  width: 22px;
  height: 22px;
}

/* --- Detail sheet: full-screen body portal hosting the CANONICAL
   TaskDrawer (mode="pane"). TaskDrawer's own container-query responsiveness
   (@container task-modal (max-width: 900px), already in the base task-modal
   rules) collapses it to a single Details/Activity-tabbed column at phone
   widths on its own — this block is a CSS skin only: safe-area insets,
   touch-target sizing, and the one genuine hover-only affordance the drawer
   has. It never re-implements TaskDrawer's layout or editor logic. --- */
.ph-task-sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: var(--ph-bg);
  font-family: var(--font-manrope), "Manrope", -apple-system, system-ui, sans-serif;
  animation: ph-sheet-in 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}
/* .task-modal.task-modal--pane is position:absolute;inset:0 — it already
   fills this fixed root edge to edge. Only add the safe-area clearance the
   pane never needed in its old home (the properties right-rail, which never
   touched a device notch or home indicator). */
.ph-task-sheet .task-modal-topbar {
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  height: auto;
  min-height: 44px;
}
.ph-task-sheet .task-modal-composer,
.ph-task-sheet .message-composer {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Touch targets: the desktop pane's icon/pill/checkbox controls are sized
   for a mouse pointer (26px). Bump the common ones to a comfortable tap
   size without touching layout or positioning. */
.ph-task-sheet .task-modal-icon-btn,
.ph-task-sheet .task-modal-chip-iconbtn {
  min-width: 36px;
  min-height: 36px;
}
.ph-task-sheet .task-modal-pill-btn {
  min-height: 36px;
}
.ph-task-sheet .task-modal-relation-kind-pill,
.ph-task-sheet .task-modal-relation-result,
.ph-task-sheet .task-modal-relation-result-empty button {
  min-height: 44px;
}
.ph-task-sheet .task-modal-relation-remove {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}
.ph-task-sheet .task-modal-checkbox {
  width: 20px;
  height: 20px;
}
.ph-task-sheet .task-modal-narrow-tab {
  padding: 9px 14px;
}
.ph-task-sheet .task-modal-side-tab {
  padding: 10px 8px;
}

/* The one genuine hover-only affordance in the drawer: the attachment image
   remove button is opacity:0 until :hover on its parent, which never fires
   on touch — force it visible and give it a real tap target. */
.ph-task-sheet .task-modal-attachment-image-remove {
  opacity: 1;
  width: 26px;
  height: 26px;
  font-size: 1rem;
}

/* Field repair (2026-08-06): the desktop overflow popover was absolutely
   positioned inside the task scroller. On a phone it covered/clipped roughly
   half the screen. Expand it in-flow instead, so every hidden field remains in
   the document and the task simply grows beneath the More button. */
.ph-task-sheet .task-modal-cluster-more {
  width: 100%;
  flex-direction: column;
  align-items: stretch;
}
.ph-task-sheet .task-modal-cluster-more-btn { align-self: flex-start; }
.ph-task-sheet .task-modal-cluster-more-panel {
  position: static;
  inset: auto;
  z-index: auto;
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  box-shadow: none;
}
.ph-task-sheet .task-modal-cluster-more-row,
.ph-task-sheet .task-modal-cluster-more-row .task-modal-chip {
  width: 100%;
}

.task-field-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.task-field-shortcuts > button {
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  color: var(--text-primary);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.task-field-shortcuts > button:hover,
.task-field-shortcuts > button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 13%, var(--bg-elevated));
}
.task-field-shortcuts > button.is-access {
  border-color: rgba(245, 158, 11, 0.48);
  background: rgba(245, 158, 11, 0.1);
}
.task-field-shortcuts > button.is-access:hover,
.task-field-shortcuts > button.is-access:focus-visible {
  border-color: rgba(245, 158, 11, 0.72);
  background: rgba(245, 158, 11, 0.15);
}
.task-field-shortcuts > button.is-missing {
  border-style: dashed;
}
.task-field-shortcuts > button > span:first-child {
  font-size: 23px;
  color: var(--accent);
}
.task-field-shortcuts > button.is-access > span:first-child { color: #f59e0b; }
.task-field-shortcuts > button > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.task-field-shortcuts strong { font-size: 12px; }
.task-field-shortcuts small {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.25;
}
.ph-task-sheet .task-field-shortcuts > button { min-height: 58px; }
@media (max-width: 360px) {
  .task-field-shortcuts { grid-template-columns: 1fr; }
}

/* Codes are front-door controls, not prose annotations. The 20px desktop chip
   missed comfortable touch size and was difficult to spot in a long clean.
   Plaintext still loads only on explicit tap through the audited reveal route. */
.ph-task-sheet .access-code-chip {
  min-height: 42px;
  padding: 8px 13px;
  margin: 3px 2px;
  font-size: 15px;
  line-height: 22px;
  border-width: 1.5px;
  vertical-align: middle;
}

/* The Streams editor is wide and explanatory. On phone it behaves like an
   anchored bottom sheet instead of an absolute menu that can run off-screen. */
.ph-task-sheet .task-streams-picker-menu {
  position: fixed;
  top: auto;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-height: min(72vh, 620px);
  z-index: 120;
  border-radius: 16px;
  padding: 12px;
}
.ph-task-sheet .task-streams-picker-list { max-height: min(52vh, 430px); }
.ph-task-sheet .task-streams-picker-row { min-height: 50px; }
.ph-task-sheet .task-streams-picker-home { min-height: 36px; }

/* Pane 4 becomes a full phone layer. Relation taps previously changed URL
   state that only the desktop shell observed, so the tap looked dead in the
   app. Keep the task mounted underneath and show the canonical quick look. */
.ph-task-related-layer {
  position: absolute;
  inset: 0;
  z-index: 130;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px
    calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--ph-bg);
  animation: ph-sheet-in 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
.ph-task-related-layer .task-related-quicklook {
  width: 100%;
  min-height: 100%;
}
.ph-task-related-layer .task-related-quicklook-image {
  max-height: 240px;
  object-fit: cover;
}
.ph-task-related-layer .inbox-support-back,
.ph-task-related-layer .tql-btn {
  min-height: 44px;
}

/* D60 slice 2 — phone notification settings (inside the bell sheet). */
.ph-notif-prefs { padding: 4px 16px 24px; }
.notif-delivery-controls {
  display: block;
}
.notification-delivery-notice {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--state-warning, #f59e0b) 42%, var(--border-subtle));
  border-radius: 13px;
  background: color-mix(in srgb, var(--state-warning, #f59e0b) 8%, var(--bg-elevated, var(--surface)));
  color: var(--text-primary);
}
.notification-delivery-notice.is-paused {
  border-color: color-mix(in srgb, var(--state-error, #ef4444) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-error, #ef4444) 8%, var(--bg-elevated, var(--surface)));
}
.notification-delivery-notice.is-unknown {
  border-style: dashed;
}
.notification-delivery-notice-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--state-warning, #f59e0b) 16%, transparent);
  color: var(--state-warning, #f59e0b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notification-delivery-notice.is-paused .notification-delivery-notice-icon {
  background: color-mix(in srgb, var(--state-error, #ef4444) 15%, transparent);
  color: var(--state-error, #ef4444);
}
.notification-delivery-notice-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.notification-delivery-notice-copy strong {
  color: inherit;
  font-size: 0.8rem;
  font-weight: 720;
  line-height: 1.25;
}
.notification-delivery-notice-copy > span {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.42;
}
.notification-delivery-notice button {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, currentColor 24%, var(--border-subtle));
  border-radius: 9px;
  background: var(--bg-elevated, var(--surface));
  color: inherit;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.notification-delivery-notice button:hover,
.notification-delivery-notice button:focus-visible {
  border-color: currentColor;
  outline: none;
}
.notification-delivery-notice.is-desktop-panel {
  flex: none;
  margin: 0.62rem 0.68rem 0;
  padding: 0.68rem;
}
.notification-delivery-notice.is-phone-feed {
  margin: 12px 12px 2px;
  border-color: color-mix(in srgb, #f59e0b 45%, var(--ph-border));
  background: color-mix(in srgb, #f59e0b 10%, var(--ph-surface));
  color: var(--ph-text);
}
.notification-delivery-notice.is-phone-feed.is-paused {
  border-color: color-mix(in srgb, #ef4444 46%, var(--ph-border));
  background: color-mix(in srgb, #ef4444 10%, var(--ph-surface));
}
.notification-delivery-notice.is-phone-feed .notification-delivery-notice-copy > span {
  color: var(--ph-text-2);
}
.notification-delivery-notice.is-phone-feed button {
  min-height: 42px;
  border-color: var(--ph-border);
  background: var(--ph-surface);
  color: var(--ph-text);
}
.ph-notif-prefs .notification-delivery-notice.is-settings {
  border-color: color-mix(in srgb, #f59e0b 45%, var(--ph-border));
  background: color-mix(in srgb, #f59e0b 10%, var(--ph-surface));
  color: var(--ph-text);
}
.ph-notif-prefs .notification-delivery-notice.is-settings.is-paused {
  border-color: color-mix(in srgb, #ef4444 46%, var(--ph-border));
  background: color-mix(in srgb, #ef4444 10%, var(--ph-surface));
}
.ph-notif-prefs .notification-delivery-notice.is-settings .notification-delivery-notice-copy > span {
  color: var(--ph-text-2);
}
.ph-notif-prefs .notification-delivery-notice.is-settings button {
  min-height: 42px;
  border-color: var(--ph-border);
  background: var(--ph-surface);
  color: var(--ph-text);
}
[data-theme="light"] .notification-delivery-notice.is-phone-feed,
[data-theme="light"] .ph-notif-prefs .notification-delivery-notice.is-settings {
  background: color-mix(in srgb, #f59e0b 8%, #fff);
  color: #111114;
}
[data-theme="light"] .notification-delivery-notice.is-phone-feed.is-paused,
[data-theme="light"] .ph-notif-prefs .notification-delivery-notice.is-settings.is-paused {
  background: color-mix(in srgb, #ef4444 8%, #fff);
}
[data-theme="light"] .notification-delivery-notice.is-phone-feed .notification-delivery-notice-copy > span,
[data-theme="light"] .ph-notif-prefs .notification-delivery-notice.is-settings .notification-delivery-notice-copy > span {
  color: rgba(17, 17, 20, 0.64);
}
[data-theme="light"] .notification-delivery-notice.is-phone-feed button,
[data-theme="light"] .ph-notif-prefs .notification-delivery-notice.is-settings button {
  border-color: rgba(17, 17, 20, 0.16);
  background: #fff;
  color: #111114;
}
.notif-pause {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0 18px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 32%, var(--border-subtle));
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent, #6366f1) 7%, var(--bg-elevated, var(--surface)));
  color: var(--text-primary);
}
.notif-pause.is-paused {
  border-color: color-mix(in srgb, var(--state-error, #ef4444) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-error, #ef4444) 8%, var(--bg-elevated, var(--surface)));
}
.notif-pause-copy { display: flex; flex-direction: column; gap: 4px; }
.notif-pause-copy strong { font-size: 1rem; line-height: 1.25; }
.notif-pause-copy p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.notif-pause-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.notif-pause-actions button,
.notif-pause-resume,
.notif-pause-error button {
  min-height: 40px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated, var(--surface));
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.notif-pause-actions button:hover,
.notif-pause-error button:hover { border-color: var(--accent, #6366f1); }
.notif-pause-resume {
  width: fit-content;
  padding: 0 14px;
  border-color: var(--state-error, #ef4444);
  background: var(--state-error, #ef4444);
  color: #fff;
}
.notif-pause-actions button:disabled,
.notif-pause-resume:disabled { cursor: wait; opacity: 0.62; }
.notif-pause-loading { font-size: 0.8rem; color: var(--text-muted); }
.notif-pause-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--state-error, #ef4444);
  font-size: 0.8rem;
}
.notif-pause-error button { min-height: 34px; padding: 0 10px; }
.notif-pause--phone {
  margin-top: 4px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--accent, #6366f1) 10%, var(--ph-surface, #17171a));
  color: var(--ph-text, #f4f4f5);
}
.notif-pause--phone.is-paused {
  background: color-mix(in srgb, var(--state-error, #ef4444) 12%, var(--ph-surface, #17171a));
}
.notif-pause--phone .notif-pause-copy p,
.notif-pause--phone .notif-pause-loading { color: var(--ph-muted, rgba(244, 244, 245, 0.64)); }
.notif-pause--phone .notif-pause-actions button,
.notif-pause--phone .notif-pause-error button {
  min-height: 44px;
  border-color: var(--ph-hairline, rgba(255, 255, 255, 0.14));
  background: var(--ph-surface, #17171a);
  color: var(--ph-text, #f4f4f5);
}
[data-theme="light"] .notif-pause--phone {
  background: color-mix(in srgb, var(--accent, #6366f1) 7%, #fff);
  color: #111114;
}
[data-theme="light"] .notif-pause--phone.is-paused {
  background: color-mix(in srgb, var(--state-error, #ef4444) 8%, #fff);
}
[data-theme="light"] .notif-pause--phone .notif-pause-copy p,
[data-theme="light"] .notif-pause--phone .notif-pause-loading { color: rgba(17, 17, 20, 0.64); }
[data-theme="light"] .notif-pause--phone .notif-pause-actions button,
[data-theme="light"] .notif-pause--phone .notif-pause-error button {
  border-color: rgba(17, 17, 20, 0.16);
  background: #fff;
  color: #111114;
}
.ph-notif-prefs-lead {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ph-muted, rgba(244, 244, 245, 0.6));
  margin: 4px 0 14px;
}
.ph-notif-pref {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.08));
}
.ph-notif-pref-copy { display: flex; flex-direction: column; gap: 2px; }
.ph-notif-pref-copy strong { font-size: 15px; font-weight: 650; }
.ph-notif-pref-copy span {
  font-size: 12.5px;
  color: var(--ph-muted, rgba(244, 244, 245, 0.6));
}
.ph-notif-pref-chips { display: flex; gap: 8px; }
.ph-notif-chip {
  flex: 1;
  padding: 9px 0;
  border-radius: 999px;
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.14));
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}
.ph-notif-chip.is-on {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}
.ph-notif-chip:active { transform: scale(0.97); }
[data-theme="light"] .ph-notif-pref { border-bottom-color: rgba(17, 17, 20, 0.08); }
[data-theme="light"] .ph-notif-prefs-lead,
[data-theme="light"] .ph-notif-pref-copy span { color: rgba(17, 17, 20, 0.6); }
[data-theme="light"] .ph-notif-chip { border-color: rgba(17, 17, 20, 0.16); }

/* Desktop notification settings rows (Settings → Notifications). */
.notifprefs-list { display: flex; flex-direction: column; }
.notifprefs-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle, rgba(127, 127, 127, 0.18));
  flex-wrap: wrap;
}
.notifprefs-row:last-child { border-bottom: 0; }
.notifprefs-copy { max-width: 520px; }
.notifprefs-copy p { margin: 2px 0 0; font-size: 0.85rem; }
.notifprefs-copy small { font-size: 0.72rem; }
.notifprefs-saving { flex-basis: 100%; }

/* Automations builder — small explanatory note under an action editor (D60 notify). */
.autobuild-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted, rgba(127, 127, 127, 0.9));
}


/* Round-8 M1 — More sheet sections + the What's new reader. */
.ph-sheet-sect {
  margin: 14px 4px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ph-muted, rgba(244, 244, 245, 0.5));
}
.ph-sheet-sect:first-of-type { margin-top: 4px; }
.ph-wn {
  position: fixed;
  inset: 0;
  z-index: 74;
  display: flex;
  flex-direction: column;
  background: var(--ph-bg);
  color: var(--ph-text, #f4f4f5);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.ph-wn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}
.ph-wn-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.ph-wn-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 16px 32px;
}
.ph-wn-entry { padding: 14px 0; border-bottom: 1px solid var(--ph-hairline, rgba(255,255,255,0.08)); }
.ph-wn-entry:last-child { border-bottom: 0; }
.ph-wn-date { margin: 0 0 2px; font-size: 12px; color: var(--ph-muted, rgba(244,244,245,0.55)); }
.ph-wn-entry h3 { margin: 0 0 8px; font-size: 16.5px; font-weight: 750; }
.ph-wn-entry ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.ph-wn-entry li { font-size: 14px; line-height: 1.45; color: var(--ph-muted, rgba(244,244,245,0.78)); }
[data-theme="light"] .ph-sheet-sect { color: rgba(17,17,20,0.5); }
[data-theme="light"] .ph-wn-entry { border-bottom-color: rgba(17,17,20,0.08); }
[data-theme="light"] .ph-wn-date { color: rgba(17,17,20,0.55); }
[data-theme="light"] .ph-wn-entry li { color: rgba(17,17,20,0.75); }

/* --- What's-new update card (PhoneUpdateCard) --- Floats in the gap above the
   Stavros bar (bottom = tab-bar offset + 74px bar seat + 46px bar + 10px gap).
   Same glass-capsule recipe as the tab bar / Stavros bar so it reads as part
   of the app's chrome, not a web toast. z 64: over the floating bars (62),
   under every sheet (70+). Root class is in BOTH ph-variable scope lists
   above (D8 — it portals to <body>). */
.ph-update-card {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: var(--ph-update-card-bottom);
  z-index: 64;
  border-radius: 22px;
  background: var(--ph-tabbar-bg);
  backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
  border: 0.5px solid var(--ph-tabbar-border);
  box-shadow: var(--ph-tabbar-shadow);
  padding: 14px 16px 12px;
  color: var(--ph-text);
  font-family: var(--font-manrope), "Manrope", -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  animation: ph-update-card-in 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes ph-update-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ph-update-card { animation: none; }
}
.ph-update-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ph-update-card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ph-accent-soft);
}
.ph-update-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ph-update-card-list li {
  position: relative;
  padding-left: 16px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ph-text-mid);
}
.ph-update-card-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ph-accent);
}
.ph-update-card-more {
  margin-top: 10px;
  padding: 0;
  border: none;
  background: none;
  color: var(--ph-accent-soft);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* Round-8 U1 — auth pages on real phones. The auth block predates the phone
   tier: zero env() safe-area usage meant the card could sit flush against the
   notch/home indicator inside the WKWebView (viewportFit=cover app-wide). */
@media (max-width: 640px) {
  .auth-shell {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .auth-card {
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }
}

/* ── Booking money waterfall ─────────────────────────────────────────────────
   Shared per-booking money block (components/settlement-waterfall/
   BookingMoneyWaterfall.tsx): the viewer's statement view name above their
   waterfall template's lines, from /api/bookings/[bookingId]/waterfall.
   Lives inside BOTH the calendar chip hover popover and the reservation
   detail card's Financial section — style with global theme tokens only so
   light/dark and both hosts stay in sync. Skeleton reuses the fin-shimmer
   keyframes defined with .fin-skeleton. */
.booking-money-waterfall {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
  font-size: 0.8rem;
}
.booking-money-skeleton {
  height: 0.85rem;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--bg-input, rgba(255, 255, 255, 0.05)) 25%,
    var(--bg-elevated, rgba(255, 255, 255, 0.09)) 37%,
    var(--bg-input, rgba(255, 255, 255, 0.05)) 63%
  );
  background-size: 400% 100%;
  animation: fin-shimmer 1.3s ease infinite;
}
.booking-money-skeleton:nth-child(2) {
  width: 82%;
}
.booking-money-skeleton:nth-child(3) {
  width: 64%;
}
.booking-money-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.booking-money-template {
  margin: 0 0 0.1rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.booking-money-row {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.booking-money-label {
  color: var(--text-muted);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.booking-money-amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.booking-money-row[data-role="start"] .booking-money-amount {
  font-weight: 700;
}
.booking-money-row[data-role="deduction"] .booking-money-amount {
  color: var(--text-muted);
  font-weight: 500;
}
.booking-money-row[data-role="payout"] {
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 55%, transparent);
  padding-top: 0.3rem;
  margin-top: 0.12rem;
}
.booking-money-row[data-role="payout"] .booking-money-amount {
  font-weight: 800;
  color: var(--accent-positive, #1f9d55);
}
/* A negative payout is never a win — the component stamps data-negative. */
.booking-money-row[data-role="payout"] .booking-money-amount[data-negative="true"] {
  color: var(--state-error);
}

/* --- Stavros field-assist (2026-07-23) ------------------------------------ */
/* The little draft-this-for-me button beside staff-editable fields. One POST
   per click (cheap model); popover previews the draft, Insert applies it via
   the field's own setter — nothing saves until the section's Save. */
.field-assist { position: relative; display: inline-flex; }
.field-assist-btn {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 7px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer;
}
.field-assist-btn:hover { background: var(--surface-muted); color: var(--accent); }
.field-assist-btn--labelled {
  display: inline-flex;
  width: auto;
  min-width: max-content;
  gap: 0.35rem;
  padding: 0 0.55rem;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 750;
}
.field-assist-pop {
  display: flex; flex-direction: column; gap: 0.45rem;
  width: min(320px, 78vw); padding: 0.6rem;
  border-radius: 12px; border: 1px solid var(--border-subtle);
  background: var(--bg-elevated); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}
.field-assist-pop--portalled { z-index: 620; }
.field-assist-quick-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.field-assist-quick-actions button {
  border: 1px solid var(--border-subtle); border-radius: 999px;
  padding: 0.3rem 0.6rem; background: var(--surface-muted);
  color: var(--text-primary); font: inherit; font-size: 0.7rem; cursor: pointer;
}
.field-assist-quick-actions button:hover { border-color: var(--accent); color: var(--accent); }
.field-assist-quick-actions button:disabled { opacity: 0.55; cursor: default; }
.field-assist-input {
  padding: 0.45rem 0.55rem; border-radius: 8px;
  border: 1px solid var(--border-subtle); background: var(--bg-base);
  color: var(--text-primary); font-size: 0.78rem;
}
.field-assist-actions { display: flex; gap: 0.4rem; }
.field-assist-go, .field-assist-insert {
  padding: 0.35rem 0.75rem; border-radius: 999px; border: none;
  background: var(--accent); color: #fff;
  font-size: 0.74rem; font-weight: 600; cursor: pointer;
}
.field-assist-go:disabled { opacity: 0.6; cursor: default; }
.field-assist-dismiss {
  padding: 0.35rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: transparent;
  color: var(--text-muted); font-size: 0.74rem; cursor: pointer;
}
.field-assist-draft {
  font-size: 0.76rem; color: var(--text-primary);
  background: var(--surface-muted); border-radius: 8px; padding: 0.5rem 0.55rem;
  max-height: 9rem; overflow-y: auto; white-space: pre-wrap;
}
.field-assist-error { font-size: 0.72rem; color: var(--state-danger, #ef4444); }

/* (.ph-uos-tick removed 2026-07-23 — the read tick moved from inside the bubble up to
   .ph-msg-meta on the name line, for desktop parity. Ticks still ride the canonical
   DeliveryTicks component — one tick language product-wide.) */
/* Failed-send retry chip under a UOS bubble (phone). Red = the same danger
   token the rest of the app uses in both themes. */
.ph-uos-retry {
  border: 0;
  background: none;
  padding: 0.1rem 0.25rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--state-danger, #ef4444);
  cursor: pointer;
  /* Only ever rendered under MY bubble (the out side). */
  align-self: flex-end;
}

/* Failed GUEST send (TestFlight #39): the reason plus Retry/Discard under the
   bubble. Reuses the .ph-uos-retry chip for the retry action; Discard is muted
   (it throws the words away — it must not read as the primary choice). Theme
   tokens only, so light/dark both hold. */
.ph-guest-sendfail {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  align-items: flex-end;
  align-self: flex-end;
  max-width: 90%;
}
.ph-guest-sendfail-reason {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: right;
}
.ph-guest-sendfail-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.ph-guest-discard {
  border: 0;
  background: none;
  padding: 0.1rem 0.25rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

/* ── Tasks Plan 3: Streams sharing + smart views ─────────────────────────────
   Stream colour palette as theme-token keys (lib/tasks-stream-colors resolves a
   key to one of these vars). These are DATA colours (category identity), not
   chrome, so they hold the same vivid mid-tone in light and dark — legible as a
   small dot or swatch on either ground (CLAUDE.md §5 is about chrome, and these
   stay centralised as tokens rather than scattered hex). */
:root {
  --stream-color-slate: #64748b;
  --stream-color-blue: #3b82f6;
  --stream-color-green: #22c55e;
  --stream-color-amber: #f59e0b;
  --stream-color-red: #ef4444;
  --stream-color-purple: #8b5cf6;
  --stream-color-pink: #ec4899;
  --stream-color-teal: #14b8a6;
}

/* A stream row = the selectable button + a ⋯ settings/sharing affordance. The
   wrap positions the kebab, revealed on hover and on the active row (so touch,
   which has no hover, still reaches it after a tap selects the row). The kebab
   sits where the count is, so the count fades while the kebab shows. A hidden
   kebab is click-through (pointer-events:none) so it can't steal a row click. */
.stream-row-wrap { position: relative; }
.stream-row-kebab {
  position: absolute; top: 50%; right: 0.35rem; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .12s, color .12s, background .12s;
}
.stream-row-kebab:hover { color: var(--text-primary); background: color-mix(in srgb, var(--border-subtle) 70%, transparent); }
.stream-row-wrap:hover .stream-row-kebab,
.stream-row-wrap:focus-within .stream-row-kebab,
.stream-row-wrap.is-active .stream-row-kebab { opacity: 1; pointer-events: auto; }
.stream-row-wrap:hover .stream-count,
.stream-row-wrap.is-active .stream-count { opacity: 0; }
.stream-lock { flex-shrink: 0; color: var(--text-muted); }
.stream-row.is-active .stream-lock { color: var(--accent); }

/* Stream settings / sharing dialog (StreamSettingsDialog), inside .doc-modal. */
.stream-settings { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 0.4rem; }
.stream-settings-loading { padding: 1rem 0; color: var(--text-muted); font-size: 0.86rem; }
.stream-settings-field { display: flex; flex-direction: column; gap: 0.4rem; }
.stream-settings-label {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.stream-settings-hint { margin: 0; font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.stream-settings-error { margin: 0; font-size: 0.8rem; color: var(--state-danger, #dc2626); }

.stream-settings-swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.stream-swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; box-shadow: 0 0 0 1px var(--border-subtle) inset;
  transition: transform .1s, box-shadow .1s;
}
.stream-swatch:hover { transform: scale(1.08); }
.stream-swatch.is-active { box-shadow: 0 0 0 2px var(--bg-input), 0 0 0 4px var(--accent); }

.stream-settings-seg {
  display: inline-flex; border: 1px solid var(--border-subtle); border-radius: 9px;
  overflow: hidden; align-self: flex-start;
}
.stream-settings-seg-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 0.45rem 0.7rem;
  border: 0; background: transparent; color: var(--text-muted); cursor: pointer;
  font-size: 0.82rem; font-weight: 600;
}
.stream-settings-seg-btn + .stream-settings-seg-btn { border-left: 1px solid var(--border-subtle); }
.stream-settings-seg-btn.is-active { background: color-mix(in srgb, var(--accent) 16%, var(--bg-input)); color: var(--accent); }
.stream-settings-seg-btn svg { flex-shrink: 0; }

.stream-share-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.stream-share-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0.35rem; border-radius: 8px; }
.stream-share-row:hover { background: color-mix(in srgb, var(--border-subtle) 45%, transparent); }
.stream-share-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.7rem; color: #fff;
}
.stream-share-avatar img { width: 100%; height: 100%; object-fit: cover; }
.stream-share-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.85rem; color: var(--text-primary);
}
.stream-share-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 0; background: transparent; color: var(--text-muted);
  border-radius: 6px; cursor: pointer; flex-shrink: 0;
}
.stream-share-remove:hover { color: var(--state-danger, #dc2626); background: color-mix(in srgb, var(--border-subtle) 55%, transparent); }
.stream-share-add {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  padding: 0.4rem 0.6rem; border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  border-radius: 8px; background: transparent; color: var(--accent); font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.stream-share-add:disabled { opacity: 0.6; cursor: default; color: var(--text-muted); border-style: solid; border-color: var(--border-subtle); }
.stream-share-add-select,
.stream-settings-select {
  width: 100%; padding: 0.45rem 0.5rem; border-radius: 8px;
  border: 1px solid var(--border-subtle); background: var(--bg-input); color: var(--text-primary); font-size: 0.85rem;
}

.stream-settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.4rem; }
.stream-settings-footer-left { min-width: 0; }
.stream-settings-footer-right { display: inline-flex; gap: 0.5rem; flex-shrink: 0; }
.stream-settings-archive {
  display: inline-flex; align-items: center; gap: 5px; padding: 0.4rem 0.5rem;
  border: 0; background: transparent; color: var(--text-muted); font-size: 0.8rem; cursor: pointer; border-radius: 7px;
}
.stream-settings-archive:hover { color: var(--state-danger, #dc2626); background: color-mix(in srgb, var(--border-subtle) 45%, transparent); }
.stream-settings-confirm { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-muted); }

/* Per-stream statuses, inside Stream settings (StreamStatusEditor).
   Grouped under the three parent categories, because "every status falls into a
   category" is the model Hakim described and the grouping is what makes it
   visible. Every colour is a theme token so it reads in light and dark (§5) —
   the only literal colour on screen is the one the user picked for the status
   itself, in the native <input type="color"> swatch. */
.stream-status-group { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.55rem; }
.stream-status-group-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}
.stream-status-list { display: flex; flex-direction: column; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.stream-status-row { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.stream-status-color {
  width: 26px; height: 26px; flex-shrink: 0; padding: 0; cursor: pointer;
  border: 1px solid var(--border-subtle); border-radius: 7px; background: transparent;
}
.stream-status-color:disabled { cursor: default; opacity: 0.75; }
/* Chrome and Safari paint the chosen colour in an inset swatch — trim its
   padding so the control reads as a solid dot rather than a bordered box. */
.stream-status-color::-webkit-color-swatch-wrapper { padding: 2px; }
.stream-status-color::-webkit-color-swatch { border: 0; border-radius: 5px; }
.stream-status-name { flex: 1 1 auto; min-width: 0; }
.stream-status-name.is-readonly {
  padding: 0.35rem 0.1rem; font-size: 0.85rem; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stream-status-kind { width: auto; flex: 0 0 auto; max-width: 8.5rem; padding: 0.3rem 0.4rem; font-size: 0.78rem; }
.stream-status-move {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer;
}
.stream-status-move:hover:not(:disabled) { color: var(--text-primary); background: color-mix(in srgb, var(--border-subtle) 55%, transparent); }
.stream-status-move:disabled { opacity: 0.35; cursor: default; }
.stream-status-add { margin-top: 0.15rem; padding: 0.3rem 0.5rem; font-size: 0.78rem; }
.stream-status-actions { display: flex; align-items: center; margin-top: 0.6rem; }

/* ── Tasks phone: list/view selector + list picker sheet ─────────────────────
   Phone parity with the desktop pane-2 (TasksListPane). The selector pill sits
   under the "Tasks" title and opens PhoneTaskListPicker; the picker reuses the
   canonical .ph-sheet-* chrome and only styles its row internals. All colours
   come from the phone tier's --ph-* tokens (defined for both themes) + the
   global --stream-color-* data tokens, so light + dark parity is automatic.
   Lucide icons inherit `color` via currentColor — so the button/row `color`
   drives the icons, and only the lock/chevron/count are dimmed explicitly (no
   `> svg` colour rule, to avoid a specificity fight with .ph-sheet-row svg). */
/* The Tasks collection selector was RETIRED on 2026-07-27: the phone Tasks
   head is now the same liquid glasshead the inbox has (search capsule + one
   anchor-and-pair chip row), and the lists it used to open are chips —
   components/phone/PhoneTasksApp.tsx. The picker SHEET still exists, behind
   the "All streams" chip, and its own .ph-listpick-* rules are below. */

/* Picker rows — .ph-sheet-row provides the base (flex/gap/padding); these add
   the trailing count, the colour dot, the private lock and the active tint. */
.ph-listpick-row {
  width: 100%;
}
.ph-listpick-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-listpick-count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--ph-text-2, #8a8a93);
  font-variant-numeric: tabular-nums;
}
.ph-listpick-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.ph-listpick-lock {
  flex: 0 0 auto;
  color: var(--ph-text-3, #6b6b73);
}
.ph-listpick-row.is-active {
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-accent-soft, #a5b4fc);
}
.ph-listpick-row.is-active .ph-listpick-count {
  color: var(--ph-accent-soft, #a5b4fc);
}
.ph-listpick-row.is-active svg {
  color: var(--ph-accent-soft, #a5b4fc);
}
/* Folder groups (2026-07-26): a bare 12px text header over a full tree read
   as "no folders at all". The header now carries a folder icon and member
   rows sit on an indented guide line; folderless lists that follow get
   clearing margin so they don't read as members of the last folder. Tokens
   only (--ph-*), so light/dark parity is automatic. */
.ph-listpick-folder {
  margin-top: 6px;
}
.ph-listpick-folder-name {
  margin: 8px 10px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ph-text-2, #8a8a93);
}
.ph-listpick-folder-name svg {
  flex: 0 0 auto;
  color: var(--ph-text-3, #6b6b73);
}
/* Folder header = its label + a ⋯ that renames or archives the folder
   (2026-07-26). Its OWN wrapper, deliberately not .ph-listpick-rowwrap: that
   one carries the member-row indent guide (margin/padding/border-left below),
   which would step the header in as though it were one of its own lists. The
   kebab is shorter than a list row's because a header is not a 44px row. */
.ph-listpick-folderhead {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ph-listpick-folderhead .ph-listpick-folder-name {
  flex: 1 1 auto;
  min-width: 0;
}
.ph-listpick-folderhead .ph-listpick-kebab {
  height: 30px;
}
.ph-listpick-folder .ph-listpick-rowwrap {
  margin-left: 12px;
  padding-left: 6px;
  border-left: 1.5px solid var(--ph-border, rgba(255, 255, 255, 0.1));
}
.ph-listpick-folder + .ph-listpick-rowwrap {
  margin-top: 10px;
}

/* --- List management from the picker (Plan 4C, 2026-07-24) ------------------
   A stream row becomes row-button + sibling ⋯ (never nested — invalid HTML),
   the ⋯ always visible (touch has no hover), plus a "New list" action row.
   The management sheet itself is PhoneStreamSettingsSheet (.ph-streamset-*
   below). Everything is --ph-* token based, so light/dark parity is automatic
   (CLAUDE.md §5); the only literal colours are the brand save gradient (same
   as .ph-billable-save) and white-on-danger text, both theme-stable. */
.ph-listpick-rowwrap {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ph-listpick-rowwrap .ph-listpick-row {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
.ph-listpick-kebab {
  flex: 0 0 auto;
  width: 40px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ph-text-2, #8a8a93);
  cursor: pointer;
}
.ph-listpick-kebab:active {
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
}
.ph-listpick-new {
  width: 100%;
  color: var(--ph-accent-soft, #a5b4fc);
}
.ph-listpick-new svg {
  color: var(--ph-accent-soft, #a5b4fc);
}

/* --- PhoneStreamSettingsSheet (Plan 4C) ------------------------------------ */
.ph-streamset-input {
  width: 100%;
  border: 1px solid var(--ph-border, rgba(255, 255, 255, 0.1));
  background: var(--ph-surface-2, #17171a);
  color: var(--ph-text, #ededee);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}
.ph-streamset-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.ph-streamset-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.ph-streamset-swatch.is-active {
  box-shadow:
    0 0 0 3px var(--ph-surface, #1b1b20),
    0 0 0 5px var(--ph-accent, #6366f1);
}
.ph-streamset-hint {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ph-text-2, #8a8a93);
}
.ph-streamset-error {
  font-size: 13px;
  font-weight: 600;
  color: var(--ph-danger, #f87171);
}
.ph-streamset-share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-streamset-share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 4px;
  border-radius: 12px;
}
.ph-streamset-share-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  color: var(--ph-text, #ededee);
}
.ph-streamset-share-remove {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ph-text-2, #8a8a93);
  cursor: pointer;
}
.ph-streamset-share-remove:active {
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
}
/* 🔴 16px icon floor, enforced in CSS: the lucide size prop alone measured 14px
   here (ancestor font-size shrinks em-derived svg boxes) — same trap and same
   fix as the Plan 4A padlocks (feedback_icons_too_small: measure, don't trust
   the prop). */
.ph-streamset-share-remove svg,
.ph-streamset-add svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.ph-streamset-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  border: 0;
  background: transparent;
  padding: 8px 4px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ph-accent-soft, #a5b4fc);
  cursor: pointer;
}
.ph-streamset-add:disabled {
  color: var(--ph-text-3, #6f6f77);
  cursor: default;
}
.ph-streamset-addlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ph-streamset-addrow {
  width: 100%;
}
.ph-streamset-save {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 13px;
  font-size: 15.5px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  cursor: pointer;
}
.ph-streamset-save:disabled {
  opacity: 0.65;
}
.ph-streamset-archive {
  width: 100%;
  margin-top: 2px;
}
.ph-streamset-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
}
.ph-streamset-confirm-label {
  flex: 1 1 auto;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ph-danger, #f87171);
}
.ph-streamset-confirm-yes {
  border: 0;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--ph-danger, #f87171);
  cursor: pointer;
}
.ph-streamset-confirm-no {
  border: 1px solid var(--ph-border, rgba(255, 255, 255, 0.1));
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ph-text, #ededee);
  background: transparent;
  cursor: pointer;
}

/* --- Task-level privacy (Plan 4A, 2026-07-24) -------------------------------
   ONE task can be private: only the people in task_shares (plus its creator /
   assignees) can see it, enforced by RLS (can_see_task), never by these styles.
   These rules only MARK that state wherever a task renders — the pane-4 quick
   look head, its "Who can see" row, and the pane-3 list row.
   🔴 Every icon here is 16px with `flex: 0 0 auto`: the size prop alone is not
   enough, because global button/flex padding has twice squeezed 16px glyphs
   down to ~4-8px wide (memory: feedback_icons_too_small). Colours are tokens,
   so light/dark parity comes free (CLAUDE.md §5). */
.tql-private {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--text-muted);
}
.tql-visibility {
  gap: 6px;
}
.tql-visibility svg {
  flex: 0 0 auto;
  color: var(--text-muted);
}
.task-row-private {
  flex: 0 0 auto;
  margin-left: 2px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   Staff feedback widget (components/feedback/FeedbackButton.tsx)
   Modal chrome mirrors .inbox-confirm-* (the canonical dialog pattern); the
   action buttons reuse .inbox-confirm-btn directly. Tokens only — light/dark
   parity comes free.
   --------------------------------------------------------------------------- */
.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.feedback-modal {
  width: min(560px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  padding: 1.15rem 1.2rem 1rem;
}
.feedback-modal.is-annotating {
  width: min(1100px, 96vw);
}
.feedback-shot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.5rem;
  transition:
    border-color 140ms ease,
    background 140ms ease;
}
.feedback-shot.is-dragging {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
}
.feedback-shot--empty {
  align-items: center;
  justify-content: center;
  min-height: 94px;
  padding: 0.8rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
}
.feedback-shot-thumb {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 0;
  align-self: center;
}
.feedback-shot-thumb canvas {
  max-width: 100%;
  max-height: 190px;
  width: auto;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}
.feedback-shot-actions {
  display: flex;
  gap: 0.9rem;
  justify-content: center;
}
.feedback-link-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
}
.feedback-link-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.feedback-link-btn:hover:not(:disabled) {
  text-decoration: underline;
}
.feedback-comment {
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0.55rem 0.7rem;
  resize: vertical;
  min-height: 68px;
}
.feedback-comment:focus {
  outline: none;
  border-color: var(--accent);
}
.feedback-error {
  margin: 0;
  font-size: 0.8rem;
  color: var(--state-error, #dc2626);
}
.feedback-capture-notice {
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid
    color-mix(in srgb, var(--state-warning) 30%, var(--border-subtle));
  border-radius: 9px;
  color: var(--text-soft);
  background: color-mix(
    in srgb,
    var(--state-warning) 7%,
    var(--bg-elevated)
  );
  font-size: 0.78rem;
  line-height: 1.45;
}
.feedback-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.feedback-footer .inbox-confirm-actions {
  margin-top: 0;
  margin-left: auto;
}
.feedback-footer-hint {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-soft);
  flex: 1 1 220px;
}
.feedback-annotate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.feedback-annotate-tools {
  display: flex;
  gap: 0.35rem;
}
.feedback-tool-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 32px;
  padding: 0 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}
.feedback-tool-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.feedback-tool-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast, #fff);
}
.feedback-annotate-stage {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  line-height: 0;
}
.feedback-annotate-canvas {
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}
.feedback-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 0.5rem;
  text-align: center;
}
.feedback-sent p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.feedback-sent-check {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast, #fff);
  font-size: 1rem;
  font-weight: 700;
}

/* ============================== PHONE APP — reservation quick-look (ph-resq)
   The reservation OBJECT as a phone sheet (PhoneReservationSheet): the shared
   ReservationQuickViewBody re-skinned phone-first — big title, status chip,
   stay strip, inset-grouped facts. Root carries .ph-details so the --ph-*
   variables (dark base + light override) ride the D8 scope lists; everything
   below is token-only, so light/dark parity is free. */
.ph-resq .ph-details-body {
  gap: 16px;
  padding-top: 18px;
}
/* D33's flex-shrink trap, third victim: .ph-details-body is a column flex
   scroller, and .mystay-section carries overflow:hidden — which zeroes its
   min-content floor, so IT absorbed all the shrinkage and collapsed to a
   10px pill. Children never shrink; the body scrolls. */
.ph-resq .ph-details-body > * {
  flex: 0 0 auto;
}
/* The sheet header already says "Reservation" — the body's eyebrow label
   would say it twice. */
.ph-resq .inbox-resqv-head .inbox-crm-card-label {
  display: none;
}
.ph-resq .inbox-resqv-head {
  gap: 8px;
  padding: 0 2px;
}
.ph-resq .inbox-resqv-title {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ph-text, #ededee);
}
.ph-resq .inbox-resqv-head .inbox-td-stay-phase {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
}
/* Stay strip — the dates read as the object's hero fact. */
.ph-resq .inbox-resqv-dates {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border-radius: 16px;
  background: var(--ph-accent-wash, rgba(99, 102, 241, 0.14));
  color: var(--ph-chip-text, #a5b4fc);
  font-size: 13.5px;
  font-weight: 700;
}
.ph-resq .inbox-resqv-dates svg {
  flex-shrink: 0;
}
/* Facts — iOS inset-grouped card: label left, value right, hairline rows. */
.ph-resq .inbox-resqv-facts {
  gap: 0;
  margin: 0;
  padding: 2px 14px;
  border-top: 0;
  border-radius: 16px;
  background: var(--ph-surface, #1b1b20);
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
}
.ph-resq .inbox-resqv-fact {
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
}
.ph-resq .inbox-resqv-fact:last-child {
  border-bottom: 0;
}
.ph-resq .inbox-resqv-fact dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--ph-text-2, #8a8a93);
}
.ph-resq .inbox-resqv-fact dt svg {
  color: var(--ph-text-3, #6f6f77);
}
.ph-resq .inbox-resqv-fact dd {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ph-text, #ededee);
  text-align: right;
}
/* Money + property jump on the phone sheet — the SAME body renders here, so the
   desktop card recipe (--bg-elevated / --border-subtle) has to be restated in
   phone tokens or it reads as a foreign panel. iOS inset-grouped card, 16px. */
.ph-resq .inbox-resqv-money {
  padding: 14px;
  border-radius: 16px;
  background: var(--ph-surface, #1b1b20);
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
}
.ph-resq .inbox-resqv-money .booking-money-waterfall {
  gap: 7px;
  font-size: 13.5px;
}
.ph-resq .inbox-resqv-money .booking-money-label {
  color: var(--ph-text-2, #8a8a93);
  font-weight: 600;
}
.ph-resq .inbox-resqv-money .booking-money-amount {
  color: var(--ph-text, #ededee);
  font-weight: 700;
}
.ph-resq .inbox-resqv-money .booking-money-row[data-role="deduction"] .booking-money-amount {
  color: var(--ph-text-2, #8a8a93);
  font-weight: 600;
}
.ph-resq .inbox-resqv-money .booking-money-row[data-role="payout"] {
  border-top: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  padding-top: 9px;
  margin-top: 3px;
}
.ph-resq .inbox-resqv-money .booking-money-row[data-role="payout"] .booking-money-label,
.ph-resq .inbox-resqv-money .booking-money-row[data-role="payout"] .booking-money-amount {
  font-size: 15px;
  font-weight: 800;
  color: var(--ph-text, #ededee);
}
.ph-resq .inbox-resqv-money .booking-money-template,
.ph-resq .inbox-resqv-money .booking-money-note {
  color: var(--ph-text-3, #6f6f77);
}
.ph-resq .inbox-resqv-property-link {
  padding: 14px;
  border-radius: 16px;
  background: var(--ph-surface, #1b1b20);
  border: 1px solid var(--ph-hairline, rgba(255, 255, 255, 0.06));
  color: var(--ph-text, #ededee);
  font-size: 14.5px;
  font-weight: 700;
}
.ph-resq .inbox-resqv-property-link svg {
  color: var(--ph-text-3, #6f6f77);
}

/* ── Stavros AI control + real specialist activity (2026-07-25) ─────────────
   These surfaces are fed by production events and service-only usage records.
   There is deliberately no "demo team" state: if no agent ran, no deck exists. */
.ai-message-response {
  min-width: 0;
  color: inherit;
  font: inherit;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.ai-message-response > :first-child {
  margin-top: 0;
}
.ai-message-response > :last-child {
  margin-bottom: 0;
}
.ai-message-response p {
  margin: 0 0 0.65em;
}
.ai-message-response ul,
.ai-message-response ol {
  margin: 0.45em 0 0.75em;
  padding-left: 1.35em;
}
.ai-message-response li + li {
  margin-top: 0.25em;
}
.ai-message-response a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.ai-message-response code {
  padding: 0.12em 0.32em;
  border-radius: 5px;
  background: var(--surface-3);
  font-size: 0.88em;
}
.ai-message-response pre {
  max-width: 100%;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-deep);
}

.ai-agent-deck {
  position: relative;
  margin-top: 10px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border-subtle));
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 8%, transparent), transparent 44%),
    color-mix(in srgb, var(--bg-elevated) 88%, var(--surface-muted));
  box-shadow: inset 0 1px color-mix(in srgb, white 4%, transparent);
}
.ai-agent-deck.is-compact {
  padding: 12px;
  border-radius: 13px;
}
.ai-agent-deck-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-agent-deck-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.ai-agent-deck-head > span:nth-child(2) {
  display: grid;
  min-width: 0;
}
.ai-agent-deck-head strong {
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.2;
}
.ai-agent-deck-head small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.8125rem;
}
.ai-agent-deck-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--state-warning);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ai-agent-deck-live svg {
  animation: ai-control-pulse 1.6s ease-in-out infinite;
}
.ai-agent-deck-live.is-done {
  color: var(--state-success);
}
.ai-agent-deck-live.is-done svg {
  animation: none;
}
.ai-agent-topology {
  display: flex;
  align-items: center;
  height: 30px;
  margin: 6px 0 2px 15px;
}
.ai-agent-topology-hub {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 50%;
  color: var(--accent);
  background: var(--bg-elevated);
}
.ai-agent-topology-line {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 12%, transparent));
}
.ai-agent-topology-state {
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 750;
  background: var(--surface-muted);
}
.ai-agent-topology-state.is-active {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
}
.ai-agent-list {
  display: grid;
  gap: 7px;
}
.ai-agent-row {
  --agent-tone: var(--accent);
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 84%, transparent);
}
.ai-agent-row[data-tone="operations"] {
  --agent-tone: #14b8a6;
}
.ai-agent-row[data-tone="finance"] {
  --agent-tone: #22c55e;
}
.ai-agent-row[data-tone="intelligence"] {
  --agent-tone: #38bdf8;
}
.ai-agent-row[data-tone="risk"] {
  --agent-tone: #f59e0b;
}
.ai-agent-node {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: var(--agent-tone);
  background: color-mix(in srgb, var(--agent-tone) 11%, transparent);
}
.ai-agent-copy {
  display: grid;
  min-width: 0;
}
.ai-agent-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-agent-copy small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-agent-state {
  color: var(--agent-tone);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ai-agent-state:not(.is-done) {
  animation: ai-control-pulse 1.5s ease-in-out infinite;
}
.ai-agent-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.ai-agent-sources > span,
.ai-agent-sources > a {
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  text-decoration: none;
  background: var(--bg-elevated);
}
.ai-agent-sources .ai-agent-sources-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--state-success);
  border-color: color-mix(in srgb, var(--state-success) 28%, var(--border-subtle));
}

.ai-control {
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 16px clamp(14px, 2vw, 28px) 32px;
  color: var(--text-primary);
}
.ai-control > :not(.ai-run-modal) {
  width: min(100%, 1180px);
  margin-inline: auto;
}
.ai-control.is-compact {
  padding: 12px 14px 32px;
}
.ai-control-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 150px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 18px;
  background:
    radial-gradient(circle at 82% 18%, color-mix(in srgb, #38bdf8 11%, transparent), transparent 30%),
    radial-gradient(circle at 12% 120%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 48%),
    color-mix(in srgb, var(--bg-elevated) 90%, var(--surface-muted));
}
.ai-control-kicker,
.ai-control-section-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.ai-control-hero h3 {
  margin: 12px 0 6px;
  font-size: 1.625rem;
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.ai-control-hero p {
  max-width: 36rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.875rem;
  line-height: 1.5;
}
.ai-control-refresh {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--surface-muted) 88%, transparent);
}
.ai-control-refresh:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
}
.ai-control-signal {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  opacity: 0.62;
}
.ai-control-signal i {
  width: 3px;
  border-radius: 4px;
  background: linear-gradient(180deg, #38bdf8, var(--accent));
  animation: ai-control-signal 1.6s ease-in-out infinite alternate;
}
.ai-control-signal i:nth-child(1) { height: 28%; animation-delay: -0.4s; }
.ai-control-signal i:nth-child(2) { height: 62%; animation-delay: -1s; }
.ai-control-signal i:nth-child(3) { height: 94%; animation-delay: -0.2s; }
.ai-control-signal i:nth-child(4) { height: 48%; animation-delay: -0.75s; }
.ai-control-signal i:nth-child(5) { height: 78%; animation-delay: -1.3s; }
.ai-control-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ai-control-metric {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 3px 8px;
  min-width: 0;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, var(--surface-muted));
}
.ai-control-metric svg {
  grid-row: 1 / 3;
  color: var(--accent);
}
.ai-control-metric strong {
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.ai-control-metric span {
  color: var(--text-soft);
  font-size: 0.8125rem;
}
.ai-control-card {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, var(--surface-muted));
}
.ai-control-card > header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.ai-control-card > header > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 750;
}
.ai-control-card > header svg {
  color: var(--accent);
}
.ai-control-card > header small {
  margin-left: auto;
  color: var(--state-success);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ai-control-allowance {
  border-color: color-mix(in srgb, var(--state-success) 28%, var(--border-subtle));
}
.ai-control-allowance[data-health="watch"],
.ai-control-allowance[data-health="warning"] {
  border-color: color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
}
.ai-control-allowance[data-health="reached"] {
  border-color: color-mix(in srgb, var(--state-error) 42%, var(--border-subtle));
}
.ai-control-allowance-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--surface-muted);
}
.ai-control-allowance-summary strong {
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.45;
}
.ai-control-allowance-summary span {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.ai-control-allowance-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.ai-control-allowance-list > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-elevated) 82%, var(--surface-muted));
}
.ai-control-allowance-list > span[data-health="watch"],
.ai-control-allowance-list > span[data-health="warning"] {
  border-color: color-mix(in srgb, var(--state-warning) 30%, var(--border-subtle));
}
.ai-control-allowance-list > span[data-health="reached"] {
  border-color: color-mix(in srgb, var(--state-error) 36%, var(--border-subtle));
}
.ai-control-allowance-list small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-control-allowance-list strong {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
.ai-control-allowance-list i {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 500;
}
.ai-control-allowance > a {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 750;
  text-decoration: none;
}
.ai-control-provider-spend {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
}
.ai-control-intelligence {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
}
.ai-control-intelligence[data-state="paused"] > header small {
  color: var(--text-muted);
}
.ai-control-intelligence[data-state="active"] > header small {
  color: var(--state-success);
}
.ai-control-intelligence-action {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 9px;
}
.ai-control-intelligence-action > label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px;
  border-radius: 10px;
  background: var(--surface-muted);
}
.ai-control-intelligence-action > label > span {
  display: grid;
  min-width: 0;
}
.ai-control-intelligence-action strong {
  font-size: 0.875rem;
}
.ai-control-intelligence-action small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.ai-control-intelligence-action input {
  width: 20px;
  height: 20px;
  margin-left: auto;
  accent-color: var(--accent);
}
.ai-control-intelligence-action button {
  min-width: 150px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: white;
  font-size: 0.8125rem;
  font-weight: 800;
  background: var(--accent);
}
.ai-control-intelligence-action button:disabled {
  opacity: 0.52;
}
.ai-control-provider-spend[data-state="warning"] {
  border-color: color-mix(in srgb, var(--state-warning) 58%, var(--border-subtle));
}
.ai-control-provider-spend[data-state="warning"] > header small {
  color: var(--state-warning);
}
.ai-control-provider-copy {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.ai-control-provider-totals,
.ai-control-provider-limits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.ai-control-provider-totals > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
}
.ai-control-provider-totals small,
.ai-control-provider-totals i {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-control-provider-totals strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.ai-control-provider-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.ai-control-provider-switches > label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border-radius: 10px;
  background: var(--surface-muted);
}
.ai-control-provider-switches > label > span {
  display: grid;
  min-width: 0;
}
.ai-control-provider-switches strong {
  font-size: 0.875rem;
}
.ai-control-provider-switches small {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.ai-control-provider-switches input {
  width: 20px;
  height: 20px;
  margin-left: auto;
  accent-color: var(--accent);
}
.ai-control-provider-limits {
  margin-top: 8px;
}
.ai-control-provider-limits > label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--text-soft);
  font-size: 0.8125rem;
}
.ai-control-provider-limits > label > span:last-child {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
}
.ai-control-provider-limits i {
  color: var(--text-muted);
  font-style: normal;
}
.ai-control-provider-limits input,
.ai-control-provider-actions input {
  min-width: 0;
  width: 100%;
  border: 0;
  color: var(--text-primary);
  font: inherit;
  font-variant-numeric: tabular-nums;
  background: transparent;
  outline: none;
}
.ai-control-provider-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.ai-control-provider-actions label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-soft);
  font-size: 0.8125rem;
}
.ai-control-provider-actions label input {
  width: 58px;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  text-align: right;
  background: var(--bg-elevated);
}
.ai-control-provider-actions button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  color: white;
  font-size: 0.8125rem;
  font-weight: 800;
  background: var(--accent);
}
.ai-control-provider-actions button:disabled {
  opacity: 0.58;
}
.ai-control-provider-footnote {
  display: block;
  margin-top: 9px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.ai-control-rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
}
.ai-control-rule > svg {
  margin-top: 1px;
  color: var(--state-success);
}
.ai-control-rule > span {
  display: grid;
}
.ai-control-rule strong {
  font-size: 0.875rem;
}
.ai-control-rule small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.ai-control-safety-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--state-warning);
  font-size: 0.8125rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--state-warning) 9%, transparent);
}
.ai-control-notice {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 28%, var(--border-subtle));
  border-radius: 12px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
  background: color-mix(in srgb, var(--state-warning) 8%, var(--bg-elevated));
}
.ai-control-notice.is-empty {
  border-color: var(--border-subtle);
  background: var(--surface-muted);
}
.ai-control-recent {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.ai-control-recent .ai-agent-deck {
  margin-top: 0;
}
.ai-control-quality {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: var(--border-subtle);
}
.ai-control-quality > div {
  display: grid;
  gap: 5px;
  padding: 12px 10px;
  background: color-mix(in srgb, var(--bg-elevated) 90%, var(--surface-muted));
}
.ai-control-quality span {
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ai-control-quality strong {
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}
.ai-control-quality .is-alert strong {
  color: var(--state-warning);
}
.ai-control-capabilities {
  display: grid;
  gap: 8px;
}
.ai-control-capability {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-muted);
}
.ai-control-capability > span {
  display: grid;
  min-width: 0;
}
.ai-control-capability strong {
  font-size: 0.875rem;
}
.ai-control-capability small {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.4;
}
.ai-control-mode {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-elevated);
}
.ai-control-mode button {
  min-width: 52px;
  min-height: 42px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 0.8125rem;
  font-weight: 750;
  background: transparent;
}
.ai-control-mode button.is-selected {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-muted));
  box-shadow: 0 1px 5px color-mix(in srgb, #000 12%, transparent);
}
.ai-control-mode button:disabled {
  cursor: default;
  opacity: 0.72;
}
.ai-control-run-list {
  display: grid;
  gap: 8px;
}
.ai-control-run-list > button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  color: var(--text-primary);
  text-align: left;
  background: color-mix(in srgb, var(--bg-elevated) 90%, var(--surface-muted));
}
.ai-control-run-list > button:hover {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  transform: translateY(-1px);
}
.ai-control-run-list > button.has-incident {
  border-color: color-mix(in srgb, var(--state-warning) 36%, var(--border-subtle));
}
.ai-control-run-list > button > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 10%, transparent);
}
.ai-control-run-list > button.has-incident > span:first-child {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 10%, transparent);
}
.ai-control-run-list > button > span:nth-child(2) {
  display: grid;
  min-width: 0;
}
.ai-control-run-list strong {
  overflow: hidden;
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-control-run-list small,
.ai-control-run-list time {
  color: var(--text-soft);
  font-size: 0.8125rem;
}

.ai-quality {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.ai-quality-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--text-soft);
  font-size: 11.5px;
}
.ai-quality-status > svg {
  color: var(--state-success);
}
.ai-quality-status.is-human_review > svg {
  color: var(--state-warning);
}
.ai-quality-status strong {
  color: var(--text-primary);
  font-size: 12px;
}
.ai-quality-sources {
  display: grid;
  gap: 4px;
  margin-top: 7px;
}
.ai-quality-sources > a,
.ai-quality-sources > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  background: var(--surface-muted);
}
.ai-quality-sources > a > span,
.ai-quality-sources > span > span {
  display: grid;
}
.ai-quality-sources strong {
  font-size: 12px;
}
.ai-quality-sources small {
  color: var(--text-soft);
  font-size: 11px;
}
.ai-quality-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.ai-quality-actions button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 650;
  background: transparent;
}
.ai-quality-actions button:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
}
.ai-quality-saved {
  color: var(--state-success);
  font-size: 11px;
}
.ai-quality-form {
  display: grid;
  gap: 6px;
  margin-top: 7px;
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
}
.ai-quality-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.ai-quality-reasons button {
  padding: 3px 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 11px;
  background: var(--bg-elevated);
}
.ai-quality-reasons button.is-selected {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
}
.ai-quality-form textarea {
  width: 100%;
  resize: vertical;
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  background: var(--bg-elevated);
}
.ai-quality-submit {
  justify-self: start;
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  background: var(--accent);
}
.ai-quality-error {
  margin: 6px 0 0;
  color: var(--state-danger);
  font-size: 11.5px;
}

.ai-run-modal {
  position: fixed;
  z-index: 180;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}
.ai-run-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, #05050a 76%, transparent);
  backdrop-filter: blur(8px);
}
.ai-run-inspector {
  position: relative;
  display: flex;
  width: min(620px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 18px;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 32%),
    var(--bg-elevated);
  box-shadow: 0 30px 90px color-mix(in srgb, #000 50%, transparent);
}
.ai-run-inspector > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.ai-run-inspector > header > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 800;
}
.ai-run-inspector > header > span svg {
  color: var(--accent);
}
.ai-run-inspector > header button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--surface-muted);
}
.ai-run-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 240px;
  color: var(--text-soft);
  font-size: 0.875rem;
}
.ai-run-body {
  display: grid;
  gap: 12px;
  padding: 16px;
  overflow: auto;
}
.ai-run-title,
.ai-run-body > section,
.ai-run-body > footer {
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-muted) 82%, transparent);
}
.ai-run-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 8px;
}
.ai-run-title > span {
  grid-row: 1 / 3;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--state-success);
  font-size: 0.8125rem;
  font-weight: 750;
  background: color-mix(in srgb, var(--state-success) 10%, transparent);
}
.ai-run-title > span.is-human_review {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 10%, transparent);
}
.ai-run-title strong {
  font-size: 0.875rem;
}
.ai-run-title small {
  color: var(--text-soft);
  font-size: 0.8125rem;
}
.ai-run-body h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 9px;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.ai-run-body p,
.ai-run-body blockquote {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.ai-run-body blockquote {
  margin-top: 8px;
  padding: 8px;
  border-left: 2px solid var(--accent);
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.ai-run-sources,
.ai-run-checks {
  display: grid;
  gap: 7px;
}
.ai-run-sources > span,
.ai-run-checks > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 10px;
  border-radius: 9px;
  background: var(--bg-elevated);
}
.ai-run-sources strong,
.ai-run-checks strong {
  font-size: 0.875rem;
}
.ai-run-sources small,
.ai-run-checks small {
  color: var(--text-soft);
  font-size: 0.8125rem;
  line-height: 1.45;
}
.ai-run-replay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ai-run-replay-head h4 {
  margin: 0;
}
.ai-run-replay-head button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 7px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 750;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.ai-run-replay-head + p {
  margin: 6px 0 8px;
}
.ai-run-checks > div {
  grid-template-columns: auto minmax(0, 1fr);
}
.ai-run-checks > div > span {
  display: grid;
}
.ai-run-checks .is-pass > svg {
  color: var(--state-success);
}
.ai-run-checks .is-fail > svg {
  color: var(--state-danger);
}
.ai-run-empty {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.8125rem;
}
.ai-run-body > footer {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ai-run-body > footer span,
.ai-run-body > footer code {
  padding: 5px 7px;
  border-radius: 6px;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.8125rem;
  background: var(--bg-elevated);
}
@media (max-width: 560px) {
  .ai-control-quality {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ai-control-capability {
    grid-template-columns: minmax(0, 1fr);
  }
  .ai-control-mode {
    justify-self: start;
  }
  .ai-control-allowance-summary {
    display: grid;
  }
  .ai-control-allowance-summary span {
    flex: initial;
  }
  .ai-control-allowance-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ai-control-provider-totals,
  .ai-control-provider-limits,
  .ai-control-provider-switches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ai-control-provider-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .ai-control-intelligence-action {
    flex-direction: column;
  }
  .ai-control-intelligence-action button {
    min-height: 42px;
  }
  .ai-control-provider-actions button {
    width: 100%;
  }
  .ai-run-modal {
    align-items: end;
    padding: 0;
  }
  .ai-run-inspector {
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
  }
}
.is-spinning {
  animation: ai-control-spin 0.8s linear infinite;
}

@keyframes ai-control-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes ai-control-signal {
  from { transform: scaleY(0.62); opacity: 0.45; }
  to { transform: scaleY(1); opacity: 0.95; }
}
@keyframes ai-control-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-agent-deck-live svg,
  .ai-agent-state,
  .ai-control-signal i,
  .is-spinning {
    animation: none !important;
  }
}

/* ── Stavros memory library v2 ──────────────────────────────────────────────
   Responsive web + Capacitor iOS share this component and these tokens. */
.aiops-memory {
  background:
    radial-gradient(circle at 88% 2%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 24rem),
    var(--bg-base);
}
.aiops-memory-head {
  min-height: 68px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(18px);
}
.aiops-memory-head > span {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.aiops-memory-head-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
  border-radius: 13px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated));
  box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 12%, transparent);
}
.aiops-memory-head small {
  display: block;
  margin-bottom: 1px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.aiops-memory-head h3 {
  font-size: 17px;
  letter-spacing: -0.02em;
}
.aiops-memory-done {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: var(--surface-muted);
}
.aiops-memory-health {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 14px 8px;
}
.aiops-memory-health > span {
  display: grid;
  gap: 2px;
  min-height: 62px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
}
.aiops-memory-health strong {
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.aiops-memory-health small {
  color: var(--text-muted);
  font-size: 11px;
}
.aiops-memory-health .is-attention {
  border-color: color-mix(in srgb, var(--state-warning) 34%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 8%, var(--bg-elevated));
}
.aiops-memory-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px 14px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.aiops-memory-tabs button {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.aiops-memory-tabs button:hover {
  color: var(--text-primary);
  background: var(--surface-muted);
}
.aiops-memory-tabs button.is-selected {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.aiops-memory-tabs i {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  color: var(--bg-base);
  background: var(--state-warning);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
.aiops-memory-skeleton {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.aiops-memory-skeleton i {
  position: relative;
  min-height: 160px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: var(--bg-elevated);
}
.aiops-memory-skeleton i::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text-primary) 7%, transparent), transparent);
  animation: aiops-memory-shimmer 1.45s ease-in-out infinite;
}
.aiops-memory-empty {
  display: grid;
  max-width: 390px;
  margin: auto;
  padding: 36px 24px;
  place-items: center;
  text-align: center;
}
.aiops-memory-empty > span {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 15px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.aiops-memory-empty strong {
  color: var(--text-primary);
  font-size: 15px;
}
.aiops-memory-empty p {
  margin: 7px 0 16px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.aiops-memory-empty button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}
.aiops-mem-list {
  gap: 10px;
  padding: 14px 14px 24px;
}
.aiops-mem-item {
  display: grid;
  gap: 11px;
  padding: 14px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--bg-elevated) 96%, var(--accent)), var(--bg-elevated));
  box-shadow: 0 10px 30px color-mix(in srgb, #000 8%, transparent);
}
.aiops-mem-item.pinned {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
}
.aiops-mem-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--accent);
}
.aiops-mem-class,
.aiops-mem-trust {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.025em;
}
.aiops-mem-class {
  padding: 5px 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  text-transform: uppercase;
}
.aiops-mem-class.is-operational {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 11%, transparent);
}
.aiops-mem-class.is-episodic {
  color: var(--text-soft);
  background: var(--surface-muted);
}
.aiops-mem-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.aiops-mem-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--text-muted);
  font-size: 10.5px;
}
.aiops-mem-trust {
  color: var(--state-success);
}
.aiops-mem-trust.is-guest_reported,
.aiops-mem-trust.is-unverified {
  color: var(--state-warning);
}
.aiops-mem-trust.is-disputed {
  color: var(--state-error);
}
.aiops-mem-meta .is-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--state-warning);
  font-weight: 650;
}
.aiops-mem-meta .is-review {
  color: var(--state-warning);
  font-weight: 650;
}
.aiops-mem-source {
  display: flex;
  min-height: 31px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 10.5px;
}
.aiops-mem-source span,
.aiops-mem-source a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.aiops-mem-source a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
}
.aiops-mem-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.aiops-mem-actions button,
.aiops-mem-confirm button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  color: var(--text-soft);
  background: var(--surface-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
/* The row actions are the affordance Hakim ringed, so their glyphs are 18px and
   must not flex-shrink when the row wraps tight (TestFlight #52). */
.aiops-mem-actions button > svg,
.aiops-mem-confirm button > svg {
  flex: 0 0 auto;
}
.aiops-mem-actions button:hover,
.aiops-mem-confirm button:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.aiops-mem-actions button.is-primary {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.aiops-mem-actions button.is-danger {
  margin-left: auto;
}
.aiops-mem-actions button.is-danger:hover {
  color: var(--state-error);
  background: color-mix(in srgb, var(--state-error) 8%, transparent);
}
.aiops-mem-actions button:disabled,
.aiops-mem-confirm button:disabled {
  cursor: wait;
  opacity: 0.55;
}
.aiops-mem-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--state-error) 32%, var(--border-subtle));
  border-radius: 12px;
  background: color-mix(in srgb, var(--state-error) 7%, transparent);
}
.aiops-mem-confirm span {
  display: grid;
  gap: 2px;
}
.aiops-mem-confirm strong {
  color: var(--text-primary);
  font-size: 11.5px;
}
.aiops-mem-confirm small {
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.35;
}
.aiops-mem-confirm button:first-of-type {
  color: var(--state-error);
}
@keyframes aiops-memory-shimmer {
  to { transform: translateX(100%); }
}
@media (max-width: 560px) {
  .aiops-memory-head {
    padding-inline: 14px;
  }
  .aiops-memory-health,
  .aiops-memory-tabs,
  .aiops-mem-list {
    padding-inline: 12px;
  }
  .aiops-memory-health > span {
    padding: 9px;
  }
  .aiops-memory-health strong {
    font-size: 18px;
  }
  .aiops-memory-health small {
    font-size: 9.5px;
  }
  .aiops-mem-confirm {
    grid-template-columns: 1fr 1fr;
  }
  .aiops-mem-confirm span {
    grid-column: 1 / -1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .aiops-memory-skeleton i::after {
    animation: none;
  }
}

.memory-capture-overlay {
  position: fixed;
  z-index: 10050;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: color-mix(in srgb, #050509 68%, transparent);
  backdrop-filter: blur(8px);
}
.memory-capture {
  display: grid;
  width: min(580px, 100%);
  max-height: min(820px, calc(100dvh - 36px));
  overflow-y: auto;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 22px;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 90% 0, color-mix(in srgb, var(--accent) 12%, transparent), transparent 25rem),
    var(--bg-elevated);
  box-shadow: 0 32px 90px color-mix(in srgb, #000 48%, transparent);
}
.memory-capture > header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-elevated) 90%, transparent);
  backdrop-filter: blur(18px);
}
.memory-capture > header > span {
  display: flex;
  align-items: center;
  gap: 11px;
}
.memory-capture > header h2 {
  margin: 1px 0 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}
.memory-capture > header small {
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.memory-capture > header > button,
.memory-capture-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  color: var(--text-soft);
  background: var(--surface-muted);
}
.memory-capture > header > button {
  cursor: pointer;
}
.memory-capture-mark {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.memory-capture-loading {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 30px;
  color: var(--text-muted);
  font-size: 12px;
}
.memory-capture-source {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 16px 0;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--state-success) 30%, var(--border-subtle));
  border-radius: 13px;
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 7%, transparent);
}
.memory-capture-source > span {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}
.memory-capture-source strong {
  color: var(--text-primary);
  font-size: 11.5px;
}
.memory-capture-source small {
  color: var(--text-muted);
  font-size: 9.5px;
}
.memory-capture-source a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
}
.memory-capture-copy,
.memory-capture-select {
  display: grid;
  gap: 7px;
  margin: 14px 16px 0;
}
.memory-capture-copy > span,
.memory-capture-select > span,
.memory-capture-choice legend,
.memory-capture-grid legend {
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 700;
}
.memory-capture-copy textarea,
.memory-capture-select select {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  outline: none;
  color: var(--text-primary);
  background: var(--bg-base);
  font: inherit;
  font-size: 13px;
}
.memory-capture-copy textarea {
  min-height: 104px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}
.memory-capture-select select {
  min-height: 46px;
  padding: 0 11px;
}
.memory-capture-copy textarea:focus,
.memory-capture-select select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.memory-capture-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 16px 0;
  padding: 0;
  border: 0;
}
.memory-capture-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 7px;
}
.memory-capture-choice button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 78px;
  align-items: start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  color: var(--text-muted);
  text-align: left;
  background: var(--bg-base);
  cursor: pointer;
}
.memory-capture-choice button.is-selected {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border-subtle));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-base));
}
.memory-capture-choice button span {
  display: grid;
  gap: 3px;
}
.memory-capture-choice button strong {
  color: var(--text-primary);
  font-size: 11.5px;
}
.memory-capture-choice button small {
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.35;
}
.memory-capture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 16px 0;
}
.memory-capture-grid fieldset {
  display: grid;
  gap: 6px;
  padding: 0;
  border: 0;
}
.memory-capture-grid legend {
  margin-bottom: 6px;
}
.memory-capture-grid button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  color: var(--text-muted);
  text-align: left;
  background: var(--surface-muted);
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}
.memory-capture-grid button.is-selected {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.memory-capture-review-note {
  margin: 12px 16px 0;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.memory-capture-error {
  margin: 12px 16px 0;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--state-error);
  background: color-mix(in srgb, var(--state-error) 8%, transparent);
  font-size: 10.5px;
}
.memory-capture > footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(18px);
}
.memory-capture > footer button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  color: var(--text-soft);
  background: var(--surface-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.memory-capture > footer button.is-primary {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}
.memory-capture > footer button:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* Control-room quality sampling and memory metrics. */
.ai-control-quality > p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.ai-control-quality[data-state="no_sample"] > p {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 7%, var(--bg-elevated));
}
.ai-control-memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.ai-control-memory-grid > span {
  display: grid;
  min-height: 70px;
  align-content: center;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: var(--surface-muted);
}
.ai-control-memory-grid strong {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.ai-control-memory-grid small {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.ai-control-memory-grid .is-attention {
  border-color: color-mix(in srgb, var(--state-warning) 35%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 8%, var(--surface-muted));
}
@media (max-width: 560px) {
  .memory-capture-overlay {
    align-items: end;
    padding: 0;
  }
  .memory-capture {
    max-height: 94dvh;
    border-radius: 22px 22px 0 0;
  }
  .memory-capture-choice,
  .memory-capture-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .memory-capture-source a {
    display: none;
  }
  .ai-control-memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Stavros proactive + action experience (2026-07-26) ─────────────────────
   One responsive component tree serves desktop, narrow web and the Capacitor
   iOS shell. Motion reflects real run state and collapses under reduced motion. */

.aiops-approvals {
  display: grid;
  gap: 18px;
  padding-bottom: 16px;
}
.aiops-approval-section,
.aiops-attention-section {
  display: grid;
  gap: 9px;
}
.aiops-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 2px 0;
}
.aiops-section-head > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.aiops-section-head strong {
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 750;
}
.aiops-section-head small {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
}
.aiops-section-count {
  display: grid;
  min-width: 23px;
  height: 23px;
  margin-left: auto;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 750;
}
.aiops-action-list {
  display: grid;
  gap: 9px;
}
.aiops-proposal-target {
  border-radius: 15px;
  outline: none;
  scroll-margin-block: 12px;
}
.aiops-proposal-target.is-focused .ai-action-card {
  border-color: color-mix(in srgb, var(--accent) 72%, var(--border-strong));
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent),
    inset 0 1px color-mix(in srgb, white 5%, transparent);
}
.aiops-section-empty {
  padding: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-muted) 55%, transparent);
  font-size: 11.5px;
  line-height: 1.5;
}

/* Clean schedules are operational state, not chat content. The planner stays
   quiet until it has a guarded proposal, then presents one compact line beside
   the Tasks/Calendar work it would change. The detailed plan is the existing
   approval surface and only occupies space after a person opens it. */
.clean-schedule-decision {
  position: relative;
  z-index: 18;
  display: grid;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-elevated) 96%, var(--accent) 4%);
  box-shadow: 0 8px 24px color-mix(in srgb, #000 20%, transparent);
}
.clean-schedule-decision.is-tasks {
  margin: -3px 0 0;
}
.clean-schedule-decision.is-phone {
  margin: 8px 12px 4px;
  border-radius: 15px;
}
.clean-schedule-decision-bar {
  display: flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 0;
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.clean-schedule-decision-bar:hover {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.clean-schedule-decision-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 12%, transparent);
}
.clean-schedule-decision-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: baseline;
  gap: 8px;
}
.clean-schedule-decision-copy strong {
  flex: none;
  font-size: 11.5px;
}
.clean-schedule-decision-copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clean-schedule-decision-action {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 750;
}
.clean-schedule-decision-panel {
  max-height: min(62vh, 680px);
  padding: 0 8px 8px;
  overflow: auto;
  border-top: 1px solid var(--border-subtle);
}
.clean-schedule-decision-panel > .ai-action-card {
  margin-top: 8px;
  border-radius: 10px;
  box-shadow: none;
}
.clean-schedule-decision-loading {
  margin-top: 8px;
  padding: 18px;
  border-radius: 10px;
  color: var(--text-muted);
  background: var(--surface-muted);
  font-size: 11px;
  text-align: center;
}

.ai-action-card {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 11px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 14px;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%),
    color-mix(in srgb, var(--bg-elevated) 94%, var(--surface-muted));
  box-shadow: inset 0 1px color-mix(in srgb, white 5%, transparent);
}
.ai-action-card.is-compact {
  gap: 10px;
  padding: 11px;
  border-color: color-mix(
    in srgb,
    var(--state-success) 34%,
    var(--border-subtle)
  );
  background: color-mix(
    in srgb,
    var(--state-success) 6%,
    var(--bg-elevated)
  );
  box-shadow: none;
}
.ai-action-card.is-compact .ai-action-quote {
  padding: 10px 11px;
  font-size: 12.5px;
}
.ai-action-card.is-compact .ai-action-destination {
  color: var(--text-soft);
  font-size: 10.5px;
}
.ai-action-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ai-action-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.ai-action-head > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.ai-action-head strong {
  color: var(--text-primary);
  font-size: 11.5px;
}
.ai-action-head small {
  color: var(--text-muted);
  font-size: 9.5px;
}
.ai-action-gate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 8.5px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ai-action-body {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 74%, transparent);
}
.ai-action-body strong {
  font-size: 12.5px;
}
.ai-action-body p {
  margin: 0;
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.45;
}
.ai-action-details {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.ai-action-details > span:first-child {
  display: grid;
  width: 29px;
  height: 29px;
  flex: none;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.ai-action-details > span:last-child {
  display: grid;
  gap: 2px;
}
.ai-action-details strong {
  color: var(--text-primary);
  font-size: 11px;
}
.ai-action-details small {
  color: var(--text-muted);
  font-size: 9.5px;
  line-height: 1.35;
}
.ai-clean-plan { display: grid; gap: 9px; }
.ai-clean-plan-proof {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--state-success) 28%, var(--border-subtle));
  border-radius: 9px;
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 7%, transparent);
}
.ai-clean-plan-proof > svg { flex: none; margin-top: 1px; }
.ai-clean-plan-proof > span { display: grid; gap: 2px; min-width: 0; }
.ai-clean-plan-proof strong { color: var(--text-primary); font-size: 12px; }
.ai-clean-plan-proof small { color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.ai-clean-plan-proof .ai-clean-plan-attribution {
  color: #fff;
  font-family: Roboto, sans-serif;
  font-style: normal;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  white-space: nowrap;
}
[data-theme="light"] .ai-clean-plan-proof .ai-clean-plan-attribution { color: #5e5e5e; }
.ai-clean-plan-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.ai-clean-plan-metrics > span {
  display: grid;
  gap: 1px;
  padding: 7px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-muted) 75%, transparent);
}
.ai-clean-plan-metrics strong { font-size: 13px; }
.ai-clean-plan-metrics small { overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ai-clean-plan-groups { display: grid; gap: 7px; }
.ai-clean-plan-group {
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 55%, transparent);
}
.ai-clean-plan-group > header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
}
.ai-clean-plan-group > header > span { display: inline-flex; min-width: 0; align-items: center; gap: 5px; }
.ai-clean-plan-group > header strong { overflow: hidden; color: var(--text-primary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ai-clean-plan-group ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.ai-clean-plan-group li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 9px;
}
.ai-clean-plan-group li + li { border-top: 1px solid var(--border-subtle); }
.ai-clean-plan-position {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 10px;
  font-weight: 800;
}
.ai-clean-plan-task { display: grid; min-width: 0; gap: 2px; }
.ai-clean-plan-task > strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ai-clean-plan-task > small { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; overflow-wrap: anywhere; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.ai-clean-plan-move {
  width: fit-content;
  margin-top: 3px;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 10%, transparent);
  font-size: 10.5px;
  font-weight: 700;
}
.ai-clean-plan-move.is-potential_sellable_loss { color: var(--state-danger); background: color-mix(in srgb, var(--state-danger) 10%, transparent); }
.ai-clean-plan-move.is-unknown_sellability { color: var(--state-warning); background: color-mix(in srgb, var(--state-warning) 11%, transparent); }
.ai-clean-plan-unassigned {
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--state-danger) 28%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--state-danger) 6%, transparent);
}
.ai-clean-plan-unassigned > strong { display: flex; align-items: center; gap: 5px; color: var(--state-danger); font-size: 11.5px; }
.ai-clean-plan-unassigned.is-outside-plan {
  border-color: color-mix(in srgb, var(--text-muted) 28%, var(--border-subtle));
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
}
.ai-clean-plan-unassigned.is-outside-plan > strong { color: var(--text-soft); }
.ai-clean-plan-unassigned ul,
.ai-clean-plan-warnings ul { margin: 0; padding-left: 17px; color: var(--text-soft); font-size: 11px; line-height: 1.45; }
.ai-clean-plan-warnings { padding: 0 2px; }
.ai-clean-plan-warnings summary { cursor: pointer; color: var(--text-muted); font-size: 11px; font-weight: 700; }
.ai-clean-plan-warnings ul { margin-top: 6px; }
.ai-action-change-set {
  display: grid;
  gap: 7px;
  max-height: 420px;
  padding: 9px 10px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 58%, transparent);
}
.ai-action-change-set > strong {
  font-size: 11px;
}
.ai-action-change-set ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 18px;
}
.ai-action-change-set li {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.ai-action-change-set li > strong {
  font-size: 10.5px;
}
.ai-action-change-set li > span {
  color: var(--text-muted);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ai-action-change-set code {
  display: block;
  max-height: 150px;
  padding: 6px 7px;
  overflow: auto;
  border-radius: 7px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--bg-deep) 76%, transparent);
  font: 10px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ai-action-quote {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid color-mix(in srgb, var(--accent) 58%, transparent);
  border-radius: 0 9px 9px 0;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-primary) 4%, transparent);
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.ai-action-destination,
.ai-action-provenance {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}
.ai-action-destination svg,
.ai-action-provenance svg {
  flex: none;
}
.ai-action-buttons {
  display: flex;
  gap: 7px;
}
.ai-action-approve,
.ai-action-reject {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.ai-action-approve {
  flex: 1;
  border: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 20%, transparent);
}
.ai-action-reject {
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  background: transparent;
}
.ai-action-approve:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
}
.ai-action-reject:hover {
  color: var(--text-primary);
  background: var(--surface-muted);
}
.ai-action-approve:disabled,
.ai-action-reject:disabled {
  cursor: wait;
  opacity: 0.58;
}
.ai-action-error {
  margin: 0;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--state-danger);
  background: color-mix(in srgb, var(--state-danger) 9%, transparent);
  font-size: 10.5px;
}
.ai-action-receipt {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--state-success) 30%, var(--border-subtle));
  border-radius: 10px;
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 8%, transparent);
}
.ai-action-receipt > span {
  display: grid;
  gap: 2px;
}
.ai-action-receipt strong {
  font-size: 11.5px;
}
.ai-action-receipt small {
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 700px) {
  .clean-schedule-decision.is-tasks,
  .clean-schedule-decision.is-calendar,
  .clean-schedule-decision.is-phone {
    margin: 7px 10px 4px;
  }
  .clean-schedule-decision-bar {
    min-height: 48px;
    padding: 7px 9px;
  }
  .clean-schedule-decision-copy {
    display: grid;
    gap: 1px;
  }
  .clean-schedule-decision-copy strong { font-size: 13px; }
  .clean-schedule-decision-copy small { font-size: 11px; }
  .clean-schedule-decision-action > svg { display: none; }
  .clean-schedule-decision-panel {
    max-height: none;
    padding: 0 7px 7px;
  }
  .ai-action-card { gap: 10px; padding: 10px; border-radius: 13px; }
  .ai-action-head { align-items: flex-start; }
  .ai-action-head strong { font-size: 13px; }
  .ai-action-head small { font-size: 11px; }
  .ai-action-gate { margin-top: 2px; }
  .ai-action-body strong { font-size: 14px; }
  .ai-action-body p { font-size: 12px; }
  .ai-clean-plan-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-clean-plan-metrics > span { min-height: 48px; justify-content: center; }
  .ai-clean-plan-metrics strong { font-size: 15px; }
  .ai-clean-plan-metrics small { font-size: 11px; }
  .ai-clean-plan-proof strong,
  .ai-clean-plan-group > header strong,
  .ai-clean-plan-task > strong { font-size: 13px; }
  .ai-clean-plan-proof small,
  .ai-clean-plan-group > header,
  .ai-clean-plan-task > small,
  .ai-clean-plan-unassigned ul,
  .ai-clean-plan-warnings summary,
  .ai-clean-plan-warnings ul { font-size: 12px; }
  .ai-clean-plan-group li { grid-template-columns: 28px minmax(0, 1fr); padding: 10px; }
  .ai-clean-plan-group > header { align-items: flex-start; }
  .ai-clean-plan-group > header > span:last-child { width: 100%; }
  .ai-clean-plan-position { width: 26px; height: 26px; font-size: 10px; }
  .ai-action-buttons { position: sticky; bottom: 0; z-index: 2; padding-top: 3px; background: var(--bg-elevated); }
  .ai-action-approve,
  .ai-action-reject { min-height: 44px; font-size: 12px; }
}

.ai-context-dock {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
}
.ai-context-loading {
  position: relative;
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 11px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  border-radius: 16px;
  color: var(--text-primary);
  background: var(--bg-elevated);
}
.ai-context-loading::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 22%,
    color-mix(in srgb, var(--accent) 10%, transparent) 46%,
    transparent 70%
  );
  content: "";
  transform: translateX(-100%);
  animation: ai-context-shimmer 1.35s ease-in-out infinite;
  pointer-events: none;
}
.ai-context-loading-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.ai-context-loading > span:last-child {
  display: grid;
  gap: 3px;
}
.ai-context-loading strong {
  font-size: 13px;
}
.ai-context-loading small {
  color: var(--text-muted);
  font-size: 11px;
}
@keyframes ai-context-shimmer {
  to {
    transform: translateX(100%);
  }
}
.ai-context-chip {
  display: grid;
  width: 100%;
  min-height: 52px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 40px 9px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 12px;
  color: var(--text-primary);
  text-align: left;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--accent) 10%, var(--bg-elevated)), var(--bg-elevated));
  cursor: pointer;
}
.ai-context-chip > svg {
  color: var(--accent);
}
.ai-context-chip > span:nth-child(2) {
  display: grid;
  min-width: 0;
}
.ai-context-chip strong {
  font-size: 12.5px;
}
.ai-context-chip small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-context-chip-action {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}
.ai-context-chip-dismiss {
  position: absolute;
  top: 12px;
  right: 7px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}
.ai-context-chip-dismiss:hover {
  color: var(--text-primary);
  background: var(--surface-muted);
}
.ai-context-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-subtle));
  border-radius: 16px;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 10%, transparent), transparent 42%),
    var(--bg-elevated);
  box-shadow: 0 8px 24px color-mix(in srgb, #000 10%, transparent);
}
.ai-context-card[data-risk="critical"] {
  border-color: color-mix(in srgb, var(--state-danger) 42%, var(--border-subtle));
}
.ai-context-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.ai-context-mark {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.ai-context-heading {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.ai-context-heading strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.3;
}
.ai-context-heading small {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
}
.ai-context-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.ai-context-head-actions button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}
.ai-context-head-actions button:hover {
  color: var(--text-primary);
  background: var(--surface-muted);
}
.ai-context-summary {
  margin: 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
  font-size: 12.5px;
  line-height: 1.45;
}
.ai-context-request {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 10px 11px;
  border: 1px solid var(--border-subtle);
  border-left: 3px solid color-mix(in srgb, var(--accent) 62%, transparent);
  border-radius: 10px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ai-context-request span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ai-context-latest {
  min-width: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-soft);
  background: color-mix(in srgb, var(--surface-muted) 60%, transparent);
}
.ai-context-latest summary {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  font-size: 11.5px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.ai-context-latest summary::-webkit-details-marker {
  display: none;
}
.ai-context-latest[open] summary > svg {
  transform: rotate(180deg);
}
.ai-context-latest p {
  display: -webkit-box;
  margin: 0;
  padding: 0 9px 9px;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}
.ai-context-outcome {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface-muted) 62%, transparent);
}
.ai-context-outcome > svg {
  flex: none;
  margin-top: 1px;
}
.ai-context-outcome > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.ai-context-outcome strong {
  font-size: 13.5px;
}
.ai-context-outcome small {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}
.ai-context-outcome.is-ready {
  border-color: color-mix(in srgb, var(--state-success) 30%, var(--border-subtle));
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 8%, var(--bg-elevated));
}
.ai-context-outcome.is-blocked {
  border-color: color-mix(in srgb, var(--state-warning) 30%, var(--border-subtle));
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 7%, var(--bg-elevated));
}
.ai-context-actions {
  display: grid;
  gap: 7px;
}
.ai-context-actions button,
.ai-context-actions a {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text-soft);
  text-align: left;
  text-decoration: none;
  background: transparent;
  font: inherit;
  overflow-wrap: anywhere;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.ai-context-actions button.is-primary,
.ai-context-actions a.is-primary {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
  color: #fff;
  background: var(--accent);
}
.ai-context-actions button:hover,
.ai-context-actions a:hover {
  color: var(--text-primary);
  background: var(--surface-muted);
}
.ai-context-actions button.is-primary:hover,
.ai-context-actions a.is-primary:hover {
  color: #fff;
  background: color-mix(in srgb, var(--accent) 88%, #000);
}
.ai-context-actions button:disabled {
  opacity: 0.65;
  cursor: wait;
}
.ai-context-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 10px;
  border-radius: 9px;
  color: var(--state-danger);
  background: color-mix(in srgb, var(--state-danger) 9%, transparent);
  font-size: 11.5px;
  line-height: 1.4;
}
.ai-context-error svg {
  flex: none;
  margin-top: 1px;
}
.ai-context-evidence {
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}
.ai-context-evidence summary {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.ai-context-evidence summary::-webkit-details-marker {
  display: none;
}
.ai-context-evidence summary span {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}
.ai-context-evidence[open] summary > svg:last-child {
  transform: rotate(180deg);
}
.ai-context-sources {
  display: grid;
  gap: 6px;
  padding-top: 9px;
}
.ai-context-source {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-primary);
  text-decoration: none;
  background: color-mix(in srgb, var(--surface-muted) 62%, transparent);
}
.ai-context-source:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}
.ai-context-source > span {
  display: grid;
  min-width: 0;
  flex: 1;
}
.ai-context-source strong,
.ai-context-source small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-context-source strong {
  font-size: 12.5px;
}
.ai-context-source small {
  color: var(--text-muted);
  font-size: 11px;
}
.ai-context-source > svg {
  flex: none;
  color: var(--text-muted);
}
.ai-context-checked {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
}
.ai-context-checked span {
  margin-left: auto;
  text-align: right;
}
.ai-context-previous {
  justify-self: start;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}

.ai-rich-response {
  position: relative;
  min-width: 0;
}
.ai-rich-response-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -3px -4px 8px;
  padding: 2px 4px 7px;
  border-bottom: 1px solid var(--border-subtle);
}
.ai-rich-response-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.ai-rich-response[data-review] .ai-rich-response-icon {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 12%, transparent);
}
.ai-rich-response-title {
  color: var(--text-primary);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ai-rich-response-signals {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  overflow: hidden;
}
.ai-rich-response-signals > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-muted) 78%, transparent);
  font-size: 8px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-rich-response .aiops-md-head {
  margin: 10px 0 5px;
  color: var(--text-primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.ai-rich-response .aiops-md ul,
.ai-rich-response .aiops-md ol {
  display: grid;
  gap: 5px;
  padding: 0;
  list-style: none;
}
.ai-rich-response .aiops-md li {
  position: relative;
  margin: 0;
  padding: 7px 8px 7px 23px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-muted) 64%, transparent);
}
.ai-rich-response .aiops-md li::before {
  position: absolute;
  top: 11px;
  left: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.ai-run-progress {
  position: relative;
  align-self: stretch;
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 27%, var(--border-subtle));
  border-radius: 14px;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 100% 0, color-mix(in srgb, var(--accent) 9%, transparent), transparent 42%),
    color-mix(in srgb, var(--bg-elevated) 94%, var(--surface-muted));
}
.ai-run-progress::after,
.ai-rich-response[data-streaming]::after {
  position: absolute;
  inset: 0;
  transform: translateX(-120%);
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 20%,
    color-mix(in srgb, white 3%, transparent) 38%,
    color-mix(in srgb, var(--accent) 12%, transparent) 50%,
    color-mix(in srgb, white 3%, transparent) 62%,
    transparent 80%
  );
  animation: ai-stavros-shimmer 1.8s ease-in-out infinite;
  content: "";
}
.ai-rich-response[data-streaming] {
  overflow: hidden;
}
@keyframes ai-stavros-shimmer {
  to {
    transform: translateX(120%);
  }
}
.ai-run-progress-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-run-progress-glyph {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}
.ai-run-progress-head > span:nth-child(2) {
  display: grid;
  min-width: 0;
}
.ai-run-progress-head strong {
  font-size: 13px;
}
.ai-run-progress-head small {
  color: var(--text-muted);
  font-size: 11px;
}
.ai-run-progress-live {
  margin-left: auto;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ai-run-progress-steps {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
}
.ai-run-step {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-muted) 70%, transparent);
}
.ai-run-step[data-state="active"] {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  color: var(--accent);
}
.ai-run-step[data-state="done"] {
  color: var(--state-success);
}
.ai-run-step > span {
  display: grid;
}
.ai-run-step strong {
  color: var(--text-primary);
  font-size: 12px;
}
.ai-run-step small {
  color: var(--text-muted);
  font-size: 10.5px;
}
.ai-run-progress .ai-agent-deck {
  position: relative;
  z-index: 1;
  margin-top: 0;
}

@media (max-width: 560px) {
  .ai-context-dock {
    width: auto;
  }
  .ai-context-actions {
    grid-template-columns: 1fr;
  }
  .ai-rich-response-signals > span:nth-child(n + 2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-context-loading::after,
  .ai-run-progress::after,
  .ai-rich-response[data-streaming]::after {
    transform: none;
    animation: none !important;
    background: color-mix(in srgb, var(--accent) 4%, transparent);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phone calendar — tasks on the grid (2026-07-26)

   Hakim: "Tasks currently aren't even showing on the phone calendar which
   totally defeats the point … The phone also doesn't have the task bar at the
   top above the listings for tasks unassociated to a listing."

   Geometry contract, shared with phone-calendar-row-layout.ts:
     - focused inventory keeps a 56px band; mixed Overview passes a 42px inline
       height so inventory and lower-edge work fit one 64px property row;
     - stay and block bars centre inside the inventory band. Do not give it a
       percentage height;
     - Task chips are absolutely positioned by the component, which owns lane
       packing. CSS only styles them.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The day header and the unassigned bar stick to the top of the pan as one
   block — the header's height is content-driven, so the bar cannot be given a
   fixed sticky offset of its own. */
.ph-cal-stickyhead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ph-bg);
}
.ph-cal-stayband {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
}

/* ---- The unassigned-task bar ---- */
.ph-cal-unassigned {
  display: flex;
  border-bottom: 1px solid var(--ph-hairline);
  background: var(--ph-bg);
}
.ph-cal-unassigned-label {
  position: sticky;
  left: 0;
  z-index: 6;
  width: var(--ph-prop-col, 128px);
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 6px 0 10px;
  border: 0;
  border-right: 1px solid var(--ph-hairline);
  /* This is a grid label, not a filter control. Task status belongs in the
     labelled Calendar filters so nobody has to guess that No property is a
     hidden toggle. */
  border-radius: 0;
  background: var(--ph-bg);
  color: var(--ph-text-2);
  font: inherit;
  text-align: left;
}
.ph-cal-unassigned-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ph-cal-unassigned[data-lane-kind="calendar"] .ph-cal-unassigned-title svg {
  color: var(--ph-cal-lane-color, var(--ph-accent-soft));
}
.ph-cal-unassigned-count {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  color: var(--ph-text-2);
  opacity: 0.75;
}

/* Native Staff coverage is a pinned operational summary, not a synthetic
   property. It shares the exact day-width contract with every phone Calendar
   row and opens the dedicated Staff schedule for editing. */
.ph-cal-staff-summary {
  display: flex;
  height: 42px;
  border-bottom: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
  background: color-mix(in srgb, var(--ph-accent-wash) 32%, var(--ph-bg));
}
.ph-cal-staff-summary-label {
  position: sticky;
  left: 0;
  z-index: 6;
  width: var(--ph-prop-col, 128px);
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 6px 0 10px;
  border: 0;
  border-right: 1px solid var(--ph-cal-grid-line-strong, var(--ph-hairline));
  border-radius: 0;
  background: color-mix(in srgb, var(--ph-accent-wash) 44%, var(--ph-bg));
  color: var(--ph-text);
  font: inherit;
  text-align: left;
}
.ph-cal-staff-summary-title {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
}
.ph-cal-staff-summary-title svg {
  flex: none;
  color: var(--ph-accent-soft);
}
.ph-cal-staff-summary-count {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ph-text-2);
  font-size: 9px;
  font-weight: 650;
}
.ph-cal-staff-summary-track,
[data-theme="light"] .ph-cal-staff-summary-track {
  position: relative;
  flex: none;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 calc(var(--ph-dayw, 46px) - 1px),
    var(--ph-cal-grid-line, var(--ph-hairline)) calc(var(--ph-dayw, 46px) - 1px) var(--ph-dayw, 46px)
  );
}
.ph-cal-sticky-past {
  position: absolute;
  inset-block: 0;
  left: 0;
  z-index: 3;
  background: color-mix(in srgb, #111318 32%, transparent);
  -webkit-backdrop-filter: grayscale(0.82) saturate(0.32) brightness(0.86);
  backdrop-filter: grayscale(0.82) saturate(0.32) brightness(0.86);
  pointer-events: none;
}
[data-theme="light"] .ph-cal-sticky-past {
  background: color-mix(in srgb, #eef0f3 42%, transparent);
  -webkit-backdrop-filter: grayscale(0.82) saturate(0.3) brightness(0.99);
  backdrop-filter: grayscale(0.82) saturate(0.3) brightness(0.99);
}
.ph-cal-sticky-now {
  position: absolute;
  inset-block: 0;
  z-index: 4;
  width: 2px;
  background: #f59e0b;
  pointer-events: none;
}
.ph-cal-staff-summary-day {
  position: absolute;
  inset-block: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 0;
  border-right: 1px solid var(--ph-cal-grid-line, var(--ph-hairline));
  border-radius: 0;
  background: transparent;
  color: var(--ph-text-2);
  font: inherit;
}
.ph-cal-staff-summary-day:active {
  background: var(--ph-accent-wash);
}
.ph-cal-staff-summary-primary {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow: hidden;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ph-cal-staff-summary-primary > strong {
  color: #22c55e;
  font-size: 11px;
  font-weight: 850;
}
.ph-cal-staff-summary-primary > small {
  max-width: 100%;
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 7.5px;
  font-weight: 760;
  letter-spacing: -0.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-cal-staff-summary-day[data-state="assigned"] .ph-cal-staff-summary-primary > strong {
  color: #3b82f6;
}
.ph-cal-staff-summary-day[data-state="away"] .ph-cal-staff-summary-primary > strong {
  color: #a855f7;
}
.ph-cal-staff-summary-day[data-state="uncovered"] .ph-cal-staff-summary-primary > strong {
  color: #f59e0b;
}
.ph-cal-staff-summary-day[data-state="event"] .ph-cal-staff-summary-primary > strong {
  color: #8b7cf6;
}
.ph-cal-staff-summary-empty {
  color: var(--ph-text-2);
  font-size: 11px;
  opacity: 0.45;
}
.ph-cal-canvas[data-zoom-stage="compact"] .ph-cal-staff-summary-primary {
  transform: scale(0.92);
}
/* The lane's own track drops the weekend wash — at 28px tall the stripes read
   as noise rather than structure. Day separators stay. */
.ph-cal-track.is-lane,
[data-theme="light"] .ph-cal-track.is-lane {
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0 calc(var(--ph-dayw, 46px) - 1px),
    var(--ph-cal-grid-line, var(--ph-hairline)) calc(var(--ph-dayw, 46px) - 1px) var(--ph-dayw, 46px)
  );
}
.ph-cal-lane-empty {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--ph-text-2);
  opacity: 0.5;
  white-space: nowrap;
}

/* "+3" on the property cell when a row has more tasks than lanes to draw them
   in. A capped row must SAY it is capped — a silently dropped task reads as a
   task that does not exist. */
.ph-cal-prop2-more {
  position: absolute;
  right: 5px;
  bottom: 4px;
  flex: none;
  margin: 0;
  padding: 1px 4px;
  border-radius: 6px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  font-size: 9px;
  font-weight: 800;
}

/* ---- The task chip ---- */
.ph-cal-task {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 5px;
  border: 0;
  border-left: 2px solid var(--ph-task-tint, var(--ph-accent-soft));
  border-radius: 4px;
  background: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 22%, transparent);
  color: var(--ph-text);
  font: inherit;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.16s;
}
[data-theme="light"] .ph-cal-task {
  background: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 15%, transparent);
}
/* A Clean's start/due pair is a scheduling window, not work duration. */
.ph-cal-task[data-time-geometry="window"] {
  border: 1px solid color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 42%, transparent);
  border-left: 3px solid var(--ph-task-tint, var(--ph-accent-soft));
  border-radius: 6px;
  background: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 20%, transparent);
}
.ph-cal-task[data-overview-marker="true"],
.ph-cal-event[data-overview-marker="true"] {
  justify-content: center;
  padding-inline: 0;
}
.ph-cal-task-marker,
.ph-cal-event-marker {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 999px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ph-bg) 72%, transparent);
}
.ph-cal-task-marker {
  border: 1px solid color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 68%, transparent);
  background: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 20%, var(--ph-bg));
  color: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 86%, var(--ph-text));
}
.ph-cal-event-marker {
  border: 1px solid color-mix(in srgb, var(--ph-event-color, #8b7cf6) 68%, transparent);
  background: color-mix(in srgb, var(--ph-event-color, #8b7cf6) 20%, var(--ph-bg));
  color: color-mix(in srgb, var(--ph-event-color, #8b7cf6) 86%, var(--ph-text));
}
.ph-cal-task[data-overview-shape="pin"] {
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
[data-theme="light"] .ph-cal-task[data-overview-shape="pin"] {
  background: transparent;
}
.ph-cal-task:active {
  transform: scale(0.96);
  opacity: 0.85;
}
.ph-cal-task.is-clip-left {
  border-left-width: 0;
  border-top-left-radius: 1px;
  border-bottom-left-radius: 1px;
}
.ph-cal-task.is-clip-right {
  border-top-right-radius: 1px;
  border-bottom-right-radius: 1px;
}
/* Completed work is visible but plainly finished — never hidden mid-scroll. */
.ph-cal-task.is-done {
  opacity: 0.45;
}
.ph-cal-task.is-done .ph-cal-task-text {
  text-decoration: line-through;
}
.ph-cal-task-text {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-cal-task-assignees {
  flex: 0 0 auto;
  margin-left: 3px;
}
.ph-cal-task-flip {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-left: 3px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 50%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--state-warning) 16%, transparent);
  color: var(--state-warning);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}
.ph-cal-task-assignees > * {
  border-color: color-mix(in srgb, var(--ph-surface, var(--bg-elevated)) 88%, transparent);
}

/* Calendar events share the packed work lanes but stay visually distinct from
   operational tasks: source-calendar glass, explicit time, no task-status semantics. */
.ph-cal-event {
  --ph-event-color: #8b7cf6;
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 5px;
  border: 1px solid color-mix(in srgb, var(--ph-event-color) 38%, transparent);
  border-left: 2px solid var(--ph-event-color);
  border-radius: 5px;
  background:
    linear-gradient(
      110deg,
      color-mix(in srgb, var(--ph-event-color) 23%, transparent),
      color-mix(in srgb, var(--ph-event-color) 10%, transparent)
    );
  color: var(--ph-text);
  font: inherit;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
[data-theme="light"] .ph-cal-event {
  background:
    linear-gradient(
      110deg,
      color-mix(in srgb, var(--ph-event-color) 16%, transparent),
      color-mix(in srgb, var(--ph-event-color) 8%, transparent)
    );
}
.ph-cal-event:active {
  transform: scale(0.96);
  opacity: 0.88;
}
.ph-cal-event.is-clip-left {
  border-left-width: 0;
  border-top-left-radius: 1px;
  border-bottom-left-radius: 1px;
}
.ph-cal-event.is-clip-right {
  border-top-right-radius: 1px;
  border-bottom-right-radius: 1px;
}
.ph-cal-event[data-overview-shape="pin"] {
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
[data-theme="light"] .ph-cal-event[data-overview-shape="pin"] {
  background: transparent;
}
.ph-cal-event[data-overview-shape="range"] {
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
[data-theme="light"] .ph-cal-event[data-overview-shape="range"] {
  background: transparent;
}
/* The line owns the real event extent. The transparent pseudo-element keeps
   a 34px tap target without visually inflating a short event into hours. */
.ph-cal-event[data-overview-shape="range"]::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(34px, 100%);
  height: 34px;
  content: "";
  transform: translate(-50%, -50%);
}
.ph-cal-event-range {
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 5px;
  border: 1px solid color-mix(in srgb, var(--ph-event-color) 58%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ph-event-color) 55%, transparent);
  transform: translateY(-50%);
}
.ph-cal-event-range::before,
.ph-cal-event-range::after {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 13px;
  border-radius: 999px;
  background: var(--ph-event-color);
  content: "";
  transform: translateY(-50%);
}
.ph-cal-event-range::before { left: 0; }
.ph-cal-event-range::after { right: 0; }
.ph-cal-event.is-clip-left .ph-cal-event-range::before,
.ph-cal-event.is-clip-right .ph-cal-event-range::after {
  display: none;
}
.ph-cal-event[data-overview-shape="range"] .ph-cal-task-text {
  position: relative;
  z-index: 1;
  padding-inline: 5px;
  text-shadow: 0 1px 2px var(--ph-bg), 0 -1px 2px var(--ph-bg);
}
.ph-cal-event-kind,
.ph-cal-event-time {
  flex: 0 0 auto;
  color: color-mix(in srgb, var(--ph-event-color) 72%, var(--ph-text));
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
.ph-cal-event-kind {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ph-cal-event.is-hours .ph-cal-event-time {
  margin-left: auto;
}

/* ── The day timeline's work (2026-07-26) ──────────────────────────────────
   Two bands per row: stays keep the one they always had, jobs get a new one
   beneath. A changeover clean deliberately OVERLAPS the checkout it follows,
   so sharing a band would draw one on top of the other. Mirrors
   .property-day-timeline-stays / -tasks on the desktop. */
.ph-cal-dayband {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}
.ph-cal-daytasks {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
}
.ph-cal-dayevents {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
}
.ph-cal-task-when {
  flex: 0 0 auto;
  margin-right: 4px;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 85%, var(--ph-text));
}
.ph-cal-row2.is-unassigned .ph-cal-prop2-name {
  color: var(--ph-muted);
  font-style: italic;
}

/* Jobs with no hour of their own. Sits above the panning canvas, scrolls
   internally rather than growing — the busiest single day holds 38. */
.ph-cal-allday {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--ph-hairline);
}
.ph-cal-allday-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ph-muted);
}
.ph-cal-allday-label strong {
  padding: 0 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ph-muted) 22%, transparent);
  color: var(--ph-text);
  letter-spacing: 0;
}
.ph-cal-allday-chips {
  /* `flex: 1 1 0` + `min-width: 0` so chips wrap across the strip instead of
     sizing the container to the widest one and stacking one per line. */
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 66px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ph-cal-allday-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 6px;
  border: 0;
  border-left: 2px solid var(--ph-task-tint, var(--ph-accent-soft));
  border-radius: 4px;
  background: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 22%, transparent);
  color: var(--ph-text);
  font: inherit;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
[data-theme="light"] .ph-cal-allday-chip {
  background: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 15%, transparent);
}
.ph-cal-allday-chip:active {
  transform: scale(0.96);
  opacity: 0.85;
}
.ph-cal-allday-chip.is-done {
  opacity: 0.45;
}
.ph-cal-allday-chip.is-done .ph-cal-task-text {
  text-decoration: line-through;
}
/* A job running from before today until after it DID have times chosen — they
   are just not today's, so it is marked differently from one that never had
   a time at all. */
.ph-cal-allday-chip.is-running {
  border-left-style: dashed;
}
.ph-cal-allday.is-events {
  background: color-mix(in srgb, #8b7cf6 6%, transparent);
}
.ph-cal-allday-chip.is-event {
  --ph-task-tint: #8b7cf6;
}
.ph-cal-allday-run {
  flex: 0 0 auto;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: color-mix(in srgb, var(--ph-task-tint, var(--ph-accent-soft)) 85%, var(--ph-text));
}

/* ---------------------------------------------------------------------------
   TURNOVER WINDOW — the gap between one confirmed stay leaving and the next
   arriving (design doc 2026-07-26-calendar-reality-design.md, D3).

   Until the shared placement module made stay edges time-truthful, this space
   did not exist: every chip ran midpoint-to-midpoint, so a 10:00 departure and
   a 15:00 arrival on the same day met at one point. The band exists to make
   that five hours legible and clickable, so a clean can be dropped straight
   into it.

   Visual rules that matter:
   - LOW contrast on purpose. It must not compete with a reservation chip; it
     is the absence of a guest, not another booking.
   - Diagonal hatch rather than a flat fill, so a 10px band still reads as
     "work window" and not as a rendering artefact or a thin chip.
   - Sized and positioned by JS (left/width/top/height inline) because the
     geometry comes from lib/calendar-placement.ts — CSS never guesses it.
   --------------------------------------------------------------------------- */
.property-calendar-turnover {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px dashed color-mix(in srgb, var(--text-muted) 40%, transparent);
  border-radius: 4px;
  background-color: color-mix(in srgb, var(--text-muted) 9%, transparent);
  background-image: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--text-muted) 18%, transparent) 0 2px,
    transparent 2px 5px
  );
  color: var(--text-muted);
  /* 8px, no tracking: a same-day turnover is 20.8% of a day column — 13px at
     the default zoom — and "5h" measures 9.6px at this size, so the hour count
     fits INSIDE the band at normal zoom instead of only appearing when zoomed
     right in. Measured in-browser, not guessed. */
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.property-calendar-turnover.is-actionable {
  cursor: pointer;
  pointer-events: auto;
}
.property-calendar-turnover.is-actionable:hover,
.property-calendar-turnover.is-actionable:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background-color: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  outline: none;
}
.property-calendar-turnover-label {
  white-space: nowrap;
  pointer-events: none;
}

/* Phone. Same object, phone tokens, and it lives inside the fixed-height stay
   band so a row that grows for task lanes never moves it. Slightly heavier
   hatch than desktop because the phone day column is narrower and a subtle
   fill disappears at that width. */
.ph-cal-turnover {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px dashed color-mix(in srgb, var(--ph-text-2) 42%, transparent);
  border-radius: 4px;
  background-color: color-mix(in srgb, var(--ph-text-2) 10%, transparent);
  background-image: repeating-linear-gradient(
    -45deg,
    color-mix(in srgb, var(--ph-text-2) 20%, transparent) 0 2px,
    transparent 2px 5px
  );
  color: var(--ph-text-2);
  font-size: 8px;
  font-weight: 600;
  line-height: 1;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.ph-cal-turnover:active {
  border-color: color-mix(in srgb, var(--ph-accent) 70%, transparent);
  background-color: color-mix(in srgb, var(--ph-accent) 18%, transparent);
  color: var(--ph-accent);
}
.ph-cal-turnover-label {
  white-space: nowrap;
  pointer-events: none;
}

/* ── Phone calendar day-actions chooser ─────────────────────────────────────
   Tap a day → this. Header, optional Details/Actions tabs (.ph-tsheet-* does
   the tab styling), then .ph-sheet-row action rows. Everything lives under
   .ph-sheet-overlay, which is where the light-theme --ph-* overrides are
   scoped, so both modes come free (§5). */
.ph-dayact-sheet {
  max-height: 78vh;
  overflow-y: auto;
}
.ph-dayact-time,
.ph-dayact-prop {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ph-text-2);
  margin-top: 2px;
}
/* A summary of what already occupies the day. Tapping one opens the full card
   (booking sheet / block sheet) rather than restating it here — two renderings
   of the same thing drift. */
.ph-dayact-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.ph-dayact-detail:active {
  background: var(--ph-accent-wash);
}
.ph-dayact-detail-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.ph-dayact-detail-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-dayact-detail-sub {
  font-size: 12px;
  color: var(--ph-text-2);
}

/* ── Phone block-dates form ─────────────────────────────────────────────────
   Same five reasons and the same inclusive night count as the desktop panel
   (both from lib/calendar-block-reasons.ts); phone chrome so the safe-area
   padding applies and the light-theme --ph-* overrides reach it. */
.ph-blockform {
  max-height: 86vh;
  overflow-y: auto;
  padding-bottom: 18px;
}
.ph-eventform {
  max-height: min(92dvh, 760px);
  overflow-y: auto;
}
.ph-eventform-note {
  margin: -4px 0 14px;
  color: var(--ph-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}
.ph-eventform-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.ph-eventform-check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 13px 0 2px;
  color: var(--ph-text);
  font-size: 0.8rem;
  font-weight: 650;
}
.ph-eventform-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--ph-accent, #7c6df2);
}
.ph-eventform .ph-blockform-field + .ph-blockform-field {
  margin-top: 10px;
}
.ph-eventform .ph-blockform-dates .ph-blockform-field + .ph-blockform-field,
.ph-eventform-grid .ph-blockform-field + .ph-blockform-field {
  margin-top: 0;
}
.ph-eventform .ph-blockform-field > .ph-blockform-input + .ph-blockform-input {
  margin-top: 6px;
}
.ph-blockform-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ph-text);
  margin: 4px 10px 2px;
}
.ph-blockform-prop {
  font-size: 12.5px;
  color: var(--ph-text-2);
  margin: 0 10px 4px;
}
.ph-blockform-section {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ph-text-2);
  margin: 16px 10px 8px;
}
.ph-blockform-opt {
  font-weight: 400;
  color: var(--ph-text-3);
}
.ph-blockform-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px;
}
.ph-blockform-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.ph-blockform-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ph-text-2);
}
.ph-blockform-input,
.ph-blockform-note {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  /* 16px keeps iOS from zooming the viewport when the field takes focus. */
  font-size: 16px;
  font-family: inherit;
}
.ph-blockform-note {
  display: block;
  width: calc(100% - 20px);
  margin: 0 10px;
  resize: none;
}
.ph-blockform-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 10px;
}
.ph-blockform-chip {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface-2);
  color: var(--ph-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ph-blockform-chip.is-sel {
  background: var(--ph-accent);
  border-color: var(--ph-accent);
  color: #fff;
}
.ph-blockform-error {
  margin: 14px 10px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ph-danger);
}
.ph-blockform-cta {
  display: block;
  width: calc(100% - 20px);
  margin: 18px 10px 0;
  padding: 14px;
  border-radius: 14px;
  border: 0;
  background: var(--ph-accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.ph-blockform-cta:disabled {
  opacity: 0.45;
}
.ph-blockform-delete {
  display: block;
  width: calc(100% - 20px);
  margin: 10px 10px 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--ph-danger) 55%, transparent);
  border-radius: 14px;
  background: transparent;
  color: var(--ph-danger);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.ph-blockform-delete:disabled {
  opacity: 0.45;
}
.ph-blockform-props {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 60vh;
  overflow-y: auto;
}
.ph-taskmove .ph-blockform-field { margin: 14px 10px 0; }
.ph-taskmove-window {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 10px 0;
  padding: 11px 12px;
  border: 1px solid var(--ph-border);
  border-radius: 12px;
  background: var(--ph-surface-2);
  color: var(--ph-accent-soft);
}
.ph-taskmove-window > span { display: grid; gap: 2px; }
.ph-taskmove-window small { color: var(--ph-text-2); font-size: 10px; }
.ph-taskmove-window strong { color: var(--ph-text); font-size: 14px; }

/* The day-list heading is a tap target now (it opens the day-actions chooser);
   keep it looking exactly like the heading it replaced. */
.ph-cal-agenda-title.is-tappable {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

/* Actions on a block's own detail sheet — change its dates/reason, or open them
   back up. Separated from the facts above by a hairline so the sheet still
   reads as "what this is" then "what you can do". */
.ph-cal-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--ph-hairline);
}

/* What a block actually does, in words, under the two date fields. Hosts read
   two dates as a stay (arrive / leave) and could not tell whether the same date
   twice held a night or none — so the count and its two consequences are stated
   rather than implied. Copy comes from describeBlockRange() so the phone and the
   desktop panel can never word it differently. Tokens only: light mode inherits
   through the .ph-sheet-overlay selector list. */
.ph-blockform-explain {
  margin: 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  /* Accent wash, NOT --ph-surface-2: in light mode --ph-surface-2 and the sheet's
     own --ph-surface are BOTH #ffffff, so a surface-2 panel is invisible on the
     sheet and only the 5%-black hairline hints at it. The wash is a real tint in
     both themes (#e0e7ff light, rgba(99,102,241,.14) dark). */
  background: var(--ph-accent-wash);
  border: 1px solid color-mix(in srgb, var(--ph-accent) 22%, transparent);
}
.ph-blockform-explain-head {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ph-text);
}
.ph-blockform-explain-line {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ph-text-2);
}
.ph-blockform-explain-line + .ph-blockform-explain-line {
  margin-top: 3px;
}

/* Desktop twin of .ph-blockform-explain — the two consequences of a block, under
   its date fields. Same sentences, from describeBlockRange(). */
.cal-block-explain { display:flex; flex-direction:column; gap:0.15rem; margin-top:0.4rem; font-size:0.7rem; line-height:1.45; color:var(--text-soft); }

/* The detail card the phone calendar's chooser shows on its Details tab —
   booking, blocked run, or changeover. It is the body of what used to be three
   standalone .ph-cal-sheet overlays, so it keeps their .ph-cal-sheet-* children
   (and therefore their light/dark parity, §5) and only has to restate the
   column gap those overlays supplied. No overlay chrome of its own: the sheet
   around it already brings the grab handle, the close button and the safe-area
   padding. */
.ph-dayact-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Inside the card a .ph-dayact-detail row is a link to another object (the two
   bookings either side of a changeover), not a list item — the card's own gap
   already spaces it, so it must not also carry the list margin. */
.ph-dayact-card .ph-dayact-detail {
  margin-bottom: 0;
}
.ph-event-detail-when,
.ph-event-detail-line {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--ph-text-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.ph-event-detail-when svg,
.ph-event-detail-line svg {
  flex: none;
  margin-top: 1px;
  color: #9d91fb;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Attention centre + top bar hierarchy — 2026-07-28

   The top bar keeps tabs primary beside five global actions: search, create,
   Inbox, notifications and account. Product links, appearance, feedback, admin and
   presence now live behind the avatar. These late rules deliberately replace
   the older collection of one-off button/dropdown styles above while older
   components are retired incrementally.
   ═══════════════════════════════════════════════════════════════════════════ */

.workspace-topbar {
  min-height: 44px;
  gap: 0.42rem;
  padding: 0.28rem 0.36rem;
  border-radius: 12px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bg-elevated) 72%, var(--bg-deep)) 0%,
      color-mix(in srgb, var(--bg-deep) 96%, var(--bg-elevated)) 100%
    );
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent) inset,
    0 6px 18px color-mix(in srgb, var(--bg-base) 30%, transparent);
}

.workspace-tabs {
  gap: 0.18rem;
}

.workspace-tab,
.workspace-tab-add {
  min-height: 34px;
  border-radius: 8px;
}

.workspace-tabs .workspace-tab.active {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--accent) 11%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  box-shadow:
    inset 0 -2px 0 color-mix(in srgb, var(--accent) 82%, transparent),
    0 2px 8px color-mix(in srgb, var(--bg-base) 22%, transparent);
}

.workspace-topbar-right {
  position: relative;
  flex: 0 0 auto;
  gap: 0.24rem;
  padding-left: 0.42rem;
  border-left: 1px solid color-mix(in srgb, var(--border-subtle) 76%, transparent);
}

.workspace-topbar-surface,
.workspace-account-wrap {
  position: relative;
  display: inline-flex;
}

.workspace-topbar-action {
  position: relative;
  min-width: 34px;
  height: 34px;
  padding: 0 0.58rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  flex: none;
  font: inherit;
  font-size: 0.73rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

.workspace-topbar-action > .ui-icon {
  width: 17px;
  height: 17px;
  flex: none;
}

.workspace-topbar-action:hover,
.workspace-topbar-action:focus-visible,
.workspace-topbar-action.is-active {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--border-strong) 65%, transparent);
  background: color-mix(in srgb, var(--bg-input) 78%, transparent);
  outline: none;
}

.workspace-topbar-action:active {
  transform: translateY(1px);
}

.workspace-details-btn { color: var(--text-primary); border-color: color-mix(in srgb, var(--accent) 34%, var(--border-subtle)); }

.workspace-notification-delivery-compact {
  display: none;
}

.workspace-notifications-btn.is-delivery-limited,
.workspace-notifications-btn.is-delivery-unknown {
  border-color: color-mix(in srgb, var(--state-warning) 54%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 10%, transparent);
  color: color-mix(in srgb, var(--state-warning) 86%, var(--text-primary));
}

.workspace-notifications-btn.is-delivery-paused {
  border-color: color-mix(in srgb, var(--state-error) 56%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-error) 10%, transparent);
  color: color-mix(in srgb, var(--state-error) 84%, var(--text-primary));
}

/* Stavros's opener when pane 5 is assigned to a drawer. The mark is the
   collapsed rail's brand chip shrunk to topbar scale — same violet→pink→indigo
   gradient as .aiops-rail-mark, so the button keeps its identity when topbar
   labels are hidden. Gradient is deliberately
   theme-constant (matches the rail in both modes). */
.workspace-stavros-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 60%, #3730a3 125%);
  color: #fff;
  flex: none;
  box-shadow:
    0 1px 6px color-mix(in srgb, var(--accent) 30%, transparent),
    inset 0 0 0 1px rgb(255 255 255 / 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.workspace-stavros-btn:hover .workspace-stavros-mark,
.workspace-stavros-btn:focus-visible .workspace-stavros-mark,
.workspace-stavros-btn.is-active .workspace-stavros-mark {
  transform: translateY(-1px);
  box-shadow:
    0 4px 12px color-mix(in srgb, var(--accent) 44%, transparent),
    inset 0 0 0 1px rgb(255 255 255 / 0.26);
}

.workspace-stavros-btn.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong));
}

.workspace-newmenu-btn {
  padding-inline: 0.68rem;
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 82%, var(--border-strong));
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 86%, #fff) 0%,
      var(--accent) 100%
    );
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 23%, transparent) inset,
    0 3px 10px color-mix(in srgb, var(--accent) 22%, transparent);
}

.workspace-newmenu-btn:hover,
.workspace-newmenu-btn:focus-visible {
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 72%, #fff);
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 78%, #fff) 0%,
      color-mix(in srgb, var(--accent) 94%, var(--bg-base)) 100%
    );
}

.workspace-topbar-chevron {
  width: 13px !important;
  height: 13px !important;
  opacity: 0.62;
}

.workspace-topbar-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 0.27rem;
  border: 1px solid color-mix(in srgb, var(--accent) 62%, var(--border-subtle));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 78%, var(--bg-elevated));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.61rem;
  font-weight: 760;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.workspace-inbox-btn .workspace-topbar-badge {
  border-color: color-mix(in srgb, var(--state-warning) 68%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-warning) 78%, var(--bg-elevated));
}

.workspace-account-trigger {
  position: relative;
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.workspace-account-trigger:hover,
.workspace-account-trigger:focus-visible,
.workspace-account-trigger.is-active {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-input));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent);
  outline: none;
}

.workspace-account-avatar,
.workspace-account-menu-avatar {
  display: block;
  border-radius: 9px;
  object-fit: cover;
}

.workspace-account-avatar--fallback {
  color: var(--text-primary);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--accent) 24%, var(--bg-input)),
      color-mix(in srgb, var(--accent) 8%, var(--bg-elevated))
    );
}

.workspace-account-trigger > .workspace-status-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg-deep);
}

.workspace-account-update-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--bg-deep);
  border-radius: 50%;
  background: var(--accent);
}

.workspace-quick-create-menu,
.workspace-panels-menu,
.workspace-account-menu {
  top: calc(100% + 0.48rem);
  z-index: 90;
  border-color: color-mix(in srgb, var(--border-strong) 72%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg-elevated) 97%, var(--bg-input));
  box-shadow:
    0 18px 48px color-mix(in srgb, var(--bg-base) 48%, transparent),
    0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent) inset;
}

.workspace-quick-create-menu {
  min-width: 264px;
  padding: 0.42rem;
}

.workspace-quick-create-menu button {
  min-height: 48px;
  padding: 0.52rem 0.58rem;
}

.workspace-panels-menu {
  position: absolute;
  right: 0;
  width: 276px;
  display: grid;
  gap: 0.2rem;
  padding: 0.42rem;
}

.workspace-panels-menu button {
  min-height: 48px;
  padding: 0.5rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-primary);
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.workspace-panels-menu button:hover,
.workspace-panels-menu button:focus-visible,
.workspace-panels-menu button[aria-checked="true"] {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-input));
  outline: none;
}

.workspace-panels-menu-icon,
.workspace-account-action-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--border-subtle) 45%, transparent);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-panels-menu-icon .ui-icon,
.workspace-account-action-icon .ui-icon {
  width: 16px;
  height: 16px;
}

.workspace-panels-menu button > span:last-child,
.workspace-account-menu-action > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.workspace-panels-menu strong,
.workspace-account-menu-action strong {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-primary);
}

.workspace-panels-menu small,
.workspace-account-menu-action small {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-muted);
}

/* Notification attention centre */
.workspace-attention-panel,
.workspace-product-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.48rem);
  z-index: 95;
  width: min(460px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 72px));
  border: 1px solid color-mix(in srgb, var(--border-strong) 74%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--bg-elevated) 98%, var(--bg-input));
  box-shadow:
    0 22px 60px color-mix(in srgb, var(--bg-base) 52%, transparent),
    0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent) inset;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: workspace-attention-in 140ms ease-out;
}

@keyframes workspace-attention-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.workspace-attention-head {
  flex: none;
  min-height: 68px;
  padding: 0.85rem 0.95rem 0.72rem 1rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 74%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.workspace-attention-head > div {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.workspace-attention-eyebrow {
  color: var(--accent);
  font-size: 0.61rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.workspace-attention-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.workspace-attention-icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.workspace-attention-icon-btn:hover,
.workspace-attention-icon-btn:focus-visible {
  border-color: var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
}

.workspace-attention-toolbar {
  flex: none;
  min-height: 50px;
  padding: 0.48rem 0.62rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 66%, transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.workspace-attention-tabs,
.workspace-product-tabs {
  padding: 3px;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 82%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-input) 72%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.workspace-attention-tabs button,
.workspace-product-tabs button {
  min-height: 28px;
  padding: 0 0.58rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 650;
  cursor: pointer;
}

.workspace-attention-tabs button.is-active,
.workspace-product-tabs button.is-active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--bg-base) 28%, transparent);
}

.workspace-attention-tabs button span {
  min-width: 17px;
  height: 17px;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.59rem;
  font-variant-numeric: tabular-nums;
}

.workspace-attention-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.12rem;
}

.workspace-attention-actions button,
.workspace-attention-inline-error button {
  min-height: 30px;
  padding: 0 0.42rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 620;
  cursor: pointer;
}

.workspace-attention-actions button:hover,
.workspace-attention-actions button:focus-visible,
.workspace-attention-inline-error button:hover,
.workspace-attention-inline-error button:focus-visible {
  background: var(--bg-input);
  color: var(--text-primary);
  outline: none;
}

.workspace-attention-inline-error {
  flex: none;
  margin: 0.55rem 0.65rem 0;
  padding: 0.45rem 0.5rem 0.45rem 0.62rem;
  border: 1px solid color-mix(in srgb, var(--state-error) 38%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--state-error) 8%, transparent);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.7rem;
}

.workspace-attention-inline-error button {
  color: var(--state-error);
}

.workspace-attention-scroll,
.workspace-product-scroll {
  min-height: 180px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.workspace-attention-group {
  padding: 0.7rem 0.56rem 0;
}

.workspace-attention-group:last-of-type {
  padding-bottom: 0.65rem;
}

.workspace-attention-group h3 {
  margin: 0 0 0.35rem;
  padding: 0 0.38rem;
  color: var(--text-muted);
  font-size: 0.61rem;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.workspace-attention-group > div {
  display: grid;
  gap: 0.16rem;
}

.workspace-attention-row {
  width: 100%;
  min-height: 68px;
  padding: 0.58rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease;
}

.workspace-attention-row:hover,
.workspace-attention-row:focus-visible {
  border-color: color-mix(in srgb, var(--border-subtle) 88%, transparent);
  background: color-mix(in srgb, var(--bg-input) 70%, transparent);
  outline: none;
}

.workspace-attention-row.is-unread {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.workspace-attention-row-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--border-subtle) 48%, transparent);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-attention-row.is-blue .workspace-attention-row-icon {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.workspace-attention-row.is-violet .workspace-attention-row-icon {
  color: color-mix(in srgb, var(--accent) 72%, #d946ef);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
}

.workspace-attention-row.is-amber .workspace-attention-row-icon {
  color: var(--state-warning);
  background: color-mix(in srgb, var(--state-warning) 12%, transparent);
}

.workspace-attention-row.is-green .workspace-attention-row-icon {
  color: var(--state-success);
  background: color-mix(in srgb, var(--state-success) 12%, transparent);
}

.workspace-attention-row-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.workspace-attention-row-copy strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 660;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-attention-row-copy > span:not(.workspace-attention-row-meta) {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.68rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.workspace-attention-row-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.59rem;
  font-weight: 660;
  line-height: 1.2;
}

.workspace-attention-row-meta time::before {
  content: "·";
  margin-right: 0.35rem;
}

.workspace-attention-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.workspace-attention-chevron {
  color: var(--text-muted);
  opacity: 0.55;
}

.workspace-attention-row.is-read .workspace-attention-row-icon,
.workspace-attention-row.is-read .workspace-attention-row-copy {
  opacity: 0.72;
}

.workspace-attention-empty {
  min-height: 248px;
  padding: 2rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  text-align: center;
}

.workspace-attention-empty > svg {
  margin-bottom: 0.15rem;
  color: var(--accent);
}

.workspace-attention-empty strong {
  color: var(--text-primary);
  font-size: 0.84rem;
}

.workspace-attention-empty p {
  max-width: 30ch;
  margin: 0;
  font-size: 0.71rem;
  line-height: 1.5;
}

.workspace-attention-empty button,
.workspace-attention-more {
  min-height: 32px;
  margin-top: 0.35rem;
  padding: 0 0.72rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.69rem;
  font-weight: 650;
  cursor: pointer;
}

.workspace-attention-more {
  display: block;
  margin: 0.2rem auto 0.8rem;
}

.workspace-attention-more:disabled {
  opacity: 0.58;
  cursor: wait;
}

.workspace-attention-loading {
  padding: 0.7rem;
  display: grid;
  gap: 0.42rem;
}

.workspace-attention-skeleton {
  min-height: 66px;
  padding: 0.55rem;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 0.58rem;
}

.workspace-attention-skeleton > span,
.workspace-attention-skeleton i,
.workspace-product-loading span {
  display: block;
  border-radius: 999px;
  background:
    linear-gradient(
      100deg,
      color-mix(in srgb, var(--border-subtle) 45%, transparent) 20%,
      color-mix(in srgb, var(--border-strong) 38%, transparent) 45%,
      color-mix(in srgb, var(--border-subtle) 45%, transparent) 70%
    );
  background-size: 220% 100%;
  animation: workspace-attention-shimmer 1.35s linear infinite;
}

.workspace-attention-skeleton > span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.workspace-attention-skeleton > div {
  display: grid;
  gap: 0.45rem;
}

.workspace-attention-skeleton i {
  height: 8px;
}

.workspace-attention-skeleton i:first-child {
  width: 64%;
}

.workspace-attention-skeleton i:last-child {
  width: 88%;
}

@keyframes workspace-attention-shimmer {
  to {
    background-position: -220% 0;
  }
}

/* Account owns preferences, product links, feedback and admin utilities. */
.workspace-account-menu {
  right: 0;
  width: 318px;
  min-width: 318px;
  max-height: min(710px, calc(100vh - 72px));
  overflow: auto;
  gap: 0;
  padding: 0.42rem;
}

.workspace-account-identity {
  min-height: 58px;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 0.62rem;
}

.workspace-account-identity > span {
  min-width: 0;
  display: grid;
  gap: 0.06rem;
}

.workspace-account-identity strong,
.workspace-account-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-account-identity strong {
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 680;
}

.workspace-account-identity small {
  color: var(--text-muted);
  font-size: 0.66rem;
}

.workspace-account-section {
  padding: 0.34rem 0;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
}

.workspace-account-section > p {
  margin: 0;
  padding: 0.35rem 0.55rem 0.24rem;
  color: var(--text-muted);
  font-size: 0.59rem;
  font-weight: 750;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.workspace-account-menu button.workspace-account-menu-action,
.workspace-account-menu .workspace-feedback-menu-btn {
  min-height: 46px;
  padding: 0.42rem 0.45rem;
  border-radius: 9px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 0.52rem;
}

.workspace-account-menu button.workspace-account-menu-action:hover,
.workspace-account-menu button.workspace-account-menu-action:focus-visible,
.workspace-account-menu .workspace-feedback-menu-btn:hover,
.workspace-account-menu .workspace-feedback-menu-btn:focus-visible {
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-input));
}

.workspace-account-menu-action > .workspace-account-row-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transform: rotate(0deg);
}

.workspace-account-status-options {
  margin: 0.08rem 0.3rem 0.28rem 2.38rem;
  padding: 0.2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg-input) 58%, transparent);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.12rem;
}

.workspace-account-menu .workspace-account-status-options button {
  min-height: 30px;
  padding: 0 0.38rem;
  border-radius: 6px;
  gap: 0.35rem;
  font-size: 0.66rem;
}

.workspace-account-menu .workspace-account-status-options button.is-active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--bg-base) 24%, transparent);
}

/* Appearance sits in the same shape as Status: a label row, then the choices
   below it. It reuses .workspace-account-status-options for the frame and the
   selected-pill look so the two rows cannot drift apart; only the column count
   differs, because appearance has three choices and status has two. */
.workspace-account-appearance {
  min-height: 46px;
  padding: 0.42rem 0.45rem;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0.52rem;
  align-items: center;
}

.workspace-account-appearance > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 0.08rem;
}

.workspace-account-appearance strong {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-primary);
}

.workspace-account-appearance small {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.workspace-account-appearance-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-account-menu .workspace-account-appearance-options button {
  justify-content: center;
}

.workspace-account-status-choice {
  min-width: 0;
}

.workspace-account-status-choice > button {
  width: 100%;
}

.workspace-account-status-choice.is-open {
  grid-column: 1 / -1;
}

.workspace-account-status-durations {
  margin-top: 0.18rem;
  padding: 0.24rem 0.18rem 0.18rem 0.58rem;
  border-left: 2px solid color-mix(in srgb, var(--accent) 54%, var(--border-subtle));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.12rem;
}

.workspace-account-menu .workspace-account-status-durations button {
  min-height: 32px;
  padding: 0.28rem 0.38rem;
  justify-content: flex-start;
  text-align: left;
  white-space: normal;
  line-height: 1.25;
}

.workspace-account-menu .workspace-account-status-durations button:hover,
.workspace-account-menu .workspace-account-status-durations button:focus-visible {
  background: var(--bg-elevated);
  color: var(--text-primary);
  outline: none;
}

.workspace-account-action-icon .workspace-status-dot {
  width: 9px;
  height: 9px;
  border: 0;
}

.workspace-account-menu-new {
  padding: 0.15rem 0.38rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.57rem;
  font-weight: 760;
  text-transform: uppercase;
}

.workspace-account-menu .workspace-feedback-menu-btn {
  width: 100%;
  text-align: left;
}

.workspace-account-menu .workspace-feedback-menu-btn > .ui-icon {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--border-subtle) 45%, transparent);
  color: var(--text-soft);
}

.workspace-account-menu .workspace-feedback-menu-btn > span {
  font-size: 0.78rem;
  font-weight: 650;
}

.workspace-account-error {
  margin: 0.24rem 0.42rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid color-mix(in srgb, var(--state-error) 38%, var(--border-subtle));
  border-radius: 8px;
  background: color-mix(in srgb, var(--state-error) 8%, transparent);
  color: var(--text-primary);
  font-size: 0.68rem;
}

.workspace-account-footer {
  padding-top: 0.36rem;
  border-top: 1px solid color-mix(in srgb, var(--border-subtle) 72%, transparent);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.28rem;
}

.workspace-account-menu .workspace-account-footer button {
  min-height: 34px;
  padding: 0 0.48rem;
  border: 1px solid transparent;
  border-radius: 8px;
  justify-content: center;
  font-size: 0.69rem;
}

.workspace-account-menu .workspace-account-footer button:hover {
  border-color: var(--border-subtle);
}

.workspace-account-menu button.workspace-account-signout {
  margin: 0;
  border-top: 1px solid transparent;
  border-radius: 8px;
}

/* Product panel shares the attention-centre frame, with a timeline inside. */
.workspace-topbar-product-surface {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 94;
}

.workspace-product-panel {
  position: absolute;
  width: min(500px, calc(100vw - 28px));
}

.workspace-product-tabs {
  flex: none;
  align-self: flex-start;
  margin: 0.58rem 0.72rem 0.18rem;
}

.workspace-product-scroll {
  min-height: 260px;
}

.workspace-product-loading {
  padding: 0.9rem;
  display: grid;
  gap: 0.68rem;
}

.workspace-product-loading > div {
  min-height: 94px;
  padding: 0.65rem;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  display: grid;
  align-content: center;
  gap: 0.5rem;
}

.workspace-product-loading span {
  width: 84%;
  height: 8px;
}

.workspace-product-loading span:first-child {
  width: 42%;
}

.workspace-product-loading span:last-child {
  width: 68%;
}

.workspace-product-updates {
  position: relative;
  padding: 0.65rem 0.8rem 1rem;
}

.workspace-product-updates::before {
  content: "";
  position: absolute;
  top: 1.18rem;
  bottom: 1.25rem;
  left: 1.76rem;
  width: 1px;
  background: color-mix(in srgb, var(--border-strong) 58%, transparent);
}

.workspace-product-updates article {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0.58rem;
  padding: 0.5rem 0;
}

.workspace-product-update-mark {
  z-index: 1;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elevated));
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-product-updates article > div:last-child {
  min-width: 0;
  padding: 0.28rem 0.2rem 0.58rem;
}

.workspace-product-updates article header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.workspace-product-updates article header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-product-updates article header span {
  padding: 0.11rem 0.32rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.55rem;
  font-weight: 750;
  text-transform: uppercase;
}

.workspace-product-updates article header time {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.62rem;
  white-space: nowrap;
}

.workspace-product-updates article ul {
  margin: 0.42rem 0 0;
  padding-left: 1rem;
}

.workspace-product-updates article li {
  margin: 0.18rem 0;
  color: var(--text-soft);
  font-size: 0.7rem;
  line-height: 1.45;
}

.workspace-product-roadmap {
  padding: 0.7rem 0.8rem 1rem;
  display: grid;
  gap: 0.72rem;
}

.workspace-product-roadmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.workspace-product-roadmap-legend span,
.workspace-product-roadmap li {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.workspace-product-roadmap-legend span {
  color: var(--text-muted);
  font-size: 0.62rem;
}

.workspace-product-roadmap i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: none;
}

.workspace-product-roadmap .is-live > i {
  background: var(--state-success);
}

.workspace-product-roadmap .is-in_progress > i {
  background: var(--accent);
}

.workspace-product-roadmap section {
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-input) 32%, transparent);
}

.workspace-product-roadmap section > header {
  padding: 0.62rem 0.72rem;
  border-bottom: 1px solid var(--border-subtle);
}

.workspace-product-roadmap section > header strong {
  color: var(--text-primary);
  font-size: 0.77rem;
}

.workspace-product-roadmap section > header p {
  margin: 0.18rem 0 0;
  color: var(--text-muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.workspace-product-roadmap section ul {
  margin: 0;
  padding: 0.3rem;
  list-style: none;
}

.workspace-product-roadmap li {
  min-height: 34px;
  padding: 0.35rem 0.42rem;
  border-radius: 7px;
  color: var(--text-soft);
  font-size: 0.69rem;
}

.workspace-product-roadmap li:hover {
  background: color-mix(in srgb, var(--bg-input) 72%, transparent);
}

.workspace-product-roadmap li span {
  min-width: 0;
  flex: 1;
}

.workspace-product-roadmap li small {
  color: var(--text-muted);
  font-size: 0.59rem;
  white-space: nowrap;
}

.workspace-toast.is-error {
  border-color: color-mix(in srgb, var(--state-error) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--state-error) 7%, var(--bg-elevated));
}

.workspace-toast button:disabled {
  opacity: 0.58;
  cursor: wait;
}

@media (max-width: 1320px) {
  .workspace-topbar-action > span,
  .workspace-panels-btn > .workspace-topbar-chevron {
    display: none;
  }

  /* The Stavros mark is a direct-child span too — without this it would be
     hidden with the labels and leave an empty button. The mark stays; only the
     "Stavros" text span hides. */
  .workspace-stavros-btn > .workspace-stavros-mark {
    display: inline-flex;
  }

  .workspace-details-btn > span { display: inline-flex; }

  .workspace-topbar-action {
    padding-inline: 0.44rem;
  }

  .workspace-notifications-btn > .workspace-notification-delivery-compact {
    max-width: 56px;
    display: inline-flex;
    overflow: hidden;
    font-size: 0.61rem;
    line-height: 1;
    text-overflow: ellipsis;
  }

  .workspace-topbar-action .workspace-topbar-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding-inline: 0.2rem;
    border-width: 2px;
    border-color: var(--bg-deep);
    font-size: 0.55rem;
  }
}

@media (max-width: 520px) {
  .notification-delivery-notice {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .notification-delivery-notice button {
    grid-column: 2;
    width: fit-content;
  }
}

@media (hover: none) {
  .workspace-topbar-action,
  .workspace-account-trigger {
    min-width: 38px;
    height: 38px;
  }

  .workspace-attention-icon-btn,
  .workspace-attention-tabs button,
  .workspace-attention-actions button {
    min-height: 36px;
  }
}

@media (max-width: 640px) {
  .workspace-attention-panel,
  .workspace-product-panel {
    position: fixed;
    inset: calc(56px + env(safe-area-inset-top, 0px)) 8px auto;
    width: auto;
    max-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px));
  }

  .workspace-account-menu {
    position: fixed;
    inset: calc(56px + env(safe-area-inset-top, 0px)) 8px auto;
    width: auto;
    min-width: 0;
    max-height: calc(100dvh - 68px - env(safe-area-inset-top, 0px));
  }

  .workspace-attention-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-attention-actions {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-attention-panel,
  .workspace-product-panel {
    animation: none;
  }

  .workspace-attention-skeleton > span,
  .workspace-attention-skeleton i,
  .workspace-product-loading span {
    animation: none;
  }
}

/* Phone attention centre. Same information architecture as desktop, expressed
   as a full-screen native sheet with larger targets and denser typography. */
.ph-notif-head {
  min-height: 72px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--ph-hairline);
}

.ph-notif-head > div:first-child {
  display: grid;
  gap: 2px;
}

.ph-notif-head > div:first-child > span {
  color: var(--ph-accent);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.ph-notif-head h2 {
  font-size: 21px;
  letter-spacing: -0.025em;
}

.ph-notif-actions {
  gap: 6px;
}

.ph-notif-toolbar {
  flex: none;
  min-height: 56px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ph-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ph-notif-tabs {
  padding: 3px;
  border: 1px solid var(--ph-border);
  border-radius: 10px;
  background: var(--ph-surface-2);
  display: inline-flex;
  gap: 2px;
}

.ph-notif-tabs button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ph-text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.ph-notif-tabs button.is-on {
  background: var(--ph-surface);
  color: var(--ph-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ph-notif-tabs button span {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ph-accent) 18%, transparent);
  color: var(--ph-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.ph-notif-mark-all {
  min-height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ph-text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.ph-notif-mark-all:active {
  background: var(--ph-press);
}

.ph-notif-error {
  flex: none;
  margin: 10px 12px 0;
  padding: 9px 10px 9px 12px;
  border: 1px solid color-mix(in srgb, #ef4444 38%, var(--ph-border));
  border-radius: 10px;
  background: color-mix(in srgb, #ef4444 9%, transparent);
  color: var(--ph-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.ph-notif-error button {
  min-height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: var(--ph-surface);
  color: #f87171;
  font: inherit;
  font-size: 12px;
  font-weight: 680;
}

.ph-notif-group {
  padding: 14px 10px 0;
}

.ph-notif-group:last-of-type {
  padding-bottom: 12px;
}

.ph-notif-group h3 {
  margin: 0 0 6px;
  padding: 0 7px;
  color: var(--ph-text-3);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.ph-notif-group > div {
  display: grid;
  gap: 3px;
}

.ph-notif-row {
  min-height: 78px;
  padding: 10px 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
}

.ph-notif-row.is-unread {
  background: color-mix(in srgb, var(--ph-accent) 7%, transparent);
}

.ph-notif-row:active {
  border-color: var(--ph-border);
  background: var(--ph-press);
}

.ph-notif-row-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--ph-surface);
  color: var(--ph-text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ph-notif-row.is-blue .ph-notif-row-icon,
.ph-notif-row.is-violet .ph-notif-row-icon {
  color: var(--ph-accent);
  background: color-mix(in srgb, var(--ph-accent) 14%, transparent);
}

.ph-notif-row.is-amber .ph-notif-row-icon {
  color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 13%, transparent);
}

.ph-notif-row.is-green .ph-notif-row-icon {
  color: #34d399;
  background: color-mix(in srgb, #34d399 12%, transparent);
}

.ph-notif-main {
  gap: 3px;
}

.ph-notif-main strong {
  overflow: hidden;
  color: var(--ph-text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-notif-main > span:not(.ph-notif-meta) {
  color: var(--ph-text-2);
  font-size: 12px;
  line-height: 1.35;
}

.ph-notif-main .ph-notif-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  overflow: visible;
  color: var(--ph-text-3);
  font-size: 10px;
  font-weight: 680;
  line-height: 1.2;
  -webkit-box-orient: initial;
  -webkit-line-clamp: initial;
}

.ph-notif-main .ph-notif-meta > span {
  display: inline;
  overflow: visible;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  -webkit-box-orient: initial;
  -webkit-line-clamp: initial;
}

.ph-notif-main .ph-notif-meta time {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.ph-notif-main .ph-notif-meta time::before {
  content: "·";
  margin-right: 6px;
}

.ph-notif-row .ph-notif-dot {
  width: 8px;
  height: 8px;
  margin: 0;
  background: var(--ph-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ph-accent) 11%, transparent);
}

.ph-notif-chevron {
  color: var(--ph-text-3);
}

.ph-notif-row.is-read .ph-notif-row-icon,
.ph-notif-row.is-read .ph-notif-main {
  opacity: 0.7;
}

.ph-notif-empty {
  min-height: 52vh;
  padding: 48px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.ph-notif-empty > svg {
  margin-bottom: 3px;
  color: var(--ph-accent);
}

.ph-notif-empty strong {
  color: var(--ph-text);
  font-size: 16px;
}

.ph-notif-empty p {
  max-width: 30ch;
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.ph-notif-loading {
  padding: 16px 14px;
  display: grid;
  gap: 9px;
}

.ph-notif-loading span {
  height: 72px;
  border-radius: 12px;
  background:
    linear-gradient(
      100deg,
      var(--ph-surface-2) 20%,
      var(--ph-surface) 45%,
      var(--ph-surface-2) 70%
    );
  background-size: 220% 100%;
  animation: workspace-attention-shimmer 1.35s linear infinite;
}

.ph-notif-more {
  min-height: 42px;
  margin: 4px auto 18px;
  padding: 0 18px;
  border: 1px solid var(--ph-border);
  border-radius: 999px;
  background: var(--ph-surface);
  color: var(--ph-text);
  display: block;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.ph-notif-more:disabled,
.ph-notif-chip:disabled {
  opacity: 0.55;
}

.ph-notif-prefs {
  padding: 8px 14px 28px;
}

.ph-notif-prefs-lead {
  margin: 4px 2px 14px;
  color: var(--ph-text-2);
  line-height: 1.45;
}

.ph-notif-pref {
  margin-bottom: 7px;
  padding: 13px;
  border: 1px solid var(--ph-hairline);
  border-radius: 13px;
  background: var(--ph-surface-2);
}

.ph-notif-pref-copy {
  gap: 3px;
}

.ph-notif-pref-copy strong {
  font-size: 14px;
}

.ph-notif-pref-copy span {
  color: var(--ph-text-2);
  line-height: 1.35;
}

.ph-notif-pref-chips {
  gap: 5px;
  padding: 3px;
  border: 1px solid var(--ph-border);
  border-radius: 10px;
  background: var(--ph-bg);
}

.ph-notif-chip {
  min-height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
}

.ph-notif-chip.is-on {
  background: var(--ph-accent-strong);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--ph-accent) 28%, transparent);
}

[data-theme="light"] .ph-notif-tabs button.is-on {
  box-shadow: 0 2px 8px rgba(17, 17, 20, 0.08);
}

[data-theme="light"] .ph-notif-pref {
  border-color: rgba(17, 17, 20, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  .ph-notif-loading span {
    animation: none;
  }
}

/* ── SelectMenu — the app-styled replacement for a raw <select> ────────────────
   System menus (raw <select>) are banned for in-app pickers: the OS draws them,
   ignoring the app's theme. The trigger wears whatever box class the surface
   already uses (e.g. .autobuild-select); the panel wears the canonical
   tag-picker popover chrome, portaled to <body> and positioned fixed from the
   trigger rect so ancestor overflow clipping can never eat it. */
.selectmenu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  text-align: left;
}
.selectmenu-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.selectmenu-trigger .selectmenu-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selectmenu-trigger .selectmenu-label.is-placeholder {
  color: var(--text-muted);
}
.selectmenu-trigger > svg {
  color: var(--text-muted);
}
/* A trigger wearing a <select> box class (e.g. task-modal-chip-select) would
   paint that class's background-image caret on top of the trigger's own svg
   caret — keep only the svg, and give back the caret's reserved padding. */
.selectmenu-trigger.task-modal-chip-select { background-image: none; padding-right: 7px; }
/* The trigger is a <button>, so it picks up the global button rule: bold text
   and shrink-to-fit. A <select> is normal weight and full width, and these
   triggers stand in a column of text inputs — match those, not the buttons. */
.selectmenu-trigger.properties-input-text { font-weight: inherit; width: 100%; }
/* Same for the automation/shortcut builder box: .autobuild-select gives the
   border, padding and background but never set a weight, because a <select> is
   normal weight for free. Width comes from .grow where the surface asks for it. */
.selectmenu-trigger.autobuild-select { font-weight: 400; }
/* 🔴 THE DEFAULT GLUE — put this on any trigger replacing a <select> that had NO
   box class of its own. Such a select wore the shared `select, button` rule plus
   `select { width: 100% }`, so swapping in a <button> silently loses exactly two
   things: full width, and normal weight (`button { font-weight: 700 }` wins over
   the shared `font: inherit`). Everything else — border, radius, background,
   padding — the button already shares. */
.selectmenu-trigger.selectmenu-trigger-plain { width: 100%; font-weight: 400; }
/* Inbox, contacts and phone hosts: each class already carries its own box and
   width, so the trigger only needs the normal weight back — a <select> had it for
   free, and the global button rule takes it away. */
.selectmenu-trigger.inbox-cid-detail-input,
.selectmenu-trigger.inbox-email-head-input,
.selectmenu-trigger.inbox-call-via-select,
.selectmenu-trigger.inbox-ctype-input,
.selectmenu-trigger.ph-blockform-input,
.selectmenu-trigger.ph-streamset-input,
.selectmenu-trigger.ph-email-template-select { font-weight: 400; }
/* Settings and admin hosts that carry their own box but never set a weight. */
.selectmenu-trigger.uap-template-select { font-weight: 400; }
/* The reservations filter rows: .filter-select / .filter-input already set height,
   padding and width, so only the weight is missing. */
.selectmenu-trigger.filter-select,
.selectmenu-trigger.filter-input { font-weight: 400; }
/* The portaled variant of the tag-picker chrome. The panel is rendered into
   <body> with createPortal and positioned from the trigger's measured rect, so
   it must override the in-page `position: absolute; top: 100%` shape above.
   🔴 z-index BELONGS TO THAT OVERRIDE. `.properties-tag-picker` sets z-index 90,
   which is fine for a picker sitting inside a pane, but the panel is a child of
   <body> competing with the app's whole overlay band (modals 9999–10050, call
   and composer popovers 12000, the calendar cell menu 14000, the command
   palette backdrop 14100). Inheriting 90 put the open menu UNDERNEATH its own
   host dialog — visible through the backdrop but impossible to click. That hit
   every styled menu opened inside a modal (~38 surfaces: the memory sheet, the
   property/owner filter modals, the task stream and share dialogs, the phone
   sheets…). Stay above the ceiling; a menu the user is actively driving is the
   top thing on screen for as long as it is open. */
.selectmenu-panel.properties-tag-picker {
  position: fixed;
  z-index: 14200;
  top: auto;
  left: auto;
  width: auto;
  max-width: 340px;
}
.selectmenu-panel .properties-tag-picker-list {
  max-height: min(300px, 55vh);
  outline: none;
}
.selectmenu-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.selectmenu-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Keyboard-active row mirrors hover exactly — arrows and mouse read the same. */
.quick-filter-item.is-kb {
  background: var(--surface-muted);
  color: var(--text-primary);
}

/* ── Mixed AND/OR condition groups (automation builder IF block) ─────────────
   A sub-group is a dashed card holding its own condition rows and its own
   AND/OR toggle, so "(A and B) or C" reads as one card plus one row. */
.autobuild-cond-actions {
  display: flex;
  gap: 8px;
}
.autobuild-subgroup {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 55%, transparent);
}
.autobuild-subgroup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.autobuild-subgroup-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Global call continuity ─────────────────────────────────────────────────
   The real media connection stays in one browser document. Other UOS windows
   render this compact mirror and send controls back to that owner. */
.global-call-mirror-shell {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 11950;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.global-call-float-error {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 12050;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(430px, calc(100vw - 32px));
  padding: 11px 12px 11px 14px;
  border: 1px solid color-mix(in srgb, var(--state-error) 48%, var(--border-subtle));
  border-radius: 13px;
  color: var(--text-primary);
  font-size: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 18px 48px rgba(2, 10, 24, 0.28);
}
.global-call-float-error > span { flex: 1 1 auto; }
.global-call-float-error > button {
  border: 0;
  color: var(--text-primary);
  background: var(--surface-muted);
  cursor: pointer;
}
.global-call-float-error-action {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.global-call-float-error-dismiss {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--text-muted);
}
.global-call-card {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--border-strong) 78%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg-elevated) 96%, transparent);
  color: var(--text-primary);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  pointer-events: auto;
  animation: global-call-card-in 160ms ease-out;
}
.global-call-card-head {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.global-call-card-head.is-draggable,
.uos-call-picker-head.is-draggable,
.uos-call-stage-head.is-draggable {
  position: relative;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.global-call-mirror-shell.is-dragging .global-call-card-head,
.uos-call-picker.is-dragging .uos-call-picker-head,
.uos-call-stage.is-dragging .uos-call-stage-head {
  cursor: grabbing;
}
.global-call-mirror-shell.is-dragging,
.uos-call-picker.is-dragging,
.uos-call-stage.is-dragging {
  will-change: left, top;
}
.call-surface-drag-grip {
  position: absolute;
  top: -13px;
  left: 50%;
  display: grid;
  width: 34px;
  height: 14px;
  place-items: center;
  transform: translateX(-50%);
  color: var(--text-muted);
  opacity: 0.72;
  pointer-events: none;
}
.global-call-card-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 17px;
  font-weight: 750;
  background: color-mix(in srgb, var(--accent) 22%, var(--surface-muted));
}
.global-call-card-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.global-call-card-copy strong,
.global-call-card-copy small,
.global-call-card-kicker {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-call-card-copy strong {
  font-size: 14px;
}
.global-call-card-copy small,
.global-call-card-owner-note {
  color: var(--text-muted);
  font-size: 11px;
}
.global-call-card-kicker {
  color: color-mix(in srgb, var(--accent) 84%, var(--text-primary));
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.global-call-card-state {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  background: var(--surface-muted);
}
.global-call-card-state.is-active {
  color: var(--state-success, #16a05d);
}
.global-call-card-owner-note {
  margin: -2px 0 0 52px;
}
.global-call-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}
.global-call-card-button {
  display: inline-flex;
  min-width: 58px;
  min-height: 44px;
  flex: 1 1 58px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-primary);
  background: var(--surface-muted);
  cursor: pointer;
}
.global-call-card-button:hover {
  background: var(--surface-hover);
}
.global-call-card-button span {
  font-size: 10px;
  font-weight: 650;
}
.global-call-card-button.is-active {
  color: var(--accent);
}
.global-call-card-button.is-answer {
  border-color: transparent;
  color: #06170e;
  background: var(--state-success, #22c96f);
}
.global-call-card-button.is-danger {
  border-color: transparent;
  color: #fff;
  background: var(--state-danger, #e14355);
}
@keyframes global-call-card-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}
@media (max-width: 768px) {
  .global-call-mirror-shell {
    top: auto;
    right: 12px;
    bottom: max(108px, calc(92px + env(safe-area-inset-bottom)));
    width: calc(100vw - 24px);
  }
}

/* ── UOS app-to-app calling ─────────────────────────────────────────────────
   One global layer for desktop + phone. Telnyx carries media; these classes
   deliberately speak only in UOS product language. */
.uos-call-minimized {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  z-index: 13000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 6px;
  width: min(390px, calc(100vw - 32px));
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--border-strong) 78%, transparent);
  border-radius: 16px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}
.uos-call-minimized-main {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px 7px;
  border: 0;
  border-radius: 11px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.uos-call-minimized-main:hover {
  background: var(--surface-hover);
}
.uos-call-minimized-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #052e16;
  background: #22c55e;
}
.uos-call-minimized-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.uos-call-minimized-copy strong,
.uos-call-minimized-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-call-minimized-copy strong {
  font-size: 13px;
  font-weight: 760;
}
.uos-call-minimized-copy small {
  color: var(--text-muted);
  font-size: 11px;
}
.uos-call-minimized-leave {
  display: inline-flex;
  min-width: 76px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: #e14343;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.uos-call-minimized-leave:hover {
  background: #c93434;
}
.uos-call-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 42%),
    color-mix(in srgb, #07111f 62%, transparent);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}
.uos-call-picker,
.uos-call-stage {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid color-mix(in srgb, var(--border-strong) 78%, transparent);
  border-radius: 24px;
  background: color-mix(in srgb, var(--bg-elevated) 94%, transparent);
  color: var(--text-primary);
  box-shadow: 0 28px 80px rgba(1, 8, 18, 0.38);
}
.uos-call-picker {
  overflow: hidden;
}
.uos-call-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.uos-call-picker-head h2,
.uos-call-stage h2 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.uos-call-picker-head p,
.uos-call-stage > p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}
.uos-call-picker-head > button,
.uos-call-minimize {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-secondary);
  background: var(--surface-muted);
}
.uos-call-picker-head > button:hover,
.uos-call-minimize:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.uos-call-eyebrow {
  color: color-mix(in srgb, var(--accent) 82%, var(--text-primary));
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.uos-call-candidates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(420px, 55vh);
  padding: 10px;
  overflow: auto;
}
.uos-call-candidate {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
}
.uos-call-candidate:not(:disabled):hover {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-muted));
}
.uos-call-candidate:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
.uos-call-avatar,
.uos-call-hero-avatar {
  display: inline-flex;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}
.uos-call-candidate-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.uos-call-candidate-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-call-candidate-copy > span {
  color: var(--text-muted);
  font-size: 11px;
}
.uos-call-candidate-copy > span.is-available {
  color: #22a56c;
}
.uos-call-candidate-action {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #087a4d;
  background: color-mix(in srgb, #21bf7b 16%, transparent);
}
.uos-call-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 112px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.uos-call-error {
  margin: 0 14px 14px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--danger-text, #b42318);
  font-size: 12px;
  background: color-mix(in srgb, #ef4444 10%, transparent);
}
.uos-call-recording-note {
  margin: 0;
  padding: 0 22px 16px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}
.uos-call-recording-note.is-stage {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 0;
}
.uos-call-recording-note.is-stage > span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e14343;
  box-shadow: 0 0 0 4px color-mix(in srgb, #e14343 12%, transparent);
}
.uos-call-stage {
  position: relative;
  display: flex;
  min-height: 510px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 34px 36px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 22%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 36%),
    color-mix(in srgb, var(--bg-elevated) 96%, transparent);
}
.uos-call-minimize {
  position: absolute;
  top: 16px;
  right: 16px;
}
.uos-call-hero-avatar {
  width: 88px;
  height: 88px;
  margin: 26px 0 18px;
  box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 22%, transparent);
}
.uos-call-stage > h2 {
  font-size: 28px;
}
.uos-call-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  margin-top: 20px;
  color: var(--text-secondary);
  font-size: 12px;
}
.uos-call-status.is-error {
  color: var(--danger-text, #dc2626);
}
.uos-call-status.is-connected {
  color: color-mix(
    in srgb,
    var(--state-success) 76%,
    var(--text-primary)
  );
  font-weight: 680;
}
.uos-call-audio-issue {
  display: flex;
  width: min(420px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 20px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--state-warning) 38%, var(--border-subtle));
  border-radius: 14px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--state-warning) 10%, var(--surface-muted));
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}
.uos-call-audio-issue > button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  font: inherit;
  font-weight: 680;
}
.uos-call-audio-issue > button:disabled {
  cursor: wait;
  opacity: 0.62;
}
.uos-call-connected-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--state-success);
  box-shadow: 0 0 0 4px
    color-mix(in srgb, var(--state-success) 14%, transparent);
}
.uos-call-roster {
  display: grid;
  width: min(320px, 100%);
  max-height: 150px;
  gap: 5px;
  margin-top: 18px;
  padding: 7px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-muted) 76%, transparent);
  text-align: left;
}
.uos-call-roster-person {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 4px 7px;
  border-radius: 10px;
}
.uos-call-roster-person > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.uos-call-roster-person strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-call-roster-person small {
  color: var(--text-muted);
  font-size: 10px;
}
.uos-call-roster-person.is-active small {
  color: #20ad69;
}
.uos-call-roster-person.is-declined small,
.uos-call-roster-person.is-missed small,
.uos-call-roster-person.is-failed small,
.uos-call-roster-person.is-left small,
.uos-call-roster-person.is-cancelled small {
  color: var(--danger-text, #dc2626);
}
.uos-call-roster-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.uos-call-controls {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 38px;
  min-height: 82px;
  margin-top: 46px;
}
.uos-call-picker .uos-call-controls {
  min-height: 70px;
  margin: 0 0 10px;
}
.uos-call-control {
  display: inline-flex;
  width: 72px;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  border: 0;
  color: var(--text-primary);
  font-size: 11px;
  background: transparent;
}
.uos-call-control > svg {
  box-sizing: content-box;
  padding: 17px;
  border-radius: 50%;
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}
.uos-call-control:hover > svg {
  background: var(--surface-hover);
}
.uos-call-control:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.uos-call-control:disabled:hover > svg {
  background: var(--surface-muted);
}
.uos-call-control.is-muted > svg {
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-primary) 14%, var(--surface-muted));
}
.uos-call-control.is-decline > svg {
  color: #fff;
  background: #e14343;
  box-shadow: none;
}
.uos-call-control.is-answer > svg {
  color: #fff;
  background: #20ad69;
  box-shadow: none;
}
.uos-call-toast {
  position: fixed;
  z-index: 12000;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 12px 11px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  color: var(--text-primary);
  font-size: 12px;
  background: var(--bg-elevated);
  box-shadow: 0 18px 48px rgba(2, 10, 24, 0.24);
  pointer-events: none;
}
.uos-call-toast > button {
  width: 44px;
  height: 44px;
  margin: -9px -9px -9px 0;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--surface-muted);
  pointer-events: auto;
  touch-action: manipulation;
}
.uos-call-spin {
  animation: uos-call-spin 0.8s linear infinite;
}
@keyframes uos-call-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 680px) {
  .uos-call-backdrop {
    align-items: end;
    padding: 12px 12px calc(82px + env(safe-area-inset-bottom));
    pointer-events: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .uos-call-picker,
  .uos-call-stage {
    width: 100%;
    height: auto;
    max-height: min(68vh, 620px);
    overflow: auto;
    pointer-events: auto;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background: var(--bg-elevated);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  }
  .uos-call-picker {
    display: flex;
    flex-direction: column;
  }
  .uos-call-candidates {
    max-height: none;
    flex: 1;
  }
  .uos-call-stage {
    min-height: 0;
    justify-content: flex-start;
    padding: 34px 22px 22px;
  }
  .uos-call-minimize {
    top: 12px;
    right: 12px;
  }
  .uos-call-hero-avatar {
    width: 62px;
    height: 62px;
    margin: 15px 0 10px;
  }
  .uos-call-stage > h2 {
    font-size: 22px;
  }
  .uos-call-recording-note.is-stage {
    margin-top: 9px;
  }
  .uos-call-roster {
    max-height: 128px;
    margin-top: 12px;
  }
  .uos-call-status {
    margin-top: 12px;
  }
  .uos-call-controls {
    min-height: 70px;
    margin-top: 20px;
  }
  .uos-call-toast {
    right: 12px;
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
}

/* UOS call dock v2. A call is persistent app state, not a modal: keep the
   Inbox usable, use an opaque surface on phone, and expose ordinary call
   controls without forcing the User into a full-screen overlay. */
.uos-call-backdrop {
  align-items: start;
  justify-items: end;
  padding: 68px 20px 20px;
  pointer-events: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.uos-call-picker,
.uos-call-stage {
  pointer-events: auto;
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.34);
}
.uos-call-picker {
  width: min(390px, calc(100vw - 32px));
}
.uos-call-audience-picker {
  padding: 12px;
}
.uos-call-stavros-action {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 46%, var(--border-subtle));
  border-radius: 15px;
  color: var(--text-primary);
  text-align: left;
  background:
    radial-gradient(circle at 12% 50%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 38%),
    color-mix(in srgb, var(--accent) 10%, var(--surface-muted));
}
.uos-call-stavros-action > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.uos-call-stavros-action strong {
  font-size: 13px;
}
.uos-call-stavros-action small {
  color: var(--text-muted);
  font-size: 11px;
}
.uos-call-stavros-action > svg {
  color: var(--state-success);
}
.uos-call-stavros-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
.uos-call-stavros-avatar,
.uos-call-hero-avatar.is-stavros,
.uos-call-roster-avatar.is-stavros {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: color-mix(in srgb, var(--accent) 86%, var(--text-primary));
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-muted));
}
.uos-call-stavros-avatar {
  width: 40px;
  height: 40px;
}
.uos-call-ring-everyone {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border-subtle));
  border-radius: 14px;
  color: var(--text-primary);
  text-align: left;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface-muted));
}
.uos-call-ring-everyone > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.uos-call-ring-everyone strong {
  font-size: 13px;
}
.uos-call-ring-everyone small {
  color: var(--text-muted);
  font-size: 11px;
}
.uos-call-picker-divider {
  padding: 14px 4px 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.uos-call-audience-picker .uos-call-candidates {
  max-height: min(300px, 38vh);
  padding: 0;
}
.uos-call-candidate.is-selected {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 11%, var(--surface-muted));
}
.uos-call-candidates.is-direct {
  gap: 10px;
  overflow: visible;
}
.uos-call-candidate.is-direct {
  grid-template-columns: 44px minmax(0, 1fr);
  padding: 13px;
  border-color: var(--border-subtle);
  background: var(--surface-muted);
}
.uos-call-candidate-select {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--bg-elevated);
  background: transparent;
}
.uos-call-candidate.is-selected .uos-call-candidate-select {
  border-color: var(--accent);
  background: var(--accent);
}
.uos-call-selected-action {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  color: var(--bg-elevated);
  background: var(--text-primary);
  font-size: 12px;
  font-weight: 720;
}
.uos-call-selected-action:disabled,
.uos-call-ring-everyone:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}
.uos-call-selected-action.is-secondary {
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: var(--surface-muted);
}
.uos-call-stage {
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100dvh - 88px);
  min-height: 0;
  align-items: stretch;
  justify-content: flex-start;
  padding: 16px;
  border-radius: 20px;
  text-align: left;
  background: var(--bg-elevated);
}
.uos-call-stage-head {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
}
.uos-call-stage-copy {
  min-width: 0;
}
.uos-call-stage-copy h2 {
  overflow: hidden;
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-call-stage-copy p {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-call-hero-stack {
  display: flex;
  min-width: 44px;
  align-items: center;
}
.uos-call-hero-stack.is-group {
  padding-right: 16px;
}
.uos-call-hero-stack .uos-call-hero-avatar + .uos-call-hero-avatar {
  margin-left: -16px;
}
.uos-call-hero-stack .uos-call-hero-avatar {
  position: relative;
  border: 2px solid var(--bg-elevated);
}
.uos-call-stage .uos-call-hero-avatar {
  width: 44px;
  height: 44px;
  margin: 0;
  box-shadow: none;
}
.uos-call-stage .uos-call-minimize {
  position: static;
  width: 34px;
  height: 34px;
}
.uos-call-minimize-label {
  display: none;
}
.uos-call-stage-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}
.uos-call-stage .uos-call-recording-note.is-stage {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}
.uos-call-roster-toggle {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 10px;
  background: var(--surface-muted);
}
.uos-call-roster-toggle.is-open {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
}
.uos-call-stage .uos-call-roster {
  grid-template-columns: 1fr;
  width: 100%;
  max-height: min(340px, 48vh);
  margin-top: 10px;
  background: var(--surface-muted);
}
.uos-call-roster-group {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.uos-call-roster-group + .uos-call-roster-group {
  margin-top: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}
.uos-call-roster-group > h3 {
  margin: 0;
  padding: 0 7px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.uos-call-roster-group-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}
.uos-call-invite-notice {
  padding: 8px 9px;
  border: 1px solid color-mix(in srgb, var(--state-success) 34%, var(--border-subtle));
  border-radius: 10px;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--state-success) 9%, var(--bg-input));
  font-size: 10px;
  line-height: 1.35;
}
.uos-call-invite-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  padding: 7px;
  border-top: 1px solid var(--border-subtle);
}
.uos-call-add-people,
.uos-call-invite-refresh,
.uos-call-invite-submit {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--bg-input);
  font: inherit;
  font-size: 11px;
  font-weight: 680;
}
.uos-call-add-people {
  width: 100%;
}
.uos-call-invite-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 8px;
}
.uos-call-invite-head > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.uos-call-invite-head strong {
  font-size: 12px;
}
.uos-call-invite-head small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}
.uos-call-invite-head > button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--surface-hover);
}
.uos-call-invite-candidates {
  display: grid;
  gap: 5px;
}
.uos-call-invite-candidate {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-primary);
  text-align: left;
  background: var(--bg-input);
}
.uos-call-invite-candidate > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.uos-call-invite-candidate strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-call-invite-candidate small {
  color: var(--text-muted);
  font-size: 9px;
}
.uos-call-invite-candidate.is-selected {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-input));
}
.uos-call-invite-candidate:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}
.uos-call-invite-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  color: var(--text-muted);
  font-size: 10px;
}
.uos-call-invite-error {
  margin: 0;
  color: var(--danger-text, #dc2626);
  font-size: 10px;
}
.uos-call-invite-actions {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px;
}
.uos-call-invite-refresh {
  padding: 0 10px;
  color: var(--text-secondary);
}
.uos-call-invite-submit {
  border-color: var(--state-success);
  color: #071b10;
  background: var(--state-success);
}
.uos-call-invite-refresh:disabled,
.uos-call-invite-submit:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.uos-call-roster-avatar-wrap {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
}
.uos-call-roster-person.is-speaking .uos-call-roster-avatar-wrap {
  box-shadow:
    0 0 0 2px var(--state-success),
    0 0 0 5px color-mix(in srgb, var(--state-success) 18%, transparent);
}
.uos-call-roster-person.is-speaking small {
  color: var(--state-success);
  font-weight: 720;
}
.uos-call-roster-person.is-media-muted small {
  color: var(--text-muted);
}
.uos-call-roster-muted-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 2px solid var(--surface-muted);
  border-radius: 50%;
  color: #fff;
  background: #626273;
}
.uos-call-stage .uos-call-status {
  justify-content: center;
  margin-top: 10px;
}
.uos-call-audio-routes {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-muted);
}
.uos-call-audio-routes > span {
  padding: 1px 3px 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.uos-call-audio-routes > button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-primary);
  text-align: left;
  background: transparent;
}
.uos-call-audio-routes > button[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border-subtle));
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-input));
}
.uos-call-audio-routes > button:disabled {
  opacity: 0.6;
}
.uos-call-audio-routes > button > span {
  overflow: hidden;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uos-call-audio-routes > button > svg:last-child {
  color: var(--accent);
}
.uos-call-stage .uos-call-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  width: 100%;
  justify-content: space-evenly;
  gap: 8px;
  min-height: 0;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}
.uos-call-stage .uos-call-control {
  width: 100%;
  gap: 6px;
}
.uos-call-stage .uos-call-control > svg {
  padding: 13px;
}
.uos-call-control.is-active > svg {
  color: var(--bg-elevated);
  background: var(--text-primary);
}
.uos-call-report-problem {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.uos-call-report-problem:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--surface-muted);
}
.uos-call-report-problem:disabled {
  cursor: default;
  opacity: 0.72;
}

@media (max-width: 640px) {
  .uos-call-minimized {
    display: none;
  }
}

@media (max-width: 680px) {
  .uos-call-backdrop.is-incoming,
  .uos-call-backdrop.is-outgoing,
  .uos-call-backdrop.is-connecting,
  .uos-call-backdrop.is-ended {
    display: block;
    padding: 0;
    pointer-events: auto;
    background: var(--bg-elevated);
  }
  .uos-call-backdrop.is-incoming .uos-call-stage,
  .uos-call-backdrop.is-outgoing .uos-call-stage,
  .uos-call-backdrop.is-connecting .uos-call-stage,
  .uos-call-backdrop.is-ended .uos-call-stage {
    width: 100%;
    height: 100dvh;
    max-height: none;
    padding:
      calc(14px + env(safe-area-inset-top))
      18px
      calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .uos-call-stage-head {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
  }
  .uos-call-stage .uos-call-minimize {
    display: inline-flex;
    width: auto;
    min-width: 42px;
    height: 38px;
    align-items: center;
    gap: 5px;
    padding: 0 11px;
    border-radius: 999px;
  }
  .uos-call-minimize-label {
    display: inline;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }
  .uos-call-backdrop.is-incoming .uos-call-controls,
  .uos-call-backdrop.is-outgoing .uos-call-controls,
  .uos-call-backdrop.is-connecting .uos-call-controls,
  .uos-call-backdrop.is-ended .uos-call-controls {
    margin-top: auto;
    padding-top: 24px;
  }
  .uos-call-backdrop {
    padding:
      calc(68px + env(safe-area-inset-top))
      10px
      10px;
  }
  .uos-call-picker,
  .uos-call-stage {
    width: 100%;
    max-height: min(58vh, 460px);
    border-radius: 20px;
    background: var(--bg-elevated);
  }
  .uos-call-stage {
    padding: 14px;
  }
  .uos-call-stage .uos-call-roster {
    /* Two people plus the closed Add people row need 148px including the
       roster's padding and gaps. The old 132px ceiling cut through that action
       on iPhone even though the full-screen call had ample vertical room. */
    max-height: clamp(160px, 28dvh, 240px);
  }
  .uos-call-roster-group-people {
    grid-template-columns: 1fr;
  }
  .uos-call-stage .uos-call-roster.is-inviting {
    max-height: min(52dvh, 430px);
  }
  .uos-call-stage-meta {
    align-items: flex-start;
  }
  .uos-call-stage .uos-call-controls {
    margin-top: 12px;
  }
  .uos-call-toast {
    top: calc(68px + env(safe-area-inset-top));
    right: 10px;
    bottom: auto;
  }
}

/* ── Phone email compose sheet ─────────────────────────────────────────────
   Hakim 2026-07-28: "it should just look like any email app phone composer."
   The bar carries a one-line trigger (.ph-mail-trigger); writing happens in a
   full-screen sheet (.ph-mailsheet) portalled to <body> — GMAIL grammar
   (Hakim 2026-07-28, specced from his own Gmail screenshot): a top bar of
   icons only (close · attach · send · ⋯), flat hairline field rows (To with
   a Cc/Bcc expander · From · Subject), then the body filling the rest of the
   screen with the signature rendered inline. No floating controls below the
   top bar — the old mid-sheet Attach chip and bottom Signature toggle row
   are exactly what got this sheet rejected. Root is `.ph-details
   .ph-mailsheet` so the ph theme variables ride along (D8 scope rule);
   everything below uses tokens, light and dark by construction. */
.ph-mail-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
}
.ph-mail-trigger svg {
  flex: none;
  color: var(--text-muted);
}
.ph-mail-trigger-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ph-mail-trigger-text strong {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-mail-trigger-text small {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-mailsheet {
  display: flex;
  flex-direction: column;
}
/* Round 2 polish (Hakim 2026-07-29 "still a bit ugly and cheap"): Gmail's
   actual measures — 16px field/body text (layout.tsx pins maximumScale:1, so
   16px carries no iOS focus-zoom risk), ~52px rows, hairlines demoted to
   --border-subtle so they stop dominating, and the top bar's icons given
   real air instead of a 2px huddle. */
.ph-mailsheet-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 10px 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.ph-mailsheet-close,
.ph-mailsheet-tool {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--text);
}
.ph-mailsheet-close svg,
.ph-mailsheet-tool svg {
  flex: none;
}
.ph-mailsheet-close:active,
.ph-mailsheet-tool:active {
  background: var(--surface-2);
}
.ph-mailsheet-spacer {
  flex: 1;
}
.ph-mailsheet-send {
  color: var(--accent);
}
.ph-mailsheet-send:disabled {
  color: var(--text-muted);
  opacity: 0.5;
}
.ph-mailsheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  display: flex;
  flex-direction: column;
}
/* The head rows reuse the .ph-email-row markup but wear Gmail's chrome here:
   full-width rows divided by hairlines — no boxes, no pills, no radii. */
.ph-mailsheet .ph-email-head {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.ph-mailsheet .ph-email-row {
  position: relative; /* anchors the full-width suggestion menu below */
  min-height: 52px;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.ph-mailsheet .ph-email-label {
  width: auto;
  min-width: 34px;
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
}
.ph-mailsheet .ph-email-row .ph-email-input {
  height: 50px;
  border: none;
  border-radius: 0;
  background: none;
  padding: 0;
  font-size: 16px;
}
.ph-email-expand {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
}
/* From — a full-width row; rendered as a <button> when it opens the picker. */
.ph-email-fromrow {
  width: 100%;
  border-style: none;
  background: none;
  padding: 0;
  font-family: inherit;
  color: inherit;
  text-align: left;
  display: flex;
  align-items: center;
}
.ph-email-fromval {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-email-fromcaret {
  flex: none;
  color: var(--text-muted);
}
.ph-mailsheet .ph-email-subject {
  height: 52px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: none;
  padding: 0;
  font-size: 16px;
  font-weight: 500;
}
.ph-mailsheet .ph-ctx-chip {
  margin-top: 10px;
}
/* The writing area IS the rest of the sheet. Same PhoneComposerInput; its
   textarea auto-grows (the JS autosize measures scrollHeight) and the height
   cap is lifted here, so the body flows like a document: text, then staged
   attachments, then the signature directly beneath — and the empty space
   below drops the caret into the body via the wrapper's click handler. */
.ph-mailsheet-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 12px;
}
.ph-mailsheet-editor .ph-composer-field-shell {
  border: none;
  background: none;
  padding: 0;
}
.ph-mailsheet-editor .ph-composer-field {
  min-height: 4.5rem;
  max-height: none;
  overflow-y: hidden;
  font-size: 16px;
  line-height: 1.5;
  background: none;
  border: none;
  /* The base field is the chat bubble and keeps its 21px pill radius. With
     padding stripped to 0 here, that (invisible) curve clips the textarea's
     own glyphs — the first letter of line one lost its edge (Hakim's
     screenshot, 2026-07-29). A textarea crops to its border box, radius
     included, so the flat document look needs the radius flattened too. */
  border-radius: 0;
  padding: 0;
}
.ph-mailsheet-editor .ph-att-row {
  margin-top: 10px;
}
.ph-mailsheet-sig {
  margin-top: 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}
/* Inline (plain/rich) signatures: honour an <img>'s own width/height attrs —
   the srcdoc stylesheet's exact rule. A blanket height:auto here is what blew
   Hakim's height="200" logo to full width (2026-07-29). */
.ph-mailsheet-sig img {
  max-width: 100%;
}
.ph-mailsheet-sig img:not([width]):not([height]) {
  height: auto;
}
/* "html"-mode signatures render in the canonical white email card
   (EmailHtmlFrame). White stays white in dark mode BY DESIGN — same as every
   received email (rf_inbox_email_rendering). */
.ph-mailsheet-sig.is-card .inbox-email-frame {
  border-radius: 12px;
}
/* Stavros' ghost draft in the mail sheet body (email parity, 2026-07-29).
   The base .is-phone ghost is shaped for the chat pill — inset 1px, 14px side
   padding, 20px radius. This field is a flat document with padding 0, so the
   ghost text must sit exactly where typed text would, at the body's size. */
.ph-mailsheet-editor .ph-composer-field-shell .inbox-predictive-ghost.is-phone {
  inset: 0;
  padding: 0;
  border-radius: 0;
}
.ph-mailsheet-editor .inbox-predictive-ghost-text {
  font-size: 16px;
  line-height: 1.5;
}
/* NOTE: do not try to lift .ph-brain above the mail sheet with z-index. The
   brain renders inside .phone-app (position: fixed, z 60 — a stacking
   context), so its own z-index can never compete with this body-portalled
   .ph-details (95). The sheet's Stavros button closes the sheet before
   opening him instead; the draft survives by the round-1 law. */
/* The recipient suggestion menu, phone-native (Gmail grammar): full-bleed
   under the row being typed in, 52px+ tappable rows, name over address,
   avatar disc, flat edges. The wrap goes static so the ROW (position:
   relative above) is the anchor; -16px matches .ph-mailsheet-body's side
   padding. */
.ph-mailsheet .inbox-recip-wrap {
  position: static;
}
.ph-mailsheet .inbox-recip-menu {
  top: 100%;
  left: -16px;
  right: -16px;
  padding: 4px 0;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  box-shadow: 0 22px 28px -20px color-mix(in srgb, var(--text-primary) 26%, transparent);
  max-height: 44vh;
}
.ph-mailsheet .inbox-recip-option {
  gap: 12px;
  min-height: 56px;
  padding: 8px 16px;
  border-radius: 0;
}
.ph-mailsheet .inbox-recip-avatar,
.ph-mailsheet .inbox-recip-avatar-ph {
  width: 30px;
  height: 30px;
}
.ph-mailsheet .inbox-recip-option-name {
  font-size: 16px;
}
.ph-mailsheet .inbox-recip-option-email {
  font-size: 13.5px;
}
.ph-mailsheet .inbox-recip-option-badge {
  font-size: 11px;
}
/* Rows in the sheet's bottom menus (⋯ overflow and Send-from picker). */
a.ph-sheet-row {
  color: inherit;
  text-decoration: none;
}
.ph-fromopt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.ph-fromopt-addr {
  max-width: 100%;
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-fromopt-check {
  flex: none;
  color: var(--accent);
}

/* ---- Business contact People section (ContactIdentityCard, spec 2026-08-01).
   Theme tokens only — light + dark parity for free. ---- */
.inbox-cid-people { list-style: none; margin: 0 0 0.4rem; padding: 0; display: grid; gap: 0.3rem; }
.inbox-cid-person {
  display: flex; align-items: center; gap: 0.45rem;
  border: 1px solid var(--border-subtle); border-radius: 8px;
  background: var(--surface-muted); padding: 0.3rem 0.45rem;
}
.inbox-cid-person-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.inbox-cid-person-name {
  display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--text-primary); font-size: 0.8rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.inbox-cid-poc-badge {
  background: var(--accent-soft, var(--surface-muted)); color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px;
  font-size: 0.62rem; font-weight: 700; padding: 0 0.4rem; line-height: 1.4;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.inbox-cid-person-title { color: var(--text-muted); font-size: 0.72rem; }
.inbox-cid-person-actions { display: inline-flex; gap: 0.3rem; }
.inbox-cid-person-actions button {
  border: 1px solid var(--border-subtle); background: transparent; color: var(--text-soft);
  border-radius: 6px; font: inherit; font-size: 0.7rem; padding: 0.12rem 0.4rem; cursor: pointer;
}
.inbox-cid-person-actions button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.inbox-cid-person-actions button:disabled { opacity: 0.5; cursor: default; }
.inbox-cid-people-empty { color: var(--text-muted); font-size: 0.76rem; margin: 0 0 0.4rem; }
.inbox-cid-people-results { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.2rem; }
.inbox-cid-people-results button {
  width: 100%; text-align: left; border: 1px solid var(--border-subtle); border-radius: 6px;
  background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 0.78rem;
  padding: 0.3rem 0.5rem; cursor: pointer;
}
.inbox-cid-people-results button:hover:not(:disabled) { border-color: var(--accent); }
.inbox-cid-people-error { color: var(--state-error); font-size: 0.74rem; margin: 0.3rem 0 0; }

/* ---------- Contact Details section (spec 2026-08-01-contact-crm-details) ----------
   Theme tokens only (§5 light+dark parity). Action buttons mirror
   .inbox-cid-person-actions; the add-menu mirrors .inbox-cid-people-results. */
.inbox-cid-details-group { display: grid; gap: 0.3rem; margin: 0 0 0.6rem; }
.inbox-cid-details-grouplabel {
  color: var(--text-muted); font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; margin: 0.15rem 0 0;
}
.inbox-cid-detail-row { display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.inbox-cid-detail-label {
  color: var(--text-muted); font-size: 0.75rem; flex: 0 0 auto; min-width: 7.2rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
}
.inbox-cid-detail-value {
  border: 0; background: transparent; padding: 0.1rem 0.25rem; margin: 0; cursor: pointer;
  color: var(--text-primary); font: inherit; font-size: 0.79rem; text-align: left;
  border-radius: 5px; flex: 1; min-width: 0; overflow-wrap: anywhere;
}
.inbox-cid-detail-value:hover { background: var(--surface-muted); }
.inbox-cid-detail-empty { color: var(--text-muted); }
.inbox-cid-detail-static { color: var(--text-primary); font-size: 0.79rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.inbox-cid-detail-editor { flex: 1; min-width: 0; }
.inbox-cid-detail-input {
  width: 100%; border: 1px solid var(--border-subtle); border-radius: 6px;
  background: var(--bg-input); color: var(--text-primary); font: inherit; font-size: 0.78rem;
  padding: 0.28rem 0.45rem;
}
.inbox-cid-detail-input:focus { outline: none; border-color: var(--accent); }
.inbox-cid-detail-caption { color: var(--text-muted); font-size: 0.7rem; flex-basis: 100%; margin: 0; }
.inbox-cid-detail-actions { display: inline-flex; gap: 0.3rem; }
.inbox-cid-detail-actions button,
.inbox-cid-detail-cancel,
.inbox-cid-detail-done,
.inbox-cid-detail-danger,
.inbox-cid-field-managebtn,
.inbox-cid-details-addbtn {
  border: 1px solid var(--border-subtle); background: transparent; color: var(--text-soft);
  border-radius: 6px; font: inherit; font-size: 0.7rem; padding: 0.12rem 0.4rem; cursor: pointer;
}
.inbox-cid-detail-actions button:hover:not(:disabled),
.inbox-cid-detail-cancel:hover:not(:disabled),
.inbox-cid-detail-done:hover:not(:disabled),
.inbox-cid-details-addbtn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.inbox-cid-detail-danger:hover:not(:disabled) { color: var(--state-error); border-color: var(--state-error); }
.inbox-cid-detail-actions button:disabled,
.inbox-cid-detail-danger:disabled { opacity: 0.5; cursor: default; }
.inbox-cid-details-addwrap { position: relative; }
.inbox-cid-details-addmenu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  list-style: none; margin: 0; padding: 0.25rem; display: grid; gap: 0.15rem;
  min-width: 11rem; max-height: 16rem; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border-subtle); border-radius: 8px;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--text-primary) 12%, transparent);
}
.inbox-cid-details-addmenu button {
  width: 100%; text-align: left; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-primary); font: inherit; font-size: 0.76rem;
  padding: 0.3rem 0.5rem; cursor: pointer;
}
.inbox-cid-details-addmenu button:hover { background: var(--surface-muted); }
.inbox-cid-detail-form { display: grid; gap: 0.3rem; margin: 0.15rem 0 0; }
.inbox-cid-detail-formactions { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.inbox-cid-detail-multi { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; flex: 1; min-width: 0; }
.inbox-cid-link-a { color: var(--accent); text-decoration: none; }
.inbox-cid-link-a:hover { text-decoration: underline; }
.inbox-cid-field-managewrap { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; margin-top: -0.15rem; }
.inbox-cid-field-managewrap .inbox-cid-detail-form { width: 100%; }
.inbox-cid-field-managebtn { border-color: transparent; padding: 0 0.3rem; }

/* ---- Website chat widget editor (Settings → Website chat) ----
   Two-column: sectioned form left, live preview right (WidgetPreview renders
   the REAL WidgetShell — its cw-* styles live in components/chat-widget/
   chat-widget.css and theme by config, not by app tokens). Everything here is
   app chrome, so app theme tokens only (light/dark parity). */
.cwidget-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 1.5rem; align-items: start; }
@container settings-main (max-width: 1100px) { .cwidget-layout { grid-template-columns: minmax(0, 1fr); } }
.cwidget-form { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.cwidget-form .leads-advanced { border: 1px solid var(--border); border-radius: 13px; padding: 0.85rem 1rem; background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .035); }
.cwidget-form .leads-advanced > summary { cursor: pointer; font-weight: 700; font-size: 0.92rem; letter-spacing: -.01em; }
.cwidget-form .leads-advanced[open] > summary { margin-bottom: 0.8rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--border); }

.cwidget-preview { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.cwidget-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.cwidget-preview-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cwidget-preview-toggle button { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.8rem; padding: 0.3rem 0.7rem; cursor: pointer; }
.cwidget-preview-toggle button.on { background: var(--surface); color: var(--text); font-weight: 600; }

/* Collapsed-button stage: a neutral fake page so the launcher reads in situ.
   data-cw-theme mirrors the widget's resolved theme (not the app theme) —
   hardcoded neutrals here are deliberate: they ARE the preview content. */
.cwidget-preview-stage { position: relative; height: 300px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #f6f6f8; }
.cwidget-preview-stage[data-cw-theme="dark"] { background: #1c1c22; }
.cwidget-preview-fakepage { display: flex; flex-direction: column; gap: 0.8rem; padding: 1.4rem; }
.cwidget-preview-bar { height: 12px; border-radius: 6px; background: rgba(127, 127, 140, 0.22); }
.cwidget-preview-launcher { position: absolute; bottom: 16px; right: 16px; }
.cwidget-preview-launcher.left { right: auto; left: 16px; }

/* Open-chat frame: the real WidgetShell at launcher size. */
.cwidget-preview-frame { height: 580px; max-height: 72vh; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: 0 20px 55px rgba(15, 23, 42, 0.14), 0 3px 10px rgba(15, 23, 42, .06); }
.cwidget-preview-frame .cw-shell { height: 100%; }

/* Knowledge panel */
.cwidget-kb { display: flex; flex-direction: column; gap: 0.7rem; }
.cwidget-kb-add { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.cwidget-kb-add .properties-input-text { flex: 1; min-width: 200px; }
.cwidget-kb-paste { display: flex; flex-direction: column; gap: 0.5rem; }
.cwidget-kb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.cwidget-kb-row { display: flex; align-items: center; gap: 0.6rem; border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.7rem; }
.cwidget-kb-kind { color: var(--text-muted); display: inline-flex; flex: none; }
.cwidget-kb-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cwidget-kb-title { font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Confirmed-guest support: the same Website Chat product, mounted inside the
   portal with booking identity inherited server-side. Keep it above the mobile
   tab bar and below full-screen portal sheets. */
.gp-chat {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 82;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.gp-chat-raised { bottom: max(88px, calc(72px + env(safe-area-inset-bottom))); }
.gp-chat-panel {
  width: min(380px, calc(100vw - 24px));
  height: min(580px, calc(100dvh - 145px));
  overflow: hidden;
  border: 1px solid rgba(6, 43, 19, .13);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(6, 43, 19, .20), 0 4px 14px rgba(6, 43, 19, .10);
}
.gp-chat-panel iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.gp-chat-button {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  padding: 0;
  background: var(--gp-primary, #42a418);
  color: #fff;
  box-shadow: 0 12px 30px rgba(6, 43, 19, .22), 0 2px 6px rgba(6, 43, 19, .12);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}
.gp-chat-button-open { background: #062b13; }
@media (max-width: 520px) {
  .gp-chat { right: 12px; }
  .gp-chat-panel { width: calc(100vw - 24px); height: min(620px, calc(100dvh - 142px)); }
}

/* ── HTML code editor (components/editor/HtmlCodeEditor.tsx) ──────────────────
   Chrome and layout live here; the CodeMirror theme object in
   components/editor/html-code-theme.ts carries only what CodeMirror insists on
   owning. Every colour resolves to an app token so light and dark follow the
   product without a second stylesheet. */
.htmlcode {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.htmlcode:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.htmlcode-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-muted);
}
.htmlcode-toolbar-spacer { flex: 1; }
.htmlcode-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding-right: 4px;
}
.htmlcode-surface { min-height: 220px; }
.htmlcode-surface .cm-editor { height: 100%; }
.htmlcode-surface .cm-editor.cm-focused { outline: none; }
.htmlcode-surface .cm-scroller {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}
.htmlcode-surface .cm-gutters {
  background: var(--surface-muted);
  color: var(--text-muted);
  border-right: 1px solid var(--border-subtle);
}
.htmlcode-surface .cm-activeLineGutter { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.htmlcode-surface .cm-activeLine { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.htmlcode-surface .cm-selectionBackground,
.htmlcode-surface .cm-content ::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.htmlcode-surface .cm-cursor { border-left-color: var(--text-primary); }
.htmlcode-surface .cm-tooltip {
  background: var(--glass-menu-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
}
.htmlcode-surface .cm-tooltip-autocomplete > ul > li[aria-selected] {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text-primary);
}
.htmlcode-surface .cm-panels {
  background: var(--surface-muted);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.htmlcode-surface .cm-panel input {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 6px;
}

/* ── Portal content: Visual / HTML tabs (PropertyIntelligenceField) ───────────
   Mirrors .autobuild-email-modes so the two editors feel like one control.
   The disabled Visual tab is the round-trip guard: tiptap's schema would strip
   a hand-written table, so rich content stays in HTML rather than being
   silently flattened. */
.property-intel-modes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.property-intel-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.property-intel-mode.on {
  background: var(--bg-elevated);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border-subtle));
}
.property-intel-mode:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.property-intel-mode-note {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ====== Access-code tap-to-reveal chips in task descriptions ======
   {{code:<uuid>}} tokens (written by the cleaning automation) render as
   amber "sensitive" chips — masked until tapped, audited per reveal
   (components/tasks/access-code-chips.ts). The literal token text stays in
   the document under the chip; this class hides it visually only. */
.access-code-token-hidden { display: none; }
.access-code-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  background: rgba(245, 158, 11, 0.13);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #b45309;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  vertical-align: baseline;
}
[data-theme="dark"] .access-code-chip {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}
.access-code-chip:hover { background: rgba(245, 158, 11, 0.22); }
.access-code-chip.is-revealed {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  user-select: text;
  background: var(--bg-elevated);
  border-color: var(--border-subtle);
  color: inherit;
}
.access-code-chip.is-busy { opacity: 0.6; cursor: progress; }
.access-code-chip.is-error {
  cursor: pointer;
  background: color-mix(in srgb, var(--state-danger) 10%, var(--bg-elevated));
  border-color: color-mix(in srgb, var(--state-danger) 45%, var(--border-subtle));
  color: var(--state-danger);
}
.inbox-access-code-chip {
  margin: 1px 2px;
}
@media (max-width: 767px) {
  .inbox-access-code-chip {
    min-height: 42px;
    padding: 8px 12px;
    white-space: normal;
    text-align: left;
  }
}

/* ====== files-kind task custom fields ("Photos of the clean") ======
   Each files field renders as a labelled block reusing the attachments
   grid + drop target (TaskBlocks CustomFieldsBlock). */
.task-modal-cf-files { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.task-modal-cf-files-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.task-modal-custom-field-remove {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
  padding: 1px 4px;
  border-radius: 4px;
}
.task-modal-custom-field-remove:hover {
  color: var(--state-danger);
  background: color-mix(in srgb, var(--state-danger) 8%, transparent);
}

/* ====== Phone listing custom-fields sheet ======
   Long-press a property in the phone calendar → Custom fields. Hosts the
   canonical PropertiesCustomFieldsNav full-screen (PhoneTaskSheet pattern). */
.ph-fields-sheet {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  animation: ph-sheet-in 0.26s cubic-bezier(0.32, 0.72, 0, 1);
}
.ph-fields-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex: 0 0 auto;
}
.ph-fields-sheet-title {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-fields-sheet-head .ph-sheet-close { position: static; }
.ph-fields-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px calc(20px + env(safe-area-inset-bottom, 0px));
}
.ph-access-vault {
  --pa-icon-btn: 34px;
  --pa-zone-icon: 34px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

/* ── PHONE MARKET LOOKUP (components/phone/PhoneMarketApp) ─────────────────────
   Type any UK address, see the short-let market around it. The market read
   itself is the canonical CompetitorIntelligencePanel; everything here is the
   chrome in front of it. Segmented buttons reuse .ph-fin-seg-btn's rules (the
   selector lists above carry .ph-mkt-seg-btn), so the two screens can never
   drift apart. Dark is the base, light overrides via [data-theme="light"] on
   the tokens, so both themes come for free.                                   */

.ph-mkt-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 12px;
  border-radius: 15px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface);
}
.ph-mkt-search-icon {
  flex: 0 0 auto;
  color: var(--ph-text-2);
}
.ph-mkt-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ph-text);
  font-family: inherit;
  /* 16px keeps iOS from zooming the viewport when the field takes focus. */
  font-size: 16px;
  padding: 11px 0;
}
.ph-mkt-search-input::placeholder {
  color: var(--ph-text-2);
}
.ph-mkt-search-input::-webkit-search-cancel-button {
  display: none;
}
.ph-mkt-spinner {
  flex: 0 0 auto;
  color: var(--ph-text-2);
  animation: phMktSpin 1s linear infinite;
}
@keyframes phMktSpin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ph-mkt-spinner {
    animation: none;
  }
}
.ph-mkt-clear {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ph-text-2);
  cursor: pointer;
}

/* Two scrolling strips rather than equal-width segments: six size options do
   not fit across a 375px screen without truncating their labels. */
.ph-mkt-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
}
.ph-mkt-seg {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ph-mkt-seg::-webkit-scrollbar {
  display: none;
}
.ph-mkt-seg-btn {
  flex: 0 0 auto;
  padding: 7px 13px;
  font-size: 13px;
  white-space: nowrap;
}

.ph-mkt-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Bottom padding clears the tab bar and the home indicator. */
  padding: 10px 14px calc(var(--ph-tabbar-stack-bottom) + 28px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ph-mkt-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ph-mkt-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface);
  color: var(--ph-text);
  font-family: inherit;
  cursor: pointer;
}
.ph-mkt-result-label {
  font-size: 15px;
  font-weight: 700;
}
.ph-mkt-result-detail {
  font-size: 12.5px;
  color: var(--ph-text-2);
}

.ph-mkt-coverage {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--ph-border);
  background: var(--ph-surface);
  color: var(--ph-text-2);
  font-size: 13px;
  line-height: 1.5;
}
.ph-mkt-coverage svg {
  flex: 0 0 auto;
  margin-top: 1px;
}
.ph-mkt-coverage.is-inside {
  color: var(--state-success);
  border-color: color-mix(in srgb, var(--state-success) 34%, transparent);
}
.ph-mkt-coverage.is-nearby {
  color: var(--state-warning);
  border-color: color-mix(in srgb, var(--state-warning) 34%, transparent);
}

/* The canonical panel sits inside the phone scroller: it brings its own card
   chrome, so it only needs its outer margin removed here. Its internals stack
   through its own module's media queries. */
.ph-mkt-panel {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Stavros live objects

   Internal Agent output is product state, not another person adding chat noise.
   One compact renderer is shared by desktop + phone; the full searchable/audit
   message stays underneath and is revealed in place only when someone opens it.
   -------------------------------------------------------------------------- */
.inbox-msg.is-agent-object,
.inbox-msg.is-agent-object .inbox-msg-body,
.inbox-msg.is-agent-object.out .inbox-msg-body,
.ph-msg.is-agent-object,
.ph-msg.is-agent-object > * {
  width: 100%;
  max-width: none;
}

.inbox-msg.is-agent-object .inbox-bubble.is-internal,
.inbox-msg.is-agent-object .inbox-bubble.in.is-internal,
.ph-msg.is-agent-object .ph-bubble-in,
.ph-msg.is-agent-object .ph-bubble--internal {
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.agent-live-object {
  --agent-object-accent: var(--accent, #6c63ff);
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--agent-object-accent) 22%, var(--border, #303039));
  border-left: 2px solid var(--agent-object-accent);
  border-radius: 11px;
  background: color-mix(in srgb, var(--surface, #17171b) 96%, var(--agent-object-accent));
  color: var(--text-primary, #f4f4f6);
  box-shadow: none;
  transition: border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.agent-live-object.is-attention,
.agent-live-object.is-needs_action {
  --agent-object-accent: var(--state-warning, #f4a62a);
}

.agent-live-object.is-urgent,
.agent-live-object.is-failed {
  --agent-object-accent: var(--state-danger, #ef5b6b);
}

.agent-live-object.is-completed,
.agent-live-object.is-closed {
  --agent-object-accent: var(--state-success, #34c783);
}

.agent-live-object.is-terminal {
  border-color: color-mix(in srgb, var(--border, #303039) 82%, transparent);
  border-left-color: color-mix(in srgb, var(--state-success, #34c783) 62%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface, #17171b) 82%, transparent);
  opacity: 0.68;
}

.agent-live-object.is-terminal:hover,
.agent-live-object.is-terminal:focus-within,
.agent-live-object.is-terminal.is-open {
  opacity: 1;
}

.agent-live-object-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 50px;
  padding: 5px 7px 5px 8px;
}

.agent-live-object-main {
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: default;
}

.agent-live-object-main.has-detail {
  cursor: pointer;
}

.agent-live-object-main.has-metric {
  grid-template-columns: 29px minmax(0, 1fr) auto 16px;
}

.agent-live-object-main:focus-visible,
.agent-live-object-primary-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--agent-object-accent) 76%, white);
  outline-offset: 1px;
}

.agent-live-object-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--agent-object-accent) 7%, transparent);
}

.agent-live-object-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.agent-live-object-kicker {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  color: color-mix(in srgb, var(--agent-object-accent) 70%, var(--text-secondary, #b2b2bc));
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.055em;
  line-height: 1.15;
  text-transform: uppercase;
}

.agent-live-object-state {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: color-mix(in srgb, var(--agent-object-accent) 76%, var(--text-secondary, #b2b2bc));
  font-size: 9px;
  letter-spacing: 0;
  white-space: nowrap;
}

.agent-live-object-time {
  color: var(--text-tertiary, #85858f);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
}

.agent-live-object-headline,
.agent-live-object-primary-action span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-live-object-headline {
  font-size: 12.5px;
  font-weight: 690;
  line-height: 1.2;
}

.agent-live-object-metric-glance {
  display: grid;
  min-width: 46px;
  justify-items: end;
  gap: 1px;
  color: var(--text-secondary, #aaaab4);
}

.agent-live-object-metric-glance strong {
  color: var(--text-primary, #f4f4f6);
  font-size: 13px;
  line-height: 1;
}

.agent-live-object-metric-glance small {
  max-width: 72px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-live-object-chevron {
  color: var(--text-tertiary, #7e7e88);
  transition: transform 160ms ease;
}

.agent-live-object.is-open .agent-live-object-chevron {
  transform: rotate(180deg);
}

.agent-live-object-spinner {
  animation: agentLiveObjectSpin 1.1s linear infinite;
}

@keyframes agentLiveObjectSpin {
  to { transform: rotate(360deg); }
}

.agent-live-object-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 190px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--agent-object-accent) 34%, var(--border, #303039));
  border-radius: 8px;
  background: color-mix(in srgb, var(--agent-object-accent) 11%, transparent);
  color: color-mix(in srgb, var(--agent-object-accent) 72%, white);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.agent-live-object-primary-action:hover {
  background: color-mix(in srgb, var(--agent-object-accent) 19%, transparent);
}

.agent-live-object.is-terminal .agent-live-object-strip {
  min-height: 36px;
  padding-block: 2px;
}

.agent-live-object.is-terminal .agent-live-object-main {
  grid-template-columns: 23px minmax(0, 1fr) 14px;
  min-height: 30px;
  gap: 6px;
}

.agent-live-object.is-terminal .agent-live-object-avatar {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: transparent;
}

.agent-live-object.is-terminal .agent-live-object-copy {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.agent-live-object.is-terminal .agent-live-object-kicker {
  flex: 0 0 auto;
  color: var(--text-tertiary, #85858f);
}

.agent-live-object.is-terminal .agent-live-object-state {
  display: none;
}

.agent-live-object.is-terminal .agent-live-object-headline {
  color: var(--text-secondary, #b2b2bc);
  font-size: 11.5px;
  font-weight: 620;
}

.agent-live-object.is-terminal .agent-live-object-primary-action {
  min-height: 28px;
  padding-inline: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--text-tertiary, #85858f);
}

.agent-live-object-detail {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px 45px;
  border-top: 1px solid color-mix(in srgb, var(--agent-object-accent) 14%, var(--border, #303039));
  background: color-mix(in srgb, var(--surface-raised, #1d1d22) 58%, transparent);
}

.agent-live-object-detail-summary {
  margin: 0;
  color: var(--text-secondary, #b8b8c0);
  font-size: 12px;
  line-height: 1.4;
}

.agent-live-object-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 7px;
  margin: 0;
}

.agent-live-object-metrics > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface, #17171b) 86%, transparent);
}

.agent-live-object-metrics dt {
  overflow: hidden;
  color: var(--text-tertiary, #85858f);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.055em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.agent-live-object-metrics dd {
  margin: 0;
  color: var(--text-primary, #f4f4f6);
  font-size: 13px;
  font-weight: 700;
}

.agent-live-object-content {
  min-width: 0;
  color: var(--text-secondary, #b8b8c0);
  font-size: 12.5px;
  line-height: 1.48;
}

.agent-live-object-content > :first-child { margin-top: 0; }
.agent-live-object-content > :last-child { margin-bottom: 0; }

.agent-change-set-detail {
  display: grid;
  gap: 11px;
  min-width: 0;
}

.agent-change-set-intent {
  display: grid;
  gap: 4px;
}

.agent-change-set-intent > strong,
.agent-change-set-decisions > strong,
.agent-change-set-exact > strong {
  color: var(--text-primary, #f4f4f6);
  font-size: 11px;
  font-weight: 720;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.agent-change-set-intent p,
.agent-change-set-notice {
  margin: 0;
  color: var(--text-secondary, #b8b8c0);
  font-size: 12px;
  line-height: 1.45;
}

.agent-change-set-plan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.agent-change-set-plan > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface, #17171b) 86%, transparent);
}

.agent-change-set-plan dt {
  color: var(--text-tertiary, #85858f);
  font-size: 9px;
  font-weight: 680;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.agent-change-set-plan dd {
  margin: 0;
  color: var(--text-primary, #f4f4f6);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.agent-change-set-exact {
  display: grid;
  gap: 6px;
  padding: 9px;
  border: 1px solid color-mix(in srgb, var(--agent-object-accent) 28%, var(--border, #303039));
  border-radius: 9px;
  background: color-mix(in srgb, var(--agent-object-accent) 7%, var(--surface, #17171b));
}

.agent-change-set-exact code {
  display: block;
  color: var(--text-primary, #f4f4f6);
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agent-change-set-decisions {
  display: grid;
  gap: 10px;
}

.agent-change-set-decisions fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.agent-change-set-decisions legend {
  margin-bottom: 6px;
  color: var(--text-primary, #f4f4f6);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
}

.agent-change-set-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.agent-change-set-options.is-long {
  max-height: 260px;
  padding-right: 4px;
  overflow: auto;
}

.agent-change-set-options label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  background: var(--surface, #17171b);
  cursor: pointer;
}

.agent-change-set-options label.is-selected {
  border-color: color-mix(in srgb, var(--agent-object-accent) 64%, var(--border, #303039));
  background: color-mix(in srgb, var(--agent-object-accent) 11%, var(--surface, #17171b));
}

.agent-change-set-options input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  accent-color: var(--agent-object-accent);
}

.agent-change-set-options label > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agent-change-set-options label strong {
  color: var(--text-primary, #f4f4f6);
  font-size: 11.5px;
  line-height: 1.3;
}

.agent-change-set-options label small {
  color: var(--text-tertiary, #85858f);
  font-size: 10px;
  line-height: 1.35;
}

.agent-change-set-notes {
  display: grid;
  gap: 5px;
  color: var(--text-secondary, #b8b8c0);
  font-size: 11px;
  font-weight: 650;
}

.agent-change-set-notes textarea {
  min-height: 68px;
  resize: vertical;
  padding: 8px 9px;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  background: var(--surface, #17171b);
  color: var(--text-primary, #f4f4f6);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.agent-change-set-continue,
.agent-change-set-targets > button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--agent-object-accent) 38%, var(--border, #303039));
  border-radius: 9px;
  background: color-mix(in srgb, var(--agent-object-accent) 11%, transparent);
  color: var(--text-primary, #f4f4f6);
  font: inherit;
  font-size: 11.5px;
  font-weight: 680;
  cursor: pointer;
}

.agent-change-set-continue:disabled {
  cursor: default;
  opacity: .48;
}

.agent-change-set-targets {
  display: grid;
  gap: 7px;
}

.agent-change-set-targets > button {
  width: 100%;
  background: color-mix(in srgb, var(--surface, #17171b) 88%, transparent);
}

.agent-change-set-targets > button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.agent-change-set-targets ul {
  display: grid;
  gap: 5px;
  max-height: 300px;
  margin: 0;
  padding: 0 4px 0 0;
  overflow: auto;
  list-style: none;
}

.agent-change-set-targets li {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid var(--border, #303039);
  border-radius: 8px;
  background: var(--surface, #17171b);
}

.agent-change-set-targets li strong {
  color: var(--text-primary, #f4f4f6);
  font-size: 11.5px;
}

.agent-change-set-targets li span {
  color: var(--text-tertiary, #85858f);
  font-size: 10.5px;
  line-height: 1.35;
}

.agent-change-set-notice {
  padding: 8px 9px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--agent-object-accent) 7%, transparent);
}

.agent-live-object-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.agent-live-object-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--agent-object-accent) 38%, var(--border, #303039));
  border-radius: 9px;
  background: color-mix(in srgb, var(--agent-object-accent) 10%, transparent);
  color: var(--text-primary, #f4f4f6);
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}

.agent-live-object-actions button:hover {
  background: color-mix(in srgb, var(--agent-object-accent) 18%, transparent);
}

.agent-live-object-actions.is-change-set-review {
  padding-top: 3px;
  border-top: 1px solid color-mix(in srgb, var(--agent-object-accent) 18%, var(--border, #303039));
}

.agent-live-object-actions.is-change-set-review button.is-primary {
  border-color: color-mix(in srgb, var(--agent-object-accent) 72%, var(--border, #303039));
  background: var(--agent-object-accent);
  color: #fff;
}

.agent-live-object-actions button:disabled,
.agent-live-object-primary-action:disabled {
  cursor: default;
  opacity: .58;
}

.agent-live-object-action-input {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.agent-live-object-action-inputs {
  display: grid;
  gap: 7px;
}

.agent-live-object-action-input.is-text {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  width: 100%;
}

.agent-live-object-action-input input {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  color: var(--text-primary, #f4f4f6);
  color-scheme: dark;
  background: var(--surface, #17171b);
}

.agent-live-object-action-input textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  padding: 8px 9px;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  background: var(--surface, #17171b);
  color: var(--text-primary, #f4f4f6);
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}

.agent-live-object-action-input textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--agent-object-accent) 70%, white);
  outline-offset: 1px;
}

@media (max-width: 520px) {
  .agent-live-object-action-input.is-text {
    grid-template-columns: minmax(0, 1fr);
  }
}

.agent-live-object-command-message {
  margin: 0;
  color: var(--agent-object-accent);
  font-size: 11.5px;
  font-weight: 650;
}

.agent-live-object-evidence {
  max-height: 220px;
  margin: 0;
  padding: 9px;
  overflow: auto;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  color: var(--text-secondary, #b8b8c0);
  font-size: 11px;
  line-height: 1.45;
  background: var(--surface, #17171b);
}

.agent-live-object-evidence > strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text-primary, #f4f4f6);
  font-size: 11px;
}

.stavros-change-provenance {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid color-mix(in srgb, var(--accent, #7c74ff) 30%, var(--border, #303039));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, #7c74ff) 9%, transparent);
  color: color-mix(in srgb, var(--accent, #7c74ff) 74%, var(--text-primary, #f4f4f6));
  font-size: 10.5px;
  font-weight: 680;
  line-height: 1.2;
  text-decoration: none;
}

.stavros-change-provenance span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stavros-change-provenance.is-approved {
  border-color: color-mix(in srgb, var(--state-success, #34c783) 30%, var(--border, #303039));
  background: color-mix(in srgb, var(--state-success, #34c783) 8%, transparent);
  color: color-mix(in srgb, var(--state-success, #34c783) 72%, var(--text-primary, #f4f4f6));
}

.stavros-change-provenance.is-error {
  border-color: color-mix(in srgb, var(--state-warning, #f5a524) 35%, var(--border, #303039));
  background: color-mix(in srgb, var(--state-warning, #f5a524) 9%, transparent);
  color: color-mix(in srgb, var(--state-warning, #f5a524) 78%, var(--text-primary, #f4f4f6));
  font-family: inherit;
  cursor: pointer;
}

.stavros-change-provenance:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.agent-live-object-evidence ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent-live-object-evidence li {
  display: grid;
  gap: 2px;
}

.agent-live-object-evidence li > span {
  color: var(--agent-object-accent);
  font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.agent-live-object-evidence p {
  margin: 0;
}

.agent-live-object-evidence small {
  display: block;
  margin-top: 8px;
  color: var(--text-tertiary, #85858f);
}

@media (max-width: 700px) {
  .ph-msg.is-agent-object {
    padding-inline: 8px;
  }

  .agent-live-object {
    border-radius: 11px;
  }

  .agent-live-object-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 54px;
    gap: 5px;
    padding: 5px 6px 5px 7px;
  }

  .agent-live-object-main {
    grid-template-columns: 29px minmax(0, 1fr) 16px;
    min-height: 42px;
    gap: 7px;
  }

  .agent-live-object-main.has-metric {
    grid-template-columns: 29px minmax(0, 1fr) 16px;
  }

  .agent-live-object-metric-glance {
    display: none;
  }

  .agent-live-object-headline {
    font-size: 12px;
  }

  .agent-live-object-kicker {
    font-size: 8.5px;
  }

  .agent-live-object-primary-action {
    max-width: 116px;
    min-height: 42px;
    padding-inline: 9px;
    font-size: 11px;
  }

  .agent-live-object-detail {
    gap: 10px;
    padding: 10px 10px 12px;
  }

  .agent-live-object-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-change-set-plan,
  .agent-change-set-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .agent-change-set-continue {
    min-height: 44px;
    width: 100%;
    font-size: 13px;
  }

  .agent-live-object-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .agent-live-object-actions button {
    min-height: 44px;
    width: 100%;
    padding-inline: 12px;
    font-size: 13px;
  }

  .agent-live-object-action-input,
  .agent-live-object-action-input input {
    width: 100%;
  }

  .agent-live-object-action-input input {
    min-height: 44px;
    font-size: 16px;
  }

  .agent-live-object.is-terminal .agent-live-object-strip {
    min-height: 42px;
  }

  .agent-live-object.is-terminal .agent-live-object-main {
    min-height: 36px;
  }

  .agent-live-object.is-terminal .agent-live-object-kicker > span:first-child {
    display: none;
  }
}

/* One Stavros canvas presence. Agent objects no longer consume transcript
   turns; they update this adaptive stage at the edge of the working canvas. */
.agent-canvas-stage {
  --agent-canvas-accent: var(--accent, #6c63ff);
  position: sticky;
  bottom: 2px;
  z-index: 18;
  /* .inbox-bubbles is a column flex scroller. Without an explicit no-shrink
     contract, opening the stage inserts the detail row but flexbox compresses
     the whole card back to its 58px minimum and overflow:hidden clips it. */
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-height: 58px;
  margin-top: 8px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid color-mix(in srgb, var(--agent-canvas-accent) 30%, var(--border, #303039));
  border-radius: 17px;
  background:
    radial-gradient(circle at 24px 50%, color-mix(in srgb, var(--agent-canvas-accent) 18%, transparent), transparent 74px),
    color-mix(in srgb, var(--surface-raised, #1d1d22) 92%, transparent);
  box-shadow: 0 14px 38px rgb(0 0 0 / 0.28), inset 0 1px 0 rgb(255 255 255 / 0.035);
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  color: var(--text-primary, #f4f4f6);
}

.agent-canvas-stage.is-needs_action,
.agent-canvas-stage.is-attention { --agent-canvas-accent: var(--state-warning, #f4a62a); }
.agent-canvas-stage.is-failed,
.agent-canvas-stage.is-urgent { --agent-canvas-accent: var(--state-danger, #ef5b6b); }
.agent-canvas-stage.is-completed,
.agent-canvas-stage.is-closed { --agent-canvas-accent: var(--state-success, #34c783); }

.agent-canvas-stage.is-open {
  grid-template-rows: auto minmax(0, auto);
  align-items: start;
}

.agent-canvas-presence {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 56px;
}

.agent-canvas-orbit {
  position: absolute;
  width: 42px;
  height: 26px;
  border: 1px solid color-mix(in srgb, var(--agent-canvas-accent) 46%, transparent);
  border-radius: 50%;
  transform: rotate(-14deg);
  opacity: 0.58;
  animation: agentCanvasOrbit 5.4s linear infinite;
}

.agent-canvas-orbit::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--agent-canvas-accent);
  box-shadow: 0 0 9px var(--agent-canvas-accent);
}

.agent-canvas-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 56px;
  padding: 7px 8px 7px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.agent-canvas-main:focus-visible,
.agent-canvas-controls button:focus-visible,
.agent-canvas-secondary-actions button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--agent-canvas-accent) 78%, white);
  outline-offset: -2px;
}

.agent-canvas-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.agent-canvas-kicker {
  display: flex;
  align-items: baseline;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
  color: var(--text-tertiary, #85858f);
  font-size: 9px;
  font-weight: 680;
  letter-spacing: 0.055em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.agent-canvas-kicker strong {
  color: color-mix(in srgb, var(--agent-canvas-accent) 70%, white);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.agent-canvas-kicker time { color: var(--text-tertiary, #85858f); }

.agent-canvas-headline {
  overflow: hidden;
  color: var(--text-primary, #f4f4f6);
  font-size: 13px;
  font-weight: 690;
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-canvas-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--agent-canvas-accent) 32%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--agent-canvas-accent) 9%, transparent);
  color: color-mix(in srgb, var(--agent-canvas-accent) 74%, white);
  font-size: 9.5px;
  font-weight: 720;
  white-space: nowrap;
}

.agent-canvas-chevron {
  color: var(--text-tertiary, #85858f);
  transition: transform 160ms ease;
}
.agent-canvas-stage.is-open .agent-canvas-chevron { transform: rotate(180deg); }
.agent-canvas-spinner { animation: agentLiveObjectSpin 1.1s linear infinite; }

.agent-canvas-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 8px;
}

.agent-canvas-pager {
  display: inline-flex;
  align-items: center;
  height: 32px;
  overflow: hidden;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  color: var(--text-tertiary, #85858f);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.agent-canvas-pager button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.agent-canvas-pager button:hover { color: var(--text-primary, #f4f4f6); }

.agent-canvas-action,
.agent-canvas-secondary-actions button,
.agent-canvas-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--agent-canvas-accent) 38%, var(--border, #303039));
  border-radius: 10px;
  background: color-mix(in srgb, var(--agent-canvas-accent) 12%, transparent);
  color: color-mix(in srgb, var(--agent-canvas-accent) 72%, white);
  font: inherit;
  font-size: 11px;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}
.agent-canvas-action:hover,
.agent-canvas-secondary-actions button:hover,
.agent-canvas-dismiss:hover {
  background: color-mix(in srgb, var(--agent-canvas-accent) 20%, transparent);
}

.agent-canvas-dismiss {
  min-width: 34px;
  padding: 0 9px;
  border-color: var(--border, #303039);
  background: transparent;
  color: var(--text-tertiary, #85858f);
}

.agent-canvas-dismiss:disabled {
  opacity: 0.45;
  cursor: wait;
}

.agent-canvas-detail {
  grid-column: 2 / -1;
  grid-row: 2;
  display: grid;
  gap: 10px;
  max-height: min(46vh, 420px);
  overflow: auto;
  padding: 11px 12px 13px 0;
  border-top: 1px solid color-mix(in srgb, var(--agent-canvas-accent) 17%, var(--border, #303039));
  color: var(--text-secondary, #b8b8c0);
  font-size: 12px;
  line-height: 1.46;
}
.agent-canvas-detail > p { margin: 0; }
.agent-canvas-detail dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 7px;
  margin: 0;
}
.agent-canvas-detail dl > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--border, #303039);
  border-radius: 9px;
  background: rgb(0 0 0 / 0.12);
}
.agent-canvas-detail dt {
  overflow: hidden;
  color: var(--text-tertiary, #85858f);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.agent-canvas-detail dd {
  margin: 0;
  color: var(--text-primary, #f4f4f6);
  font-size: 12px;
  font-weight: 700;
}
.agent-canvas-content { min-width: 0; }
.agent-canvas-content > :first-child { margin-top: 0; }
.agent-canvas-content > :last-child { margin-bottom: 0; }
.agent-canvas-secondary-actions { display: flex; flex-wrap: wrap; gap: 7px; }

@keyframes agentCanvasOrbit {
  to { transform: rotate(346deg); }
}

@media (max-width: 700px) {
  .agent-canvas-stage {
    bottom: 0;
    grid-template-columns: 49px minmax(0, 1fr) auto;
    min-height: 62px;
    margin: 4px -3px 0;
    width: calc(100% + 6px);
    border-radius: 19px;
    background:
      radial-gradient(circle at 23px 50%, color-mix(in srgb, var(--agent-canvas-accent) 18%, transparent), transparent 70px),
      color-mix(in srgb, var(--ph-tabbar-bg, #18181d) 94%, transparent);
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.32), inset 0 1px 0 rgb(255 255 255 / 0.04);
  }
  .agent-canvas-presence { width: 49px; height: 60px; }
  .agent-canvas-main {
    grid-template-columns: minmax(0, 1fr) 24px 17px;
    min-height: 60px;
    gap: 7px;
    padding-right: 8px;
  }
  .agent-canvas-kicker { font-size: 8.5px; }
  .agent-canvas-kicker strong { font-size: 9px; }
  .agent-canvas-kicker time { display: none; }
  .agent-canvas-headline { font-size: 12px; }
  .agent-canvas-state {
    width: 24px;
    min-height: 23px;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    font-size: 0;
  }
  .agent-canvas-controls {
    grid-column: auto;
    justify-content: flex-end;
    gap: 5px;
    padding: 0 8px 0 0;
  }
  .agent-canvas-pager { height: 38px; }
  .agent-canvas-pager button { width: 32px; }
  .agent-canvas-pager button:first-child,
  .agent-canvas-pager > span { display: none; }
  .agent-canvas-action {
    width: 40px;
    min-height: 40px;
    padding: 0;
    overflow: hidden;
  }
  .agent-canvas-action span { display: none; }
  .agent-canvas-dismiss {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }
  .agent-canvas-dismiss span { display: none; }
  .agent-canvas-detail {
    grid-column: 1 / -1;
    max-height: min(42vh, 360px);
    padding: 11px 11px 13px;
  }
  .agent-canvas-secondary-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .agent-canvas-secondary-actions button { min-height: 44px; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-live-object,
  .agent-live-object-chevron,
  .agent-live-object-spinner,
  .agent-canvas-orbit,
  .agent-canvas-chevron,
  .agent-canvas-spinner {
    animation: none;
    transition: none;
  }
}

/* The legacy task list skin is declared earlier in the bundle than several
   later compatibility rules. Keep the editable table's overflow contract at
   the end of the cascade: wide personal column sets scroll as one table and
   are never clipped inside each group card. */
.tasks-list .tasks-group,
.tasks-list .tasks-group-rows,
.tasks-list .task-row {
  min-width: max-content;
}
.tasks-list .tasks-group-rows {
  overflow: visible;
}
.tasks-list .task-row {
  width: 100%;
}

/* Phone calendar directory */
.ph-calendars-app {
  min-height: 100dvh;
  background: var(--ph-bg);
}

.ph-calendar-directory-list {
  padding: 10px 12px calc(9rem + env(safe-area-inset-bottom));
}

.ph-calendar-directory-heading,
.ph-calendar-directory-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ph-calendar-directory-heading {
  min-height: 44px;
  margin-bottom: 10px;
}

.ph-calendar-directory-heading > span,
.ph-calendar-directory-copy,
.ph-calendar-connect-row > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ph-calendar-directory-heading strong {
  color: var(--ph-text);
  font-size: 15px;
  line-height: 19px;
}

.ph-calendar-directory-heading small,
.ph-calendar-directory-copy small,
.ph-calendar-connect-row small {
  color: var(--ph-text-2);
  font-size: 10.5px;
  line-height: 14px;
}

.ph-calendar-directory-heading > button,
.ph-calendar-directory-group-head > button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 10px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 760;
}

.ph-calendar-directory-heading > button {
  padding: 0 12px;
}

.ph-calendar-directory-group {
  margin-top: 14px;
}

.ph-calendar-directory-group h2 {
  margin: 0 0 6px 3px;
  color: var(--ph-text-2);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.08em;
  line-height: 14px;
  text-transform: uppercase;
}

.ph-calendar-directory-group-head > button {
  min-height: 28px;
  margin-bottom: 4px;
  padding: 0 9px;
  background: transparent;
}

.ph-calendar-directory-card {
  overflow: hidden;
  border: 1px solid var(--ph-border);
  border-radius: 14px;
  background: var(--ph-surface);
}

.ph-calendar-directory-row,
.ph-calendar-connect-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  color: var(--ph-text);
}

.ph-calendar-directory-row + .ph-calendar-directory-row {
  border-top: 1px solid var(--ph-border);
}

.ph-calendar-directory-copy strong,
.ph-calendar-connect-row strong {
  overflow: hidden;
  color: var(--ph-text);
  font-size: 13px;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-calendar-directory-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-calendar-source-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ph-border);
  border-radius: 11px;
}

.ph-calendar-source-icon.is-uos {
  border-color: color-mix(in srgb, var(--ph-accent) 35%, var(--ph-border));
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
}

.ph-calendar-source-icon.is-google {
  background: color-mix(in srgb, #4285f4 10%, var(--ph-surface));
  color: #78a7ff;
}

.ph-calendar-source-icon.has-error {
  background: color-mix(in srgb, #ef4444 10%, var(--ph-surface));
  color: #f87171;
}

.ph-calendar-default {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  font-size: 9px;
  font-weight: 780;
}

.ph-calendar-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ph-text-3);
}

.ph-calendar-sync-dot.is-ready { background: #34d399; }
.ph-calendar-sync-dot.is-syncing { background: #60a5fa; }
.ph-calendar-sync-dot.is-attention { background: #f87171; }

.ph-calendar-connect-row {
  width: 100%;
  border: 1px dashed var(--ph-border);
  border-radius: 14px;
  background: transparent;
  font: inherit;
  text-align: left;
}

.ph-calendar-directory-notice,
.ph-calendar-directory-error {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, #34d399 35%, var(--ph-border));
  border-radius: 11px;
  background: color-mix(in srgb, #34d399 8%, var(--ph-surface));
  color: var(--ph-text);
  font-size: 11px;
}

.ph-calendar-directory-notice > span,
.ph-calendar-directory-error > span { flex: 1 1 auto; }
.ph-calendar-directory-notice > button,
.ph-calendar-directory-error > button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 750;
}

.ph-calendar-directory-error {
  border-color: color-mix(in srgb, #ef4444 35%, var(--ph-border));
  background: color-mix(in srgb, #ef4444 8%, var(--ph-surface));
}

.ph-create-calendar-sheet {
  display: grid;
  gap: 12px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.ph-calendar-create-note {
  margin: -7px 30px 0 0;
  color: var(--ph-text-2);
  font-size: 11px;
  line-height: 15px;
}

.ph-calendar-destination {
  min-width: 0;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.ph-calendar-destination legend {
  margin-bottom: 5px;
  color: var(--ph-text-2);
  font-size: 10px;
  font-weight: 720;
}

.ph-calendar-destination label {
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid var(--ph-border);
  border-radius: 12px;
  background: var(--ph-surface);
}

.ph-calendar-destination label:has(input:checked) {
  border-color: color-mix(in srgb, var(--ph-accent) 54%, var(--ph-border));
  background: var(--ph-accent-wash);
}

.ph-calendar-destination input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ph-calendar-destination label > span:not(.ph-calendar-destination-icon) {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ph-calendar-destination strong {
  overflow: hidden;
  color: var(--ph-text);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-calendar-destination small {
  color: var(--ph-text-2);
  font-size: 9.5px;
  line-height: 13px;
}

.ph-calendar-destination-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--ph-accent) 10%, var(--ph-bg));
  color: var(--ph-accent-soft);
}

.ph-calendar-description {
  min-height: 54px;
  resize: none;
}

/* Phone Staff calendar */
.ph-staff-calendar {
  min-height: 100dvh;
  background: var(--ph-bg);
}

.ph-staff-date-strip {
  display: grid;
  grid-template-columns: 30px repeat(7, minmax(0, 1fr)) 30px;
  gap: 0.2rem;
  padding: 0.6rem 0.55rem;
  border-bottom: 1px solid var(--ph-border);
  overflow: hidden;
}

.ph-staff-date-strip button {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.1rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ph-text-2);
  font: inherit;
  font-size: 0.65rem;
}

.ph-staff-date-strip button.is-active {
  background: var(--ph-accent-strong);
  color: #fff;
}

.ph-staff-date-strip strong {
  font-size: 0.86rem;
}

.ph-staff-cal-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px 10px calc(8.5rem + env(safe-area-inset-bottom));
}

.ph-staff-day-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 1px 2px 7px;
}

.ph-staff-day-summary > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ph-staff-day-summary strong {
  color: var(--ph-text);
  font-size: 14px;
  line-height: 18px;
}

.ph-staff-day-summary small {
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 10px;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-staff-day-summary > button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 750;
}

.ph-staff-roster,
.ph-staff-unclaimed {
  overflow: hidden;
  border: 1px solid var(--ph-border);
  border-radius: 14px;
  background: var(--ph-surface);
}

.ph-staff-roster-row + .ph-staff-roster-row {
  border-top: 1px solid var(--ph-border);
}

.ph-staff-roster-summary,
.ph-staff-unclaimed-summary {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ph-text);
  font: inherit;
  text-align: left;
}

.ph-staff-roster-summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 0.86fr) minmax(112px, 1.14fr) 17px;
  align-items: center;
  gap: 8px;
  min-height: 68px;
  padding: 7px 9px;
}

.ph-staff-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
}

.ph-staff-roster-person,
.ph-staff-state > span:last-child,
.ph-staff-unclaimed-summary > span:nth-child(2),
.ph-staff-schedule-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ph-staff-roster-person strong,
.ph-staff-unclaimed-summary strong,
.ph-staff-schedule-copy strong {
  overflow: hidden;
  color: var(--ph-text);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-staff-roster-person small,
.ph-staff-unclaimed-summary small,
.ph-staff-schedule-copy small {
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 9.5px;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-staff-state {
  min-width: 0;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.ph-staff-day-state {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.ph-staff-state strong {
  overflow: hidden;
  color: var(--ph-text);
  font-size: 10.5px;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-staff-state small {
  overflow: hidden;
  color: var(--ph-text-2);
  font-size: 8.5px;
  line-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-staff-state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ph-text-3);
}

.ph-staff-state.is-away .ph-staff-state-dot { background: #c084fc; }
.ph-staff-state.is-working .ph-staff-state-dot { background: #2dd4bf; }
.ph-staff-state.is-off .ph-staff-state-dot { background: var(--ph-text-3); }
.ph-staff-state.is-unconfigured .ph-staff-state-dot { background: #fbbf24; }

.ph-staff-activity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ph-text-2);
  font-size: 8.5px;
  line-height: 12px;
}

.ph-staff-activity svg {
  flex: 0 0 auto;
}

.ph-staff-activity > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ph-staff-activity.is-conflict {
  color: #fbbf24;
  font-weight: 700;
}

.ph-staff-roster-chevron {
  color: var(--ph-text-3);
  transition: transform 150ms ease;
}

.ph-staff-roster-row.is-expanded .ph-staff-roster-chevron,
.ph-staff-unclaimed.is-open .ph-staff-unclaimed-summary > svg {
  transform: rotate(90deg);
}

.ph-staff-roster-row.is-expanded .ph-staff-roster-summary {
  background: color-mix(in srgb, var(--ph-accent) 5%, var(--ph-surface));
}

.ph-staff-roster-detail {
  display: grid;
  gap: 7px;
  padding: 8px;
  border-top: 1px solid var(--ph-border);
  background: color-mix(in srgb, var(--ph-bg) 58%, var(--ph-surface));
}

.ph-staff-detail-head {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  color: var(--ph-text-2);
  font-size: 9.5px;
}

.ph-staff-detail-head > button {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 0;
  border-radius: 9px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  font: inherit;
  font-size: 10px;
  font-weight: 760;
}

.ph-staff-unclaimed {
  border-color: color-mix(in srgb, var(--ph-accent) 32%, var(--ph-border));
}

.ph-staff-unclaimed-summary {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 17px;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
}

.ph-staff-unclaimed-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
}

.ph-staff-unclaimed-count {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  font-size: 9px;
  font-weight: 800;
}

.ph-staff-unclaimed-summary > svg {
  color: var(--ph-text-3);
  transition: transform 150ms ease;
}

.ph-staff-schedule-list {
  display: grid;
  gap: 5px;
}

.ph-staff-unclaimed > .ph-staff-schedule-list {
  padding: 7px;
  border-top: 1px solid var(--ph-border);
}

.ph-staff-schedule-list > button {
  min-width: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--ph-accent) 20%, var(--ph-border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--ph-accent) 6%, var(--ph-surface));
  color: var(--ph-text);
  font: inherit;
  text-align: left;
}

.ph-staff-schedule-time {
  color: var(--ph-text-2);
  font-size: 9px;
  font-weight: 720;
}

.ph-staff-schedule-list > button.is-leave {
  border-color: color-mix(in srgb, #a855f7 38%, var(--ph-border));
}

.ph-staff-schedule-list > button.is-duty {
  border-color: color-mix(in srgb, #f59e0b 38%, var(--ph-border));
}

.ph-staff-schedule-list > button.is-done {
  opacity: 0.55;
  text-decoration: line-through;
}

@media (max-width: 380px) {
  .ph-staff-roster-summary {
    grid-template-columns: 34px minmax(0, 0.9fr) minmax(92px, 1.1fr) 14px;
    gap: 6px;
    padding-inline: 7px;
  }

  .ph-staff-avatar {
    width: 34px;
    height: 34px;
  }

  .ph-staff-state small {
    display: none;
  }

  .ph-staff-schedule-list > button {
    grid-template-columns: 54px minmax(0, 1fr) auto;
  }
}

.ph-staff-quick-sheet {
  display: grid;
  gap: 12px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.ph-staff-quick-actions {
  display: grid;
  gap: 6px;
}

.ph-staff-quick-actions > button {
  min-height: 54px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--ph-border);
  border-radius: 11px;
  background: var(--ph-surface);
  color: var(--ph-text);
  font: inherit;
  text-align: left;
}

.ph-staff-quick-actions > button > svg {
  color: var(--ph-accent-soft);
}

.ph-staff-quick-actions > button > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ph-staff-quick-actions strong {
  font-size: 12px;
}

.ph-staff-quick-actions small {
  color: var(--ph-text-2);
  font-size: 9.5px;
}

.ph-eventform-static {
  display: flex;
  align-items: center;
}

.ph-eventform-meet {
  display: inline-flex;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 720;
}

.ph-eventform-conflict {
  display: grid;
  gap: 0.3rem;
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, #f59e0b 55%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, #f59e0b 9%, var(--bg));
  font-size: 0.76rem;
}

.ph-eventform-conflict button {
  justify-self: start;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 750;
}

.calendar-sync-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 10px;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, #f59e0b 38%, var(--border-subtle));
  border-radius: 9px;
  color: var(--text-primary);
  background: color-mix(in srgb, #f59e0b 10%, var(--bg-elevated));
  font-size: 0.78rem;
  line-height: 1.4;
}

.calendar-sync-notice > svg { flex: 0 0 auto; color: #f59e0b; }
.calendar-sync-notice > span { flex: 1 1 auto; }
.calendar-sync-notice > button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}
.calendar-sync-notice > button:hover { color: var(--text-primary); background: var(--surface-muted); }

/* Contact-owned My Jobs control ------------------------------------------ */
.contact-my-jobs {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-subtle));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated));
}
.contact-my-jobs-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.contact-my-jobs-head > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.contact-my-jobs-head small { color: var(--text-muted); font-size: 10px; }
.contact-my-jobs-head strong { color: var(--text-primary); font-size: 14px; }
.contact-my-jobs-head .btn { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.contact-my-jobs-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 17%, transparent);
  color: var(--accent);
}
.contact-my-jobs-status,
.contact-my-jobs-notice,
.contact-my-jobs-error { margin: 0; font-size: 12px; line-height: 1.45; }
.contact-my-jobs-status { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.contact-my-jobs-notice { color: var(--state-success); }
.contact-my-jobs-error { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--state-error); }
.contact-my-jobs-error button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--state-error) 40%, var(--border-subtle));
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
}
.contact-my-jobs-current { display: grid; gap: 5px; }
.contact-my-jobs-current > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
}
.contact-my-jobs-current > div > span { display: grid; min-width: 0; gap: 2px; }
.contact-my-jobs-current strong { overflow: hidden; color: var(--text-primary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.contact-my-jobs-current small { color: var(--text-muted); font-size: 10px; }
.contact-my-jobs-current em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}
.contact-my-jobs-current > p { margin: 1px 0 0; color: var(--text-muted); font-size: 11px; }
.contact-my-jobs-share { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.contact-my-jobs-share button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}
.contact-my-jobs-share button:hover { border-color: var(--border-strong); }
.contact-my-jobs-share button:disabled { opacity: .45; cursor: default; }
.contact-my-jobs-share > small { flex-basis: 100%; color: var(--text-muted); font-size: 10px; }
.contact-my-jobs-modal {
  position: fixed;
  inset: 0;
  z-index: 620;
  display: grid;
  padding: 20px;
  place-items: center;
}
.contact-my-jobs-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, var(--bg-base) 78%, transparent);
  backdrop-filter: blur(4px);
}
.contact-my-jobs-modal-card {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(720px, 100%);
  max-height: min(820px, calc(100dvh - 40px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}
.contact-my-jobs-modal-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.contact-my-jobs-modal-head > span { display: grid; min-width: 0; gap: 3px; }
.contact-my-jobs-modal-head small { color: var(--accent); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.contact-my-jobs-modal-head strong { color: var(--text-primary); font-size: 17px; }
.contact-my-jobs-modal-head em { color: var(--text-muted); font-size: 12px; font-style: normal; }
.contact-my-jobs-modal-head > button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.contact-my-jobs-modal-body {
  display: grid;
  min-height: 0;
  flex: 1 1 auto;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.contact-my-jobs-search {
  display: flex;
  position: sticky;
  z-index: 1;
  top: 0;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}
.contact-my-jobs-search:focus-within { border-color: var(--accent); }
.contact-my-jobs-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 14px; }
.contact-my-jobs-task-list { display: grid; gap: 6px; }
.contact-my-jobs-task {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--bg-elevated);
  cursor: pointer;
}
.contact-my-jobs-task:hover,
.contact-my-jobs-task.is-selected { border-color: color-mix(in srgb, var(--accent) 56%, var(--border-subtle)); background: color-mix(in srgb, var(--accent) 7%, var(--bg-elevated)); }
.contact-my-jobs-task > input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.contact-my-jobs-task > span { display: grid; min-width: 0; gap: 2px; }
.contact-my-jobs-task strong { overflow: hidden; color: var(--text-primary); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.contact-my-jobs-task small { color: var(--text-muted); font-size: 10px; }
.contact-my-jobs-task em { color: var(--text-muted); font-size: 10px; font-style: normal; font-weight: 700; }
.contact-my-jobs-empty { display: grid; min-height: 110px; place-items: center; align-content: center; gap: 8px; color: var(--text-muted); font-size: 12px; text-align: center; }
.contact-my-jobs-empty p { margin: 0; }
.contact-my-jobs-empty a { color: var(--accent); font-weight: 750; }
.contact-my-jobs-modal-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.contact-my-jobs-modal-actions > span { margin-right: auto; color: var(--text-muted); font-size: 11px; }
.contact-my-jobs-modal-actions .btn { min-height: 38px; }
@media (max-width: 720px) {
  .contact-my-jobs-head { grid-template-columns: auto minmax(0, 1fr); }
  .contact-my-jobs-head .btn { grid-column: 1 / -1; width: 100%; }
  .contact-my-jobs-share { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-my-jobs-share button { justify-content: center; padding-inline: 5px; }
  .contact-my-jobs-share > small { grid-column: 1 / -1; }
  .contact-my-jobs-modal { padding: 0; }
  .contact-my-jobs-modal-card { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .contact-my-jobs-modal-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .contact-my-jobs-task { min-height: 56px; }
}

/* Contact-owned UOS Client access control -------------------------------- */
.contact-client-access {
  display: grid;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-subtle));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.contact-client-access-head,
.contact-client-access-summary,
.contact-client-access-footer,
.contact-client-access-actions {
  display: flex;
  align-items: center;
}
.contact-client-access-head { justify-content: space-between; gap: 12px; }
.contact-client-access-head > div { display: grid; gap: 3px; }
.contact-client-access-head h3 { margin: 0; font-size: 14px; color: var(--text); }
.contact-client-access-head > svg { color: var(--accent); }
.contact-client-access-help,
.contact-client-access-meta,
.contact-client-access-warning,
.contact-client-access-notice,
.contact-client-access-empty,
.contact-client-access-loading { margin: 0; font-size: 12px; line-height: 1.5; }
.contact-client-access-help,
.contact-client-access-meta { color: var(--text-muted); }
.contact-client-access-loading { display: flex; align-items: center; gap: 7px; color: var(--text-muted); }
.contact-client-access-notice { padding: 9px 10px; border-radius: 9px; color: var(--success-text, #137333); background: color-mix(in srgb, var(--success, #16a34a) 9%, transparent); }
.contact-client-access-error { margin: 0; }
.contact-client-access-empty { padding: 11px; border: 1px dashed var(--border-subtle); border-radius: 10px; color: var(--text-muted); }
.contact-client-access-list { display: grid; gap: 10px; }
.contact-client-access-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--surface); }
.contact-client-access-card.is-scope_removed,
.contact-client-access-card.is-revoked { border-color: color-mix(in srgb, var(--danger) 28%, var(--border-subtle)); }
.contact-client-access-summary { justify-content: space-between; align-items: flex-start; gap: 12px; }
.contact-client-access-summary > div:first-child { display: grid; gap: 3px; min-width: 0; }
.contact-client-access-summary strong { font-size: 13px; color: var(--text); }
.contact-client-access-summary small { font-size: 11px; color: var(--text-muted); }
.contact-client-access-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.contact-client-access-actions .btn,
.contact-client-access-footer .btn,
.contact-client-access-footer .fin-share-btn { min-height: 31px; padding: 6px 9px; font-size: 11px; }
.contact-client-access-state { width: max-content; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 750; color: var(--text-muted); background: var(--surface-subtle); }
.contact-client-access-state.is-active { color: var(--success-text, #137333); background: color-mix(in srgb, var(--success, #16a34a) 12%, transparent); }
.contact-client-access-state.is-invited { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.contact-client-access-state.is-failed,
.contact-client-access-state.is-revoked,
.contact-client-access-state.is-scope_removed { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.contact-client-access-properties { display: flex; gap: 5px; flex-wrap: wrap; }
.contact-client-access-properties span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 7px; border: 1px solid var(--border-subtle); border-radius: 7px; font-size: 10px; color: var(--text-muted); background: var(--surface-subtle); }
.contact-client-access-warning { padding: 8px 9px; border-radius: 8px; color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.contact-client-access-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px; }
.contact-client-access-settings label { display: grid; align-content: start; gap: 5px; min-width: 0; font-size: 11px; font-weight: 700; color: var(--text-muted); }
.contact-client-access-settings input,
.contact-client-access-settings .selectmenu-trigger-plain { width: 100%; min-height: 35px; border: 1px solid var(--border-subtle); border-radius: 8px; background: var(--surface-subtle); color: var(--text); }
.contact-client-access-settings input { padding: 7px 9px; font: inherit; font-weight: 600; }
.contact-client-access-settings small { font-size: 9.5px; font-weight: 500; line-height: 1.35; }
.contact-client-access-footer { gap: 7px; flex-wrap: wrap; padding-top: 2px; }
.contact-client-access-footer .btn-danger.is-confirming { animation: none; outline: 2px solid color-mix(in srgb, var(--danger) 34%, transparent); outline-offset: 2px; }
.contact-client-access-regrant { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-muted); }
@media (max-width: 720px) {
  .contact-client-access-summary { align-items: stretch; flex-direction: column; }
  .contact-client-access-actions { justify-content: flex-start; }
  .contact-client-access-settings { grid-template-columns: 1fr; }
}

/* ── Grounded pricing recommendations ─────────────────────────────────────── */
.spr-section { container-type:inline-size; }
.spr-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
.spr-count { flex:0 0 auto; padding:.35rem 0; color:var(--text-muted); font-size:13px; font-weight:700; }
.spr-count.is-actionable { color:var(--text-primary); }
.spr-empty { display:flex; align-items:flex-start; gap:.65rem; margin-top:1rem; padding:14px 0; border-top:1px solid var(--border-subtle); color:var(--text-muted); }
.spr-empty div { display:grid; gap:.18rem; min-width:0; }
.spr-empty strong { color:var(--text-primary); font-size:14px; }
.spr-empty span { color:var(--text-secondary); font-size:13px; line-height:1.5; }
.spr-list { display:grid; gap:0; margin-top:1rem; }
.spr-card { display:grid; gap:10px; padding:14px 0; border-top:1px solid var(--border-subtle); background:transparent; }
.spr-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:.75rem; }
.spr-card-title-wrap { display:grid; gap:.16rem; min-width:0; }
.spr-title-row { display:flex; align-items:center; gap:.42rem; flex-wrap:wrap; min-width:0; }
.spr-confidence { display:inline-flex; align-items:center; color:var(--text-muted); font-size:12.5px; font-weight:650; white-space:nowrap; }
.spr-confidence--high { color:var(--text-secondary); }
.spr-confidence--medium { color:var(--text-muted); }
.spr-confidence--watch { color:var(--text-muted); }
.spr-date { color:var(--text-muted); font-size:13px; font-weight:650; }
.spr-title { overflow:hidden; color:var(--text-primary); font-size:15px; line-height:1.35; text-overflow:ellipsis; }
.spr-verdict { display:inline-flex; flex:0 0 auto; align-items:center; gap:5px; padding:2px 0; font-size:13px; font-weight:700; white-space:nowrap; }
.spr-verdict--raise { color:var(--state-success); }
.spr-verdict--lower { color:var(--state-info); }
.spr-verdict--watch { color:var(--text-secondary); }
.spr-explanation { margin:0; color:var(--text-secondary); font-size:14px; line-height:1.5; }
.spr-metrics { display:flex; flex-wrap:wrap; gap:6px 12px; padding:10px 0 0; border-top:1px dashed var(--border-subtle); color:var(--text-muted); font-size:13px; }
.spr-metrics strong { color:var(--text-primary); font-variant-numeric:tabular-nums; }
.spr-actions { display:flex; flex-wrap:wrap; gap:8px; }
.spr-actions .btn { min-height:36px; padding:7px 12px; font-size:13px; }
.spr-sources { display:flex; flex-wrap:wrap; gap:10px; }
.spr-sources a { display:inline-flex; align-items:center; gap:5px; color:var(--text-muted); font-size:13px; text-decoration:none; }
.spr-sources a:hover { color:var(--accent); text-decoration:underline; }
.spr-more { display:block; min-height:36px; margin:8px auto 0; border:0; background:transparent; color:var(--accent); font:inherit; font-size:13px; font-weight:700; cursor:pointer; }
.spr-market-evidence { padding:0; overflow:hidden; }
.spr-market-evidence > summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; min-height:58px; padding:14px 20px; cursor:pointer; list-style:none; }
.spr-market-evidence > summary::-webkit-details-marker { display:none; }
.spr-market-evidence > summary > span:first-child { display:grid; gap:.2rem; min-width:0; }
.spr-market-evidence > summary strong { color:var(--text-primary); font-size:15px; }
.spr-market-evidence > summary small { overflow:hidden; color:var(--text-muted); font-size:13px; line-height:1.4; text-overflow:ellipsis; white-space:nowrap; }
.spr-market-evidence-action { flex:0 0 auto; color:var(--accent); font-size:13px; font-weight:700; }
.spr-market-evidence[open] > summary { border-bottom:1px solid var(--border-subtle); }
.spr-market-evidence[open] .spr-market-evidence-action { font-size:0; }
.spr-market-evidence[open] .spr-market-evidence-action::after { content:"Hide"; font-size:13px; }
.spr-market-evidence > :not(summary) { margin:.8rem; }
.spr-strategy-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.65rem; margin-top:1rem; }
.spr-strategy-preview { display:flex; align-items:flex-start; gap:.65rem; margin-top:.8rem; padding:12px; border:1px solid var(--border-subtle); border-radius:9px; background:var(--surface-muted); }
.spr-strategy-preview strong { flex:0 0 auto; color:var(--text-primary); font-size:13px; }
.spr-strategy-preview span { color:var(--text-secondary); font-size:13px; line-height:1.5; }
.spr-strategy-summary > div { display:grid; align-content:start; gap:4px; min-width:0; padding:12px; border:1px solid var(--border-subtle); border-radius:9px; background:var(--surface-muted); }
.spr-strategy-summary span { color:var(--text-muted); font-size:12.5px; font-weight:700; letter-spacing:.02em; text-transform:uppercase; }
.spr-strategy-summary strong { color:var(--text-primary); font-size:14px; }
.spr-strategy-summary small { color:var(--text-secondary); font-size:13px; line-height:1.45; }
.spr-stay-base { max-width:15rem; margin-top:.8rem; }
.spr-stay-summary { margin-top:.75rem; }
.spr-expert-controls { margin-top:.75rem; border:1px solid var(--border-subtle); border-radius:10px; background:var(--bg-elevated); overflow:hidden; }
.spr-expert-controls > summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; min-height:58px; padding:14px 16px; cursor:pointer; list-style:none; }
.spr-expert-controls > summary::-webkit-details-marker { display:none; }
.spr-expert-controls > summary > span:first-child { display:grid; gap:.14rem; }
.spr-expert-controls > summary strong { color:var(--text-primary); font-size:15px; }
.spr-expert-controls > summary small { color:var(--text-muted); font-size:13px; line-height:1.4; }
.spr-expert-controls > summary > span:last-child { color:var(--accent); font-size:13px; font-weight:700; }
.spr-expert-controls[open] > summary { border-bottom:1px solid var(--border-subtle); }
.spr-expert-controls[open] > summary > span:last-child { font-size:0; }
.spr-expert-controls[open] > summary > span:last-child::after { content:"Close"; font-size:13px; }
.spr-expert-controls > :not(summary) { margin:.75rem; }

/* Property-specific date changes stay concise. Portfolio rules are useful
   context, but rendering every inherited event/rule as if it were a manual
   property edit buried the controls and made the page look unbounded. */
.sp-date-changes-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
.sp-date-add { flex:0 0 auto; }
.sp-date-changes-list { display:grid; gap:10px; margin-top:14px; }
.sp-date-changes-empty { padding:14px; }
.sp-date-changes-empty p { margin:.3rem 0 0; }
.sp-date-change-row,.sp-date-inherited-row { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--border-subtle); border-radius:9px; background:var(--bg-elevated); }
.sp-date-change-copy { min-width:0; }
.sp-date-change-copy > strong { display:block; overflow:hidden; color:var(--text-primary); font-size:14px; text-overflow:ellipsis; white-space:nowrap; }
.sp-date-change-copy > span { display:block; overflow:hidden; margin-top:3px; font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
.sp-date-change-effect { color:var(--text-primary); font-size:14px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.sp-date-change-actions { display:flex; align-items:center; gap:.25rem; }
.sp-date-change-actions .btn-icon { inline-size:36px; block-size:36px; }
.sp-date-show-more { justify-self:start; min-height:36px; border:0; padding:7px 0; background:transparent; color:var(--accent); font:inherit; font-size:13px; font-weight:700; }
.sp-date-inherited { overflow:hidden; border:1px solid var(--border-subtle); border-radius:10px; background:var(--surface-muted); }
.sp-date-inherited > summary { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:52px; padding:10px 14px; cursor:pointer; list-style:none; }
.sp-date-inherited > summary::-webkit-details-marker { display:none; }
.sp-date-inherited > summary > span { display:grid; gap:.12rem; min-width:0; }
.sp-date-inherited > summary strong { color:var(--text-primary); font-size:14px; }
.sp-date-inherited > summary small { color:var(--text-muted); font-size:13px; }
.sp-date-inherited > summary > svg { display:block; flex:0 0 auto; margin:0; transition:transform .15s ease; }
.sp-date-inherited[open] > summary > svg { transform:rotate(180deg); }
.sp-date-inherited-list { display:grid; gap:.5rem; padding:.6rem; border-top:1px solid var(--border-subtle); }
.sp-date-inherited-row { grid-template-columns:minmax(0,1fr) auto; border-style:dashed; background:var(--bg-elevated); }
.sp-override-backdrop { position:fixed; inset:0; z-index:1000; display:flex; align-items:center; justify-content:center; padding:1.25rem; background:rgba(15,23,42,.58); backdrop-filter:blur(3px); }
.sp-override-dialog { width:min(520px,100%); max-height:min(90vh,760px); overflow:auto; padding:1.15rem; border:1px solid var(--border); border-radius:16px; background:var(--bg-elevated); color:var(--text-primary); box-shadow:0 24px 60px rgba(15,23,42,.28); }
.sp-override-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
.sp-override-dialog-head h3 { margin:0; font-size:1.05rem; }
.sp-override-dialog-head p { margin:.35rem 0 0; color:var(--text-muted); font-size:14px; line-height:1.5; }
.sp-override-dialog-head .btn-icon { display:grid; flex:0 0 auto; inline-size:36px; block-size:36px; place-items:center; }
.sp-override-dialog .sp-field-label { font-size:13px; }
.sp-override-dialog .sp-input { min-height:40px; font-size:14px; }
.sp-override-dialog .sp-segmented-btn { min-height:40px; font-size:13px; }
.sp-override-date-grid { display:grid; grid-template-columns:1fr 1fr; gap:.75rem; margin-top:1rem; }
.sp-override-fieldset { display:grid; gap:.45rem; margin:1rem 0 0; padding:0; border:0; }
.sp-override-mode,.sp-override-direction { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.sp-override-mode.has-legacy { grid-template-columns:repeat(3,minmax(0,1fr)); }
.sp-override-field { display:grid; gap:.4rem; margin-top:.85rem; }
.sp-override-field > .sp-input { width:100%; }
.sp-override-number { position:relative; }
.sp-override-number .sp-input { width:100%; padding-left:2rem; }
.sp-override-number > span { position:absolute; top:50%; left:.75rem; color:var(--text-muted); transform:translateY(-50%); pointer-events:none; }
.sp-override-number.is-percent .sp-input { padding-right:2rem; padding-left:.75rem; }
.sp-override-number.is-percent > span { right:.75rem; left:auto; }
.sp-override-preview { display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin:.95rem 0 0; padding:.7rem .8rem; border:1px solid color-mix(in srgb,var(--accent) 28%,var(--border-subtle)); border-radius:10px; background:color-mix(in srgb,var(--accent) 7%,var(--bg-elevated)); }
.sp-override-preview strong { color:var(--text-primary); font-size:14px; }
.sp-override-preview span { color:var(--text-muted); font-size:13px; text-align:right; }
.sp-override-error { margin:.8rem 0 0; color:var(--state-danger); font-size:13px; line-height:1.45; }
.sp-override-conflict { margin:.8rem 0 0; padding:.7rem .8rem; border-radius:9px; background:var(--surface-muted); color:var(--text-secondary); font-size:13px; line-height:1.5; }
.sp-override-dialog-foot { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-top:1.1rem; padding-top:.9rem; border-top:1px solid var(--border-subtle); }
.sp-override-dialog-foot > p { max-width:30ch; margin:0; color:var(--text-muted); font-size:13px; line-height:1.45; }
.sp-override-dialog-foot > div { display:flex; flex:0 0 auto; gap:.6rem; }
@container (max-width: 420px) {
  .spr-head,.spr-card-top { align-items:stretch; flex-direction:column; }
  .spr-count,.spr-verdict { align-self:flex-start; }
  .spr-actions { display:grid; grid-template-columns:1fr; }
  .spr-actions .btn { width:100%; }
  .spr-strategy-summary { grid-template-columns:1fr; }
  .spr-strategy-preview,.sp-date-changes-head { align-items:stretch; flex-direction:column; }
  .sp-date-add { width:100%; }
  .sp-date-change-row { grid-template-columns:minmax(0,1fr) auto; }
  .sp-date-change-actions { grid-column:1 / -1; }
}
@media (max-width: 560px) {
  .sp-override-backdrop { align-items:flex-end; padding:0; }
  .sp-override-dialog { width:100%; max-height:92dvh; padding:1rem; border-radius:18px 18px 0 0; }
  .sp-override-date-grid { grid-template-columns:1fr; }
  .sp-override-mode.has-legacy { grid-template-columns:1fr; }
  .sp-override-preview,.sp-override-dialog-foot { align-items:stretch; flex-direction:column; }
  .sp-override-preview span { text-align:left; }
  .sp-override-dialog-foot > p { max-width:none; }
  .sp-override-dialog-foot > div { display:grid; grid-template-columns:1fr 1fr; width:100%; }
}

/* ================= SHORT DESKTOP HEIGHT (641px+ wide, <=800px tall) =================
   Width-only responsive rules cannot see a 1366x768-class monitor once the browser
   chrome has taken its share of the screen. Keep type and touch targets legible, but
   reclaim vertical room from shared workspace spacing. The Inbox composer gets a
   hard viewport-relative ceiling so writing can never consume the conversation.
   Phone has its own chrome and is deliberately excluded by min-width. The named
   end marker keeps this spacing-only contract independently testable. */
@media (min-width: 641px) and (max-height: 800px) {
  .workspace-shell {
    height: calc(100dvh - 6px);
    gap: 0.35rem;
    padding: 4px 6px 4px 3px;
  }

  .workspace-topbar {
    min-height: 38px;
    gap: 0.3rem;
    padding: 0.18rem 0.3rem;
  }

  .workspace-tab,
  .workspace-tab-add,
  .workspace-topbar-action {
    min-height: 30px;
    height: 30px;
  }

  .workspace-pane-head {
    padding: 0.45rem 0.65rem;
  }

  .workspace-list-scroll:not(.workspace-list-scroll--calendar) {
    gap: 0.3rem;
    padding-block: 0.3rem;
  }

  .inbox-glasshead {
    gap: 5px;
    padding-top: 0.35rem;
    padding-bottom: 0.25rem;
  }

  .inbox-glasshead .workspace-list-toolbar {
    height: 36px;
  }

  .workspace-quickchip {
    height: 24px;
  }

  .wl2-row {
    gap: 9px;
    padding-block: 6px;
  }

  .wl2-avatar,
  .wl2-avatar-img,
  .wl2-avatar-fallback {
    width: 36px;
    height: 36px;
  }

  .wl2-avatar {
    flex-basis: 36px;
  }

  .inbox-chat-head {
    gap: 0.35rem;
    padding: 0.5rem 0.65rem 0.45rem;
  }

  .inbox-chat-avatar {
    width: 32px;
    height: 32px;
  }

  .inbox-chat-sub {
    margin-bottom: 0.15rem;
  }

  .inbox-bubbles {
    min-height: min(9rem, 26vh);
    padding: 0.45rem 0.65rem;
  }

  .inbox-compose {
    max-height: min(20rem, 42vh);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0.45rem 0.65rem 0.55rem;
  }

  .inbox-context-bar {
    margin-bottom: 0.25rem;
  }

  .inbox-email-head {
    gap: 0.15rem;
    padding: 0.15rem 0.1rem 0.3rem;
    margin-bottom: 0.1rem;
  }

  .inbox-email-head-input {
    padding-block: 0.12rem;
  }

  .inbox-rich-editor.is-email {
    padding: 0.65rem 0.75rem;
  }

  .inbox-rich-editor.is-email:focus-within {
    min-height: min(7rem, 18vh);
  }

  .inbox-rich-editor.is-email:focus-within .ProseMirror {
    min-height: min(5rem, 13vh);
  }

  .inbox-email-toolbar {
    margin: -0.65rem -0.75rem 0.7rem;
    padding: 0.3rem 0.6rem;
  }

  .inbox-compose-actions {
    margin-top: 0.3rem;
  }

  .inbox-sig-footer {
    margin-top: 0.25rem;
    padding-top: 0.3rem;
  }
}
/* END SHORT DESKTOP HEIGHT CONTRACT */

/* Staff working schedules use the pane 2 view dropdown and one canonical
   working-pattern editor shared by desktop and phone. */
.property-calendar-staff-row-toggle {
  min-height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--cal-line);
  border-radius: 9px;
  background: var(--cal-surface-2);
  color: var(--cal-muted);
  font: inherit;
  font-size: 0.67rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.property-calendar-staff-row-toggle small {
  padding: 0.08rem 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cal-muted) 13%, transparent);
  color: inherit;
  font-size: 0.55rem;
  font-weight: 800;
  text-transform: uppercase;
}
.property-calendar-staff-row-toggle:hover,
.property-calendar-staff-row-toggle:focus-visible,
.property-calendar-staff-row-toggle.is-active {
  border-color: color-mix(in srgb, #14b8a6 55%, var(--cal-line));
  background: color-mix(in srgb, #14b8a6 12%, var(--cal-surface-2));
  color: var(--cal-text);
  outline: 0;
}

.staff-work-schedule-editor {
  display: grid;
  gap: 0.75rem;
  padding: 0.78rem;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg-elevated));
}

.staff-work-schedule-heading,
.staff-work-schedule-actions,
.staff-work-schedule-day,
.staff-work-schedule-times {
  display: flex;
  align-items: center;
}

.staff-work-schedule-heading {
  justify-content: space-between;
  gap: 0.5rem;
}

.staff-work-schedule-heading > div { min-width: 0; }
.staff-work-schedule-heading span,
.staff-work-schedule-heading strong { display: block; }
.staff-work-schedule-heading > div > span {
  color: var(--text-muted);
  font-size: 0.61rem;
  font-weight: 760;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.staff-work-schedule-heading > div > strong {
  margin-top: 0.15rem;
  font-size: 0.8rem;
}
.staff-work-schedule-saved {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  gap: 0.25rem;
  color: var(--success, #22c55e) !important;
  font-size: 0.67rem !important;
  font-weight: 750;
}

.staff-work-schedule-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.staff-work-schedule-modes > button {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 0.42rem;
  padding: 0.58rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.staff-work-schedule-modes > button.is-active {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--border));
  background: color-mix(in srgb, var(--accent) 11%, var(--bg));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.staff-work-schedule-modes strong,
.staff-work-schedule-modes small { display: block; }
.staff-work-schedule-modes strong { color: var(--text); font-size: 0.7rem; line-height: 1.25; }
.staff-work-schedule-modes small { margin-top: 0.12rem; font-size: 0.61rem; line-height: 1.35; }

.staff-work-schedule-week {
  display: grid;
  gap: 0.28rem;
}
.staff-work-schedule-day {
  min-height: 35px;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.28rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
.staff-work-schedule-day > label {
  min-width: 86px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 710;
}
.staff-work-schedule-day.is-on > label { color: var(--text); }
.staff-work-schedule-day input[type="checkbox"] { accent-color: var(--accent); }
.staff-work-schedule-times { gap: 0.3rem; }
.staff-work-schedule-times span,
.staff-work-schedule-off { color: var(--text-muted); font-size: 0.61rem; }
.staff-work-schedule-times input {
  width: 72px;
  min-width: 0;
  height: 27px;
  padding: 0 0.25rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.65rem;
}
.staff-work-schedule-note,
.staff-work-schedule-assigned p {
  margin: 0.35rem 0 0 !important;
  font-size: 0.67rem !important;
}
.staff-work-schedule-assigned {
  padding: 0.65rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
}
.staff-work-schedule-assigned > strong { font-size: 0.73rem; }
.staff-work-schedule-assigned .btn { margin-top: 0.55rem; }
.staff-work-schedule-actions { flex-wrap: wrap; gap: 0.35rem; }
.staff-work-schedule-actions .btn,
.staff-work-schedule-assigned .btn,
.staff-work-schedule-editor.is-external .btn {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0 0.65rem;
  font-size: 0.65rem;
}
.staff-work-schedule-error { color: var(--danger) !important; }
.staff-work-schedule-editor.is-external {
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
}
.staff-work-schedule-editor.is-external .btn { grid-column: 1 / -1; }
.staff-work-schedule-external-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  color: var(--accent);
}

.staff-rota-modal {
  width: min(760px, calc(100vw - 32px));
}
.staff-rota-body {
  display: grid;
  gap: 0.85rem;
}
.staff-rota-section {
  display: grid;
  gap: 0.55rem;
  padding: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
}
.staff-rota-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.staff-rota-section-head > strong {
  color: var(--text);
  font-size: 0.78rem;
}
.staff-rota-section-head > button,
.staff-rota-presets > button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 720;
}
.staff-rota-people {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  max-height: 184px;
  overflow: auto;
}
.staff-rota-people > label {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 28px minmax(0, 1fr);
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
}
.staff-rota-people > label.is-selected {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, var(--bg-elevated));
}
.staff-rota-people input[type="checkbox"] { accent-color: var(--accent); }
.staff-rota-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}
.staff-rota-people > label > span:last-child { min-width: 0; }
.staff-rota-people strong,
.staff-rota-people small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.staff-rota-people strong { color: var(--text); font-size: 0.7rem; }
.staff-rota-people small { margin-top: 0.08rem; color: var(--text-muted); font-size: 0.6rem; }
.staff-rota-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.staff-rota-presets > span {
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 740;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.staff-rota-add-shift {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-elevated));
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 740;
}
.staff-rota-add-shift:disabled { cursor: default; opacity: 0.5; }
.staff-rota-modal .properties-res-action-btn.is-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
@media (max-width: 720px) {
  .staff-rota-people { grid-template-columns: 1fr; }
  .staff-rota-modal .staff-work-schedule-modes { grid-template-columns: 1fr; }
}

.staff-calendar-right-key > summary {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  cursor: pointer;
  color: var(--text);
  font-size: 0.76rem;
  list-style: none;
}
.staff-calendar-right-key > summary::-webkit-details-marker { display: none; }
.staff-calendar-right-key:not([open]) .staff-calendar-right-section-head,
.staff-calendar-right-key:not([open]) .staff-calendar-right-key-row { display: none; }
.staff-calendar-right-swatch[data-kind="regular"] { background: #14b8a6; }

.property-calendar-task-chip.is-planned-work {
  border-style: dashed;
  background: color-mix(in srgb, #14b8a6 10%, var(--bg-elevated));
}

.ph-staff-detail-actions { display: flex; align-items: center; gap: 5px; }
.ph-staff-detail-actions > button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: var(--ph-accent-wash);
  color: var(--ph-accent-soft);
  font: inherit;
  font-size: 9.5px;
  font-weight: 760;
}
.ph-staff-schedule-list > button.is-planned-work {
  border-style: dashed;
  border-color: color-mix(in srgb, #14b8a6 44%, var(--ph-border));
  background: color-mix(in srgb, #14b8a6 9%, var(--ph-surface));
}
.ph-staff-schedule-sheet {
  max-height: min(88dvh, 760px);
  overflow-y: auto;
}
.ph-staff-schedule-sheet .staff-work-schedule-editor {
  margin: 10px 8px 22px;
  --bg: var(--ph-bg);
  --bg-elevated: var(--ph-surface);
  --text: var(--ph-text);
  --text-muted: var(--ph-text-2);
  --border: var(--ph-border);
  --accent: var(--ph-accent);
}
/* Pricing & Stay revenue workbench — one readable type scale and calm control
   density across the nightly, stay, publishing and supporting-calendar areas. */
.sp-root .properties-section-h2 {
  margin-bottom: 8px;
  padding-bottom: 0;
  border-bottom: 0;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.sp-root .properties-section-h3,
.sp-root .sp-found-subhead {
  font-size: 16px;
  font-weight: 720;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

.sp-root .sp-found-subhead {
  margin: 24px 0 4px;
  padding-bottom: 0;
  border-bottom: 0;
}

.sp-root .properties-section-lead,
.sp-root .sp2-section-sub,
.sp-root .sp2-band-sub,
.sp-root .sp-found-subhead-desc,
.sp-root .sp-adj-desc,
.sp-root .sp-info-line,
.sp-root .sp-warn-line,
.sp-root .sp-suggestion-body p,
.sp-root .sp-suggestion-status,
.sp-root .sp-seasons-sub,
.sp-root .sp-seasons-empty,
.sp-root .sp-seasons-hint {
  font-size: 14px;
  line-height: 1.55;
}

.sp-root .sp-label,
.sp-root .sp-sfx,
.sp-root .sp-adj-toggle,
.sp-root .sp-adj-adv-toggle,
.sp-root .sp-dir-btn,
.sp-root .sp-dir-unit,
.sp-root .sp-fgroup-summary,
.sp-root .sp-factor-pill {
  font-size: 14px;
  letter-spacing: 0;
}

.sp-root .sp-label {
  color: var(--text-secondary);
  text-transform: none;
}

.sp-root .sp-input,
.sp-root .selectmenu-trigger,
.sp-root .sp-fetch-btn,
.sp-root .sp2-btn,
.sp-root .sp2-btn-ghost,
.sp-root .btn {
  min-height: 42px;
  font-size: 14px;
}

.sp-root .sp2-band {
  padding: 18px;
  border-radius: 12px;
  box-shadow: none;
}

.sp-root .sp-stayrules-card {
  padding: 24px !important;
}

.sp-root .sp-stayrules-card .properties-subsection.sp-adj {
  margin-top: 12px;
  padding: 18px;
  background: var(--bg-elevated);
  box-shadow: none;
}

.sp-root .sp-stayrules-card .sp-adj-body {
  margin-top: 16px;
  padding-top: 16px;
}

.sp-root .sp-stayrules-card .sp-adj-toggle {
  min-height: 40px;
}

.spr-stay-base {
  max-width: 260px;
  margin-top: 14px;
}

.spr-stay-adjust-heading {
  margin-top: 28px !important;
}

.spr-publishing-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.spr-workflow-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 72px;
  padding: 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-elevated);
}

.spr-workflow-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spr-workflow-heading > span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 780;
}

.spr-workflow-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.spr-workflow-heading p {
  max-width: 70ch;
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}

.spr-workflow-section > .sp2-section,
.spr-workflow-section > details.sp2-section {
  background: var(--surface-muted);
  box-shadow: none;
}

.pnav-pricing .pnav-status-txt,
.pnav-pricing .pricing-publication-status,
.pnav-pricing .pnav-tab-btn,
.pnav-pricing .pnav-preview-pending,
.pnav-pricing .pnav-empty,
.pnav-pricing .pnav-retry-btn,
.pnav-pricing .pviz-takeaway {
  font-size: 16px;
}

.pnav-pricing .pviz-pill,
.pnav-pricing .pviz-scope,
.pnav-pricing .pviz-legend-item,
.pnav-pricing .pviz-pace-axis-lbl,
.pnav-pricing .pviz-hist-axis-lbl {
  font-size: 14px;
}

.pnav-pricing .pnav-tab-btn,
.pnav-pricing .pnav-pdf-btn,
.pnav-pricing .pnav-pdf-type,
.pnav-pricing .pnav-preview-expand {
  min-height: 40px;
  font-size: 16px;
}

/* Pricing is a working surface, not a compact dashboard. Secondary copy must
   remain readable in both the main editor and the persistent calendar pane. */
.spr-count,
.spr-empty span,
.spr-confidence,
.spr-date,
.spr-verdict,
.spr-metrics,
.spr-sources a,
.spr-more,
.spr-market-evidence > summary small,
.spr-market-evidence-action,
.spr-market-evidence[open] .spr-market-evidence-action::after,
.spr-strategy-preview strong,
.spr-strategy-preview span,
.spr-strategy-summary span,
.spr-strategy-summary small,
.spr-expert-controls > summary small,
.spr-expert-controls > summary > span:last-child,
.spr-expert-controls[open] > summary > span:last-child::after,
.sp-date-change-copy > span,
.sp-date-show-more,
.sp-date-inherited > summary small,
.sp-override-dialog .sp-field-label,
.sp-override-dialog .sp-segmented-btn,
.sp-override-preview span,
.sp-override-error,
.sp-override-conflict,
.sp-override-dialog-foot > p {
  font-size: 14px;
  line-height: 1.5;
}

.spr-actions .btn,
.spr-more,
.sp-date-show-more,
.sp-override-dialog .sp-segmented-btn {
  min-height: 40px;
  font-size: 14px;
}

.pnav-pricing .pnav-revsec-foot,
.pnav-pricing .pnav-hero-lbl,
.pnav-pricing .pnav-hero-stat-lbl,
.pnav-pricing .pnav-band-k,
.pnav-pricing .pnav-mkt-lbl,
.pnav-pricing .pnav-mkt-section-title,
.pnav-pricing .pnav-mkt-source,
.pnav-pricing .pnav-monthly-rev-title,
.pnav-pricing .pnav-monthly-rev-note,
.pnav-pricing .pnav-monthly-lbl,
.pnav-pricing .pnav-monthly-occ,
.pnav-pricing .pnav-monthly-val,
.pnav-pricing .pnav-narrative,
.pnav-pricing .pviz-spike-chip-name,
.pnav-pricing .pviz-note,
.pnav-pricing .pviz-empty-txt,
.pnav-pricing .pnav-pdf-dialog-sub,
.pnav-pricing .pnav-pdf-dialog-lbl {
  font-size: 16px;
  line-height: 1.5;
}

.pnav-pricing .pnav-dow-bar-lbl,
.pnav-pricing .pnav-dow-bar-pct,
.pnav-pricing .pnav-mkt-month-lbl,
.pnav-pricing .pnav-mkt-month-pct,
.pnav-pricing .pnav-peak-chip-date,
.pnav-pricing .pnav-peak-chip-pct,
.pnav-pricing .pviz-spike-date,
.pnav-pricing .pviz-spike-chip-lift {
  font-size: 14px;
  line-height: 1.5;
}

.sp-quick-sub,
.sp-quick-step-lbl,
.sp-quick-choice-d,
.sp-quick-loading-msg,
.sp-quick-review-lbl,
.sp-quick-review-meta,
.sp-quick-goal,
.sp-quick-factors-lbl,
.sp-quick-factor-list li,
.sp-quick-factor-desc,
.sp-quick-done-p,
.sp-autocfg-sub,
.sp-autocfg-empty,
.sp-autocfg-group-h,
.sp-autocfg-row,
.sp-auto-status,
.sp-auto-undo {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

.sp-quick-factors-lbl,
.sp-autocfg-group-h {
  color: var(--text-secondary);
  text-transform: none;
}

.sp-quick-step-num {
  width: 26px;
  height: 26px;
  font-size: 13px;
}

.sp-quick-modal .segmented-control-btn,
.sp-quick-actions .btn,
.sp-autocfg-actions .btn,
.sp-auto-undo {
  min-height: 42px;
  font-size: 14px;
}

.sp-autocfg-close {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
}

/* The calendar remains visible while the host edits pricing. It uses the same
   readable scale as the editor even when its resizable pane becomes compact. */
.pnav-pricing .sp3-pc-stat-lbl,
.pnav-pricing .sp3-pc-pending,
.pnav-pricing .sp3-pc-wf-headerdelta,
.pnav-pricing .sp3-pc-wf-lbl,
.pnav-pricing .sp3-pc-wf-delta,
.pnav-pricing .sp3-pc-wf-run,
.pnav-pricing .sp3-pc-wf-dormant,
.pnav-pricing .sp3-pc-wf-guard,
.pnav-pricing .sp3-pc-mode-note-txt,
.pnav-pricing .sp3-pc-pager-range {
  font-size: 16px;
  line-height: 1.45;
}

.pnav-pricing .sp3-pc-legend-lbl,
.pnav-pricing .sp3-pc-dow,
.pnav-pricing .sp3-pc-month,
.pnav-pricing .sp3-pc-dn,
.pnav-pricing .sp3-pc-booked-lbl,
.pnav-pricing .sp3-pc-modetag,
.pnav-pricing .sp3-pc-list-dow,
.pnav-pricing .sp3-pc-list-dnum,
.pnav-pricing .sp3-pc-list-booked,
.pnav-pricing .sp3-pc-list-month {
  font-size: 14px;
  line-height: 1.45;
}

.pnav-pricing .sp3-pc-price,
.pnav-pricing .sp3-pc-list-price {
  font-size: 16px;
  line-height: 1.25;
}

.pnav-pricing .sp3-pc-cell.is-today::after,
.pnav-pricing .sp3-pc-ms,
.pnav-pricing .sp3-pc-list-today,
.pnav-pricing .sp3-pc-list-ms,
.pnav-pricing .sp3-pc-wf-lbl small {
  font-size: 14px !important;
  line-height: 1.4 !important;
}

.pnav-pricing .sp3-pc-wf-close {
  width: 40px;
  height: 40px;
  font-size: 16px;
}

.pnav-pricing .sp3-pc-pager-btn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 16px;
}

/* Monthly rent is part of the same workspace and must not fall back to the
   old dashboard's tiny labels or decorative gradient card. */
.sp-root .llp2-headline {
  background: var(--surface-muted);
  border-color: var(--border-subtle);
}

.sp-root .llp2-enable-lbl,
.sp-root .llp2-canonical-kicker,
.sp-root .llp2-canonical-copy strong,
.sp-root .llp2-canonical-copy small,
.sp-root .llp2-canonical-control > label,
.sp-root .llp2-rent-input-row,
.sp-root .llp2-canonical-load-error,
.sp-root .llp2-canonical-loading,
.sp-root .llp2-empty,
.sp-root .llp2-num-lbl,
.sp-root .llp2-range,
.sp-root .llp2-vsmkt,
.sp-root .llp2-decision,
.sp-root .llp2-factor,
.sp-root .llp2-annual-lbl,
.sp-root .llp2-annual-meta,
.sp-root .llp2-evidence-grid span,
.sp-root .llp2-trace li,
.sp-root .llp2-trace-status,
.sp-root .llp2-comps-lbl,
.sp-root .llp2-comp-source,
.sp-root .llp2-comp-title,
.sp-root .llp2-comp-addr,
.sp-root .llp2-advertised,
.sp-root .llp2-foot,
.pnav-pricing .llp2-side-empty,
.pnav-pricing .llp2-side-lbl,
.pnav-pricing .llp2-side-range,
.pnav-pricing .llp2-side-annual-lbl,
.pnav-pricing .llp2-side-comps-lbl,
.pnav-pricing .llp2-side-comp-src,
.pnav-pricing .llp2-side-comp-title,
.pnav-pricing .llp2-side-comp-rent,
.pnav-pricing .llp2-side-foot {
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
}

.sp-root .llp2-rent-input-row,
.sp-root .llp2-rent-save-btn,
.sp-root .llp2-actions .btn {
  min-height: 42px;
  font-size: 14px;
}

.sp-root .llp2-comp-rent,
.sp-root .llp2-evidence-grid strong,
.pnav-pricing .llp2-side-annual-val {
  font-size: 15px;
}

@media (max-width: 680px) {
  .sp-root .sp-stayrules-card,
  .spr-workflow-section {
    padding: 18px !important;
  }
}

