  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; overflow: hidden; }
  body {
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.4;
    color: var(--fg-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
  }
  button { font-family: inherit; }

  /* ---------- Grid shell ---------- */
  .shell {
    display: grid;
    /* minmax(0,1fr): let the board track shrink below the board's 1100px
     * min-width so it scrolls internally (it has overflow:auto) instead of
     * forcing the columns past the viewport and pushing the 380px panel off
     * the right edge. */
    grid-template-columns: 52px minmax(0, 1fr) var(--panel-w, 0px);
    grid-template-rows: 44px 40px 1fr 28px;
    grid-template-areas:
      "icons topbar topbar"
      "icons ribbon ribbon"
      "icons board  panel"
      "icons stats  panel";
    height: 100vh;
    width: 100vw;
  }
  .shell[data-panel-open="true"] { --panel-w: 380px; }

  /* Chat dock — only present on day board page */
  .shell[data-chat="open"] {
    grid-template-rows: 44px 40px 1fr var(--chat-h, 220px) 28px;
    grid-template-areas:
      "icons topbar topbar"
      "icons ribbon ribbon"
      "icons board  panel"
      "icons chat   panel"
      "icons stats  panel";
  }
  .shell[data-chat="open"][data-chat-state="collapsed"] { --chat-h: 30px; }
  .shell[data-chat="open"][data-chat-state="expanded"]  { --chat-h: min(50vh, 460px); }

  /* ---------- Sidebar icons (collapsed) ---------- */
  .icons {
    grid-area: icons;
    background: var(--canopy-800);
    border-right: 1px solid var(--canopy-700);
    display: flex; flex-direction: column;
    padding: 10px 0;
    align-items: center; gap: 4px;
  }
  .icons .brand {
    width: 28px; height: 28px;
    background: var(--sunlight-400);
    border-radius: 50%;
    margin-bottom: 12px;
    position: relative;
    flex-shrink: 0;
  }
  .icons .brand::after {
    content: ""; position: absolute; inset: 6px;
    background: var(--canopy-800); border-radius: 50%;
  }
  .icons > button {
    width: 36px; height: 36px;
    border: 0; background: transparent;
    color: var(--canopy-200);
    border-radius: 6px;
    display: grid; place-items: center;
    cursor: pointer;
    position: relative;
    transition: background 120ms;
  }
  .icons > button:hover { background: rgba(255,255,255,0.06); color: var(--mist-25); }
  .icons > button[data-active="true"] { background: var(--canopy-600); color: var(--mist-25); }
  .icons > button .badge {
    position: absolute; top: 4px; right: 4px;
    background: var(--sunlight-400); color: var(--canopy-900);
    font-family: var(--font-mono); font-size: 9px; line-height: 1;
    padding: 2px 4px; border-radius: 999px;
    font-weight: 600;
  }
  .icons .me {
    margin-top: auto;
    width: 32px; height: 32px;
    background: var(--canopy-700); color: var(--mist-25);
    border: 1px solid var(--canopy-600);
    border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--font-display); font-size: 12px;
    cursor: pointer;
    transition: transform 120ms, box-shadow 120ms;
    position: relative;
  }
  .icons .me:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(7,20,12,0.25);
  }
  .icons .me::after {
    content: "";
    position: absolute;
    bottom: 0; right: 0;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--moss-400);
    border: 1.5px solid var(--canopy-800);
  }
  .icons .me[data-status="busy"]::after { background: #C24A36; }
  .icons .me[data-status="away"]::after { background: var(--sunlight-400); }

  /* ---------- Profile popover ---------- */
  .profile-pop {
    position: absolute;
    bottom: 14px;
    left: 60px;
    width: 280px;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(7,20,12,0.22), 0 4px 10px rgba(7,20,12,0.08);
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transform-origin: bottom left;
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
  }
  .profile-pop[data-open="true"] {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .pp-head {
    display: flex; gap: 10px; align-items: center;
    padding: 14px 14px 12px;
    background: linear-gradient(180deg, var(--canopy-50), var(--bg-surface) 90%);
    border-bottom: 1px solid var(--border-subtle);
  }
  .pp-av {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--canopy-700);
    color: var(--mist-25);
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 15px;
    flex-shrink: 0;
  }
  .pp-meta { min-width: 0; flex: 1; }
  .pp-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pp-mail {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
  }
  .pp-role {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px;
    color: var(--fg-secondary);
    margin-top: 6px;
  }

  .pp-section { padding: 10px 12px; }
  .pp-section-tight { padding-top: 4px; padding-bottom: 4px; }
  .pp-section-head {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-tertiary);
    margin-bottom: 6px;
    padding-left: 2px;
  }

  .pp-status-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .pp-status {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    padding: 6px 4px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    border-radius: 6px;
    font-family: inherit;
    font-size: 11.5px;
    color: var(--fg-secondary);
    cursor: pointer;
    transition: all 120ms;
  }
  .pp-status:hover { background: var(--bg-sunken); color: var(--fg-primary); }
  .pp-status[data-active="true"] {
    background: var(--canopy-700);
    border-color: var(--canopy-700);
    color: var(--mist-25);
  }
  .pp-status .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
  }
  .pp-status .dot.live { background: var(--moss-400); }
  .pp-status .dot.busy { background: #C24A36; }
  .pp-status .dot.away { background: var(--sunlight-400); }

  .pp-row {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 7px 8px;
    border: 0; background: transparent;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 120ms;
    margin-bottom: 2px;
  }
  .pp-row:hover { background: var(--bg-sunken); }
  .pp-row[data-active="true"] { background: var(--mist-50); }
  .pp-row-av {
    width: 28px; height: 28px;
    border-radius: 50%;
    color: var(--mist-25);
    display: grid; place-items: center;
    font-family: var(--font-display);
    font-size: 12px;
    flex-shrink: 0;
  }
  .pp-row-av.canopy { background: var(--canopy-700); }
  .pp-row-av.personal {
    background: transparent;
    border: 1.5px dashed var(--canopy-400);
    color: var(--canopy-600);
  }
  .pp-row-meta { flex: 1; min-width: 0; }
  .pp-row-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pp-row-sub {
    font-size: 11px;
    color: var(--fg-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pp-check {
    color: var(--canopy-600);
    font-size: 14px;
    flex-shrink: 0;
  }
  .pp-row-quiet {
    color: var(--fg-tertiary);
    font-size: 12px;
    padding-left: 14px;
  }

  .pp-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 2px 0;
  }

  .pp-link {
    display: flex; align-items: center; gap: 10px;
    width: 100%;
    padding: 7px 8px;
    border: 0; background: transparent;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--fg-primary);
    transition: background 120ms;
  }
  .pp-link:hover { background: var(--bg-sunken); }
  .pp-link > span { flex: 1; min-width: 0; }
  .pp-link-svg {
    width: 14px; height: 14px;
    color: var(--fg-tertiary);
    flex-shrink: 0;
  }
  .pp-link:hover .pp-link-svg { color: var(--fg-secondary); }
  .pp-link-kbd {
    flex: 0 0 auto !important;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-tertiary);
    padding: 1px 5px;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: 3px;
    min-width: 18px;
    text-align: center;
  }
  .pp-link-sub {
    flex: 0 0 auto !important;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-tertiary);
  }
  .pp-link-ct {
    flex: 0 0 auto !important;
    font-family: var(--font-mono);
    font-size: 10px;
    background: var(--sunlight-400);
    color: var(--canopy-900);
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 500;
  }
  .pp-link-quiet { color: var(--fg-tertiary); }
  .pp-link-quiet:hover { color: var(--fg-primary); }

  .pp-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding: 4px 12px 10px;
  }
  .pp-foot .pp-link { width: auto; padding-left: 6px; padding-right: 6px; }
  .pp-build {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--fg-muted);
    letter-spacing: 0.04em;
  }

  /* ---------- Topbar ---------- */
  .topbar {
    grid-area: topbar;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center;
    padding: 0 14px;
    gap: 14px;
  }
  .clock {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fg-primary);
    white-space: nowrap;
  }
  .clock .day { color: var(--fg-tertiary); margin-left: 6px; }
  .topbar .summary {
    display: flex; gap: 14px;
    font-size: 12px;
    color: var(--fg-secondary);
    padding-left: 14px;
    border-left: 1px solid var(--border-subtle);
    margin-left: 4px;
    white-space: nowrap;
  }
  .topbar .summary strong { color: var(--fg-primary); font-weight: 500; }
  .topbar .summary .live-dot {
    display: inline-block;
    width: 6px; height: 6px;
    background: var(--sunlight-400);
    border-radius: 50%;
    margin-right: 6px;
    transform: translateY(-1px);
    animation: pulse 1800ms ease-out infinite;
  }
  @keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(221,160,29,.55); }
    60%      { box-shadow: 0 0 0 5px rgba(221,160,29,0); }
  }

  .alerts {
    display: flex; gap: 6px;
    overflow-x: auto;
    flex: 1;
    padding-left: 12px;
    border-left: 1px solid var(--border-subtle);
  }
  .alert-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    background: #FBEAE6;
    border: 1px solid #E8C2B8;
    color: #8E2F22;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 120ms;
  }
  .alert-pill:hover { background: #F5D9D3; }
  .alert-pill .what { color: #8E2F22; font-weight: 500; }
  .alert-pill .when { font-family: var(--font-mono); font-size: 11px; color: #8E2F22; opacity: 0.75; }
  .alert-pill[data-tone="medium"] { background: var(--sunlight-50); border-color: var(--sunlight-100); color: var(--sunlight-700); }
  .alert-pill[data-tone="medium"] .what,
  .alert-pill[data-tone="medium"] .when { color: var(--sunlight-700); }
  .alert-pill[data-tone="info"]  { background: var(--canopy-50); border-color: var(--canopy-100); color: var(--canopy-700); }
  .alert-pill[data-tone="info"]  .what,
  .alert-pill[data-tone="info"]  .when { color: var(--canopy-700); }
  .alert-pill .x { background: transparent; border: 0; color: inherit; cursor: pointer; opacity: 0.5; padding: 0 0 0 4px; font-size: 13px; line-height: 1; }
  .alert-pill .x:hover { opacity: 1; }

  .topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
  .kbd {
    display: inline-flex; gap: 2px;
    font-family: var(--font-mono); font-size: 10px;
  }
  .kbd span {
    padding: 1px 5px;
    background: var(--mist-100);
    border: 1px solid var(--border-default);
    border-radius: 3px;
    color: var(--fg-secondary);
  }
  .topbar-btn {
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    color: var(--fg-secondary);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
  }
  .topbar-btn:hover { background: var(--bg-sunken); color: var(--fg-primary); }

  /* ---------- Ribbon (filters) ---------- */
  .ribbon {
    grid-area: ribbon;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center; gap: 8px;
    padding: 0 14px;
  }
  .ribbon-seg {
    display: inline-flex;
    background: var(--bg-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 2px;
  }
  .ribbon-seg button {
    border: 0;
    background: transparent;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--fg-secondary);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
  }
  .ribbon-seg button[data-active="true"] {
    background: var(--bg-surface);
    color: var(--fg-primary);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    font-weight: 500;
  }
  .ribbon-divider { width: 1px; height: 22px; background: var(--border-subtle); }
  .ribbon-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fg-tertiary);
    margin-right: 4px;
  }
  .ribbon-chip {
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 11px;
    color: var(--fg-secondary);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
  }
  .ribbon-chip[data-active="true"] {
    background: var(--canopy-700);
    color: var(--mist-25);
    border-color: var(--canopy-700);
  }
  .ribbon-chip .av-xs {
    width: 16px; height: 16px;
    font-size: 9px;
  }
  .ribbon-chip-icon {
    padding: 3px;
  }
  .ribbon-chip-icon[data-active="true"] {
    background: transparent;
    color: inherit;
    border-color: var(--canopy-700);
    box-shadow: 0 0 0 1px var(--canopy-700) inset;
  }
  .ribbon-chip-icon[data-active="false"] {
    opacity: 0.4;
  }
  .ribbon-chip-icon:hover {
    opacity: 1;
  }
  .ribbon-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
  .ribbon-zoom {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--fg-tertiary);
  }
  .ribbon-zoom button {
    width: 22px; height: 22px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--fg-secondary);
    border-radius: 4px; cursor: pointer; line-height: 1;
  }

  /* ---------- Board ---------- */
  .board {
    grid-area: board;
    overflow: auto;
    position: relative;
    background: var(--bg-page);
  }
  .board-inner {
    min-width: 1100px;
    position: relative;
  }
  .axis {
    position: sticky; top: 0; z-index: 4;
    display: grid;
    grid-template-columns: 152px 1fr;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-subtle);
  }
  .axis-corner {
    border-right: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 8px 12px;
    display: flex; align-items: center;
    background: var(--bg-page);
    position: sticky; left: 0; z-index: 5;
  }
  .axis-ticks {
    position: relative;
    height: 30px;
  }
  .axis-tick {
    position: absolute; top: 0;
    border-left: 1px solid var(--border-subtle);
    height: 100%;
    padding: 6px 0 0 4px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-tertiary);
  }
  .axis-tick.hour { border-left-color: var(--border-default); }
  .axis-tick.minor { border-left-style: dotted; }

  /* ----- 3-day axis additions ----- */
  .axis-corner-multi {
    border-right: 1px solid var(--border-subtle);
  }
  .axis-day-row {
    position: relative;
    height: 30px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-page);
  }
  .axis-day-cell {
    position: absolute;
    top: 0; bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-left: 1px solid var(--border-default);
  }
  .axis-day-cell:first-child { border-left: 0; }
  .axis-day-cell .axis-day-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--fg-secondary);
    letter-spacing: -0.005em;
  }
  .axis-day-cell .axis-day-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-tertiary);
    letter-spacing: 0.04em;
  }
  .axis-day-cell.today {
    background: var(--canopy-50);
  }
  .axis-day-cell.today .axis-day-label {
    color: var(--canopy-800);
    font-weight: 600;
  }
  .axis-day-cell.today .axis-day-date { color: var(--canopy-700); }
  .axis-day-cell.today::before {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--sunlight-400);
  }
  .axis-ticks-multi { height: 22px; }
  .axis-ticks-multi .axis-tick {
    font-size: 9.5px;
    padding: 4px 0 0 3px;
  }
  .axis-day-sep {
    position: absolute;
    top: 0; bottom: 0;
    border-left: 1px solid var(--border-default);
    z-index: 1;
  }

  /* ----- 3-day row track additions ----- */
  .row-day-sep {
    position: absolute;
    top: 0; bottom: 0;
    border-left: 1px solid var(--border-default);
    pointer-events: none;
    z-index: 1;
  }
  .row-day-tint {
    position: absolute;
    top: 0; bottom: 0;
    background: rgba(7, 20, 12, 0.018);
    pointer-events: none;
    z-index: 0;
  }
  .row-day-tint.past {
    background: rgba(7, 20, 12, 0.035);
  }

  /* ----- 3-day booking block fade ----- */
  .bk[data-synthetic="true"] {
    opacity: 0.78;
  }
  .bk[data-synthetic="true"]:hover { opacity: 1; }
  .bk[data-status="future"] {
    /* same as default upcoming look */
    background: var(--canopy-50);
    border: 1px solid var(--canopy-200);
    border-left: 3px solid var(--canopy-500);
    color: var(--canopy-800);
  }

  .now-line {
    position: absolute;
    top: 0; bottom: 0;
    border-left: 1.5px solid var(--sunlight-400);
    z-index: 3;
    pointer-events: none;
  }
  .now-line::before {
    content: "";
    position: absolute;
    top: 22px; left: -4px;
    width: 7px; height: 7px;
    background: var(--sunlight-400);
    border-radius: 50%;
    animation: pulse 1800ms ease-out infinite;
  }
  .now-line::after {
    content: attr(data-time);
    position: absolute;
    top: 6px; left: 4px;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--canopy-900);
    background: var(--sunlight-400);
    padding: 1px 5px; border-radius: 3px;
    white-space: nowrap;
  }

  .row {
    display: grid;
    grid-template-columns: 152px 1fr;
    min-height: 84px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .row:nth-child(even) { background: rgba(0,0,0,0.012); }

  .row-label {
    border-right: 1px solid var(--border-subtle);
    padding: 10px 12px;
    position: sticky; left: 0; z-index: 2;
    background: inherit;
    display: flex; gap: 10px; align-items: flex-start;
  }
  .row .row-label { background: var(--bg-page); }
  .row:nth-child(even) .row-label { background: var(--mist-25); }

  .row-label .av {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--font-display); font-size: 12px;
    color: var(--mist-25);
    flex-shrink: 0;
  }
  .row-label .meta { min-width: 0; }
  .row-label .name {
    font-size: 13px; font-weight: 500; color: var(--fg-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .row-label .role {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--fg-tertiary); letter-spacing: 0.04em;
  }
  .row-label .counts {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--fg-tertiary);
    margin-top: 4px;
  }
  .row-label .counts strong { color: var(--fg-primary); font-weight: 500; }
  .row-label[data-internal="true"] {
    opacity: 0.55;
  }
  .row-label[data-internal="true"] .meta::after {
    content: "internal";
    display: inline-block;
    font-family: var(--font-mono); font-size: 9px;
    color: var(--fg-tertiary); letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-left: 6px;
    background: var(--bg-sunken);
    padding: 1px 5px;
    border-radius: 3px;
    vertical-align: 1px;
  }

  .row-track {
    position: relative;
    min-height: 84px;
  }
  .row-track .grid-line {
    position: absolute; top: 0; bottom: 0;
    border-left: 1px dotted var(--mist-100);
    pointer-events: none;
  }
  .row-track .grid-line.hour { border-left: 1px solid var(--mist-100); }

  /* ---------- Booking blocks ---------- */
  .bk {
    position: absolute;
    top: 6px; bottom: 6px;
    background: var(--canopy-50);
    border: 1px solid var(--canopy-200);
    border-left: 3px solid var(--canopy-500);
    border-radius: 4px;
    padding: 5px 7px;
    cursor: pointer;
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform 120ms, box-shadow 120ms;
    font-size: 11.5px;
    color: var(--canopy-800);
  }
  .bk:hover { z-index: 5; box-shadow: 0 4px 10px rgba(7,20,12,0.12); transform: translateY(-1px); }
  .bk[data-selected="true"] {
    box-shadow: 0 0 0 2px var(--sunlight-400), 0 4px 10px rgba(7,20,12,0.18);
    z-index: 6;
  }
  .bk .bk-top {
    display: flex; align-items: center; gap: 4px;
    font-weight: 500;
    white-space: nowrap; overflow: hidden;
  }
  .bk .bk-cust {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .bk .bk-svc {
    font-size: 11px;
    color: var(--canopy-600);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 2px;
  }
  .bk .bk-time {
    font-family: var(--font-mono); font-size: 10px;
    color: var(--canopy-600);
    margin-top: auto;
  }

  /* status variants */
  .bk[data-status="past"] {
    background: var(--mist-50);
    border-color: var(--mist-200);
    border-left-color: var(--mist-300);
    color: var(--mist-500);
    opacity: 0.85;
  }
  .bk[data-status="past"] .bk-svc,
  .bk[data-status="past"] .bk-time { color: var(--mist-500); }
  .bk[data-status="past"][data-att="late"]    { border-left-color: var(--sunlight-400); }
  .bk[data-status="past"][data-att="no_show"] { border-left-color: #C24A36; }

  .bk[data-status="live"] {
    background: var(--sunlight-100);
    border: 1px solid var(--sunlight-300);
    border-left: 3px solid var(--sunlight-500);
    color: var(--canopy-900);
    animation: live-glow 2400ms ease-in-out infinite;
  }
  .bk[data-status="live"] .bk-svc { color: var(--sunlight-700); font-weight: 500; }
  .bk[data-status="live"] .bk-time { color: var(--sunlight-700); }
  @keyframes live-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(221,160,29, 0.0); }
    50%      { box-shadow: 0 0 0 4px rgba(221,160,29, 0.20); }
  }

  .bk[data-status="open"] {
    background: var(--bg-surface);
    border: 1px dashed var(--canopy-300);
    border-left: 3px solid var(--canopy-400);
    color: var(--canopy-700);
  }

  .bk[data-needs="true"] {
    background: #FBEEEB;
    border: 1px solid #E8C2B8;
    border-left: 3px solid #C24A36;
    color: #8E2F22;
  }
  .bk[data-needs="true"] .bk-svc,
  .bk[data-needs="true"] .bk-time { color: #8E2F22; }
  .bk[data-needs="true"]::before {
    content: "!";
    position: absolute;
    top: 3px; right: 5px;
    font-family: var(--font-mono); font-size: 10px;
    color: #C24A36; font-weight: 700;
  }

  /* compact mode for very short bookings */
  .bk.compact .bk-svc, .bk.compact .bk-time { display: none; }
  .bk.tiny .bk-cust { font-size: 10px; }

  /* ---------- Detail panel ---------- */
  .panel {
    grid-area: panel;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width 240ms cubic-bezier(.4,0,.2,1);
  }
  .panel:empty { display: none; }
  .panel-content {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .panel-content.compact {
    overflow: hidden;
  }
  .panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
  .panel-head > div:first-child { min-width: 0; flex: 1; }
  .panel-eyebrow {
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--fg-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .panel-title {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 400;
    color: var(--fg-brand);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 4px 0;
  }
  .panel-close {
    border: 0; background: transparent;
    color: var(--fg-tertiary);
    cursor: pointer;
    padding: 4px; line-height: 0;
  }
  .panel-status {
    display: flex; gap: 6px; align-items: center;
    font-size: 12px;
    color: var(--fg-secondary);
    margin-bottom: 14px;
    flex-wrap: wrap;
  }
  .panel-status > span:last-child { white-space: nowrap; }
  .status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--canopy-500); display: inline-block;
  }
  .status-dot.live      { background: var(--sunlight-400); animation: pulse 1800ms ease-out infinite; }
  .status-dot.past      { background: var(--mist-300); }
  .status-dot.open      { background: var(--canopy-300); }
  .status-dot.needs     { background: #C24A36; }
  .panel-need-bar {
    background: #FBEEEB; border: 1px solid #E8C2B8;
    border-radius: 6px; padding: 8px 10px;
    font-size: 12px; color: #8E2F22;
    margin-bottom: 14px;
  }

  .panel-section { margin-bottom: 16px; }
  .panel-section h4 {
    margin: 0 0 6px;
    font-family: var(--font-mono); font-size: 10px;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--fg-tertiary);
    font-weight: 500;
  }
  .field { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12.5px; }
  .field .k { color: var(--fg-tertiary); }
  .field .v { color: var(--fg-primary); font-weight: 500; }

  .customer-card {
    background: var(--bg-sunken);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 8px;
  }
  .customer-card .top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
  .customer-card .av {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--canopy-700);
    color: var(--mist-25);
    display: grid; place-items: center;
    font-family: var(--font-display); font-size: 12px;
  }
  .customer-card .stats {
    display: flex; gap: 14px;
    font-family: var(--font-mono); font-size: 11px;
    color: var(--fg-secondary);
    margin-top: 4px;
    flex-wrap: wrap;
  }
  .customer-card .stats > span { white-space: nowrap; }
  .customer-card .stats strong { color: var(--fg-primary); font-weight: 500; font-size: 13px; }
  .customer-card .note {
    font-size: 12px;
    color: var(--fg-primary);
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .actions button {
    padding: 7px 10px;
    font-size: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    border-radius: 6px;
    color: var(--fg-primary);
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    justify-content: center;
  }
  .actions button:hover { background: var(--bg-sunken); }
  .actions button.primary {
    background: var(--sunlight-400);
    border-color: var(--sunlight-400);
    color: var(--canopy-900);
    font-weight: 500;
  }
  .actions button.primary:hover { background: var(--sunlight-500); border-color: var(--sunlight-500); }
  .actions button.full { grid-column: span 2; }
  .actions button.danger { color: #8E2F22; }
  .actions button.danger:hover { background: #FBEEEB; }

  .feed-mini {
    background: var(--bg-sunken);
    border-radius: 6px;
    padding: 8px 10px;
    max-height: 180px; overflow-y: auto;
    font-size: 12px;
  }
  .feed-msg { margin-bottom: 6px; }
  .feed-msg .who { font-weight: 500; color: var(--fg-primary); }
  .feed-msg .t { font-family: var(--font-mono); font-size: 10px; color: var(--fg-tertiary); margin-left: 4px; }
  .feed-msg .body { color: var(--fg-secondary); margin-top: 2px; }
  .feed-sys { color: var(--fg-tertiary); font-style: italic; padding: 4px 0; border-top: 1px dashed var(--border-subtle); border-bottom: 1px dashed var(--border-subtle); margin: 6px 0; }

  /* ---------- Empty-slot click ---------- */
  .empty-slot-detail {
    border: 1px dashed var(--canopy-300);
    background: var(--canopy-50);
    border-radius: 6px;
    padding: 14px;
    text-align: center;
    color: var(--canopy-700);
  }

  /* ---------- Stats bar ---------- */
  .stats {
    grid-area: stats;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex; align-items: center;
    padding: 0 14px;
    gap: 16px;
    font-size: 11.5px;
  }
  .stats .stat {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--fg-secondary);
    white-space: nowrap;
  }
  .stats .stat strong {
    font-family: var(--font-mono); font-size: 12px;
    color: var(--fg-primary); font-weight: 500;
  }
  .stats .sep { color: var(--fg-muted); }
  .stats .ai-hint {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 10px;
    color: var(--fg-tertiary);
  }
  .stats .ai-hint .dot {
    width: 5px; height: 5px;
    background: var(--canopy-400);
    border-radius: 50%;
    animation: pulse 2400ms ease-out infinite;
  }

  /* Icon nav SVGs */
  .icons svg { width: 18px; height: 18px; stroke-width: 1.6; }

  /* =====================================================================
   * Chat dock — bottom strip on Day Board (experimental Yarra channel)
   * =================================================================== */
  .dayboard-chat {
    grid-area: chat;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-default);
    position: relative;
    overflow: hidden;
    min-height: 0;
  }
  .dbc-resize-handle {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    cursor: ns-resize;
    z-index: 3;
  }
  .dbc-resize-handle::after {
    content: "";
    position: absolute;
    top: 2px; left: 50%;
    transform: translateX(-50%);
    width: 32px; height: 3px;
    border-radius: 2px;
    background: var(--border-default);
    opacity: 0;
    transition: opacity 120ms;
  }
  .dbc-resize-handle:hover::after,
  .dayboard-chat[data-resizing="true"] .dbc-resize-handle::after { opacity: 1; }

  .dbc-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, var(--mist-25), var(--bg-surface));
    min-height: 30px;
  }
  .dbc-pebble {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--canopy-700);
    position: relative;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .dbc-pebble::after {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--sunlight-400);
    animation: yj-pulse 1800ms ease-out infinite;
  }
  .dbc-name {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--fg-brand);
    letter-spacing: -0.005em;
  }
  .dbc-status {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--moss-500);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 4px;
  }
  .dbc-status::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--moss-400);
  }
  .dbc-head-divider {
    width: 1px;
    height: 14px;
    background: var(--border-subtle);
    margin: 0 4px;
  }
  .dbc-head-preview {
    font-size: 12px;
    color: var(--fg-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    display: none;
  }
  .shell[data-chat-state="collapsed"] .dbc-head-preview { display: block; }
  .dbc-head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
  }
  .dbc-icon-btn {
    background: transparent;
    border: 0;
    width: 26px; height: 26px;
    border-radius: 6px;
    color: var(--fg-tertiary);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 120ms, color 120ms;
  }
  .dbc-icon-btn:hover { background: var(--bg-sunken); color: var(--fg-primary); }
  .dbc-icon-btn svg { width: 14px; height: 14px; stroke-width: 1.7; }
  .dbc-experimental-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--canopy-700);
    background: var(--canopy-50);
    border: 1px solid var(--canopy-200);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 2px;
  }

  /* Stream */
  .dbc-stream {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--bg-page);
    min-height: 0;
  }
  .shell[data-chat-state="collapsed"] .dbc-stream { display: none; }
  .shell[data-chat-state="collapsed"] .dbc-input-wrap { display: none; }

  /* Message rows — compact, inline meta + chips */
  .dbc-msg {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px;
    align-items: flex-start;
    max-width: 880px;
  }
  .dbc-msg-av {
    width: 16px; height: 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
    font-size: 9px;
    color: var(--mist-25);
    flex-shrink: 0;
    margin-top: 3px;
  }
  .dbc-msg[data-from="ai"] .dbc-msg-av {
    background: var(--canopy-700);
    position: relative;
  }
  .dbc-msg[data-from="ai"] .dbc-msg-av::after {
    content: "";
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--sunlight-400);
  }
  .dbc-msg-body { min-width: 0; }
  /* Inline meta sits in-line at the start of the text line */
  .dbc-msg-meta {
    display: inline;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-tertiary);
    margin-right: 8px;
  }
  .dbc-msg[data-from="ai"] .dbc-msg-meta .who { color: var(--moss-600); }
  .dbc-msg-meta .who { color: var(--fg-secondary); font-weight: 500; }
  .dbc-msg-meta .t {
    color: var(--fg-tertiary);
    letter-spacing: 0;
    text-transform: none;
    font-size: 10px;
    margin-left: 4px;
  }
  .dbc-msg-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--fg-primary);
    display: inline;
  }
  /* Wrap the text + inline chips inside a single flow */
  .dbc-msg-line {
    display: block;
  }
  .dbc-msg-text strong { color: var(--fg-brand); font-weight: 600; }
  .dbc-msg-text em { font-style: italic; }
  .dbc-msg-text a {
    color: var(--canopy-700);
    text-decoration: none;
    border-bottom: 1px dotted var(--canopy-300);
    cursor: pointer;
  }
  .dbc-msg-text a:hover { border-bottom-style: solid; }

  /* User message — right-aligned, compact pill, no avatar */
  .dbc-msg[data-from="user"] {
    grid-template-columns: 1fr;
    margin-left: auto;
    justify-content: end;
  }
  .dbc-msg[data-from="user"] .dbc-msg-av { display: none; }
  .dbc-msg[data-from="user"] .dbc-msg-body {
    text-align: right;
  }
  .dbc-msg[data-from="user"] .dbc-msg-text {
    display: inline-block;
    text-align: left;
    background: var(--canopy-50);
    border: 1px solid var(--canopy-200);
    border-radius: 10px 10px 2px 10px;
    padding: 3px 9px;
    max-width: 480px;
  }
  .dbc-msg[data-from="user"] .dbc-msg-meta { display: none; }

  /* System event — centered divider line */
  .dbc-msg[data-from="system"] {
    grid-template-columns: 1fr;
    max-width: none;
    text-align: center;
  }
  .dbc-msg[data-from="system"] .dbc-msg-av { display: none; }
  .dbc-msg[data-from="system"] .dbc-msg-meta { display: none; }
  .dbc-msg[data-from="system"] .dbc-msg-text {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-tertiary);
    letter-spacing: 0.02em;
    background: transparent;
    display: inline-flex;
    align-items: center;
    gap: 10px;
  }
  .dbc-msg[data-from="system"] .dbc-msg-text::before,
  .dbc-msg[data-from="system"] .dbc-msg-text::after {
    content: "";
    display: inline-block;
    width: 32px;
    height: 1px;
    background: var(--border-subtle);
  }

  /* Action chips — inline with the message text, wrap naturally */
  .dbc-chips {
    display: inline;
    margin-left: 2px;
  }
  .dbc-chip {
    font-family: inherit;
    font-size: 11px;
    color: var(--canopy-800);
    background: var(--bg-surface);
    border: 1px solid var(--canopy-300);
    border-radius: 999px;
    padding: 1px 9px;
    cursor: pointer;
    transition: all 120ms;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 2px;
    vertical-align: baseline;
    line-height: 1.6;
    white-space: nowrap;
  }
  .dbc-chip:hover {
    background: var(--canopy-50);
    border-color: var(--canopy-500);
  }
  .dbc-chip[data-variant="primary"] {
    background: var(--canopy-700);
    color: var(--mist-25);
    border-color: var(--canopy-700);
  }
  .dbc-chip[data-variant="primary"]:hover {
    background: var(--canopy-800);
    border-color: var(--canopy-800);
  }
  .dbc-chip[data-variant="ghost"] {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--fg-secondary);
  }
  .dbc-chip[data-variant="ghost"]:hover {
    background: var(--bg-sunken);
    color: var(--fg-primary);
  }

  /* Inline list inside an AI message (e.g., waitlist, at-risk) */
  .dbc-inline-list {
    margin-top: 5px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-surface);
    max-width: 560px;
  }
  .dbc-inline-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 4px 10px;
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
    background: transparent;
    border-left: 0; border-right: 0; border-top: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 100ms;
  }
  .dbc-inline-row:last-child { border-bottom: 0; }
  .dbc-inline-row:hover { background: var(--bg-sunken); }
  .dbc-inline-row .name {
    font-size: 12px;
    color: var(--fg-primary);
    font-weight: 500;
  }
  .dbc-inline-row .sub {
    font-size: 10.5px;
    color: var(--fg-tertiary);
    margin-top: 0;
  }
  .dbc-inline-row .meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--fg-secondary);
    text-align: right;
  }
  .dbc-inline-row .meta .tag {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1.5px 5px;
    border-radius: 3px;
    background: var(--mist-100);
    color: var(--fg-secondary);
    margin-top: 2px;
  }
  .dbc-inline-row .meta .tag.warn {
    background: var(--status-danger-bg, #fdecec);
    color: var(--status-danger, #c03333);
  }

  /* Typing indicator */
  .dbc-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
  }
  .dbc-typing span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--canopy-300);
    animation: yp-typing-bounce 1.1s ease-in-out infinite;
  }
  .dbc-typing span:nth-child(2) { animation-delay: 120ms; }
  .dbc-typing span:nth-child(3) { animation-delay: 240ms; }

  /* Input area — single compact row with inline quick replies */
  .dbc-input-wrap {
    flex-shrink: 0;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 6px 14px 7px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .dbc-quick {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
    max-width: 50%;
  }
  .dbc-quick::-webkit-scrollbar { display: none; }
  .dbc-quick button {
    font-family: inherit;
    font-size: 11px;
    background: var(--mist-25);
    border: 1px solid var(--border-subtle);
    color: var(--fg-secondary);
    border-radius: 999px;
    padding: 2px 9px;
    cursor: pointer;
    transition: all 120ms;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .dbc-quick button:hover {
    background: var(--canopy-50);
    border-color: var(--canopy-300);
    color: var(--canopy-800);
  }
  .dbc-input-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--mist-25);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 3px 4px 3px 10px;
    transition: border-color 120ms, box-shadow 120ms;
    min-width: 0;
  }
  .dbc-input-row:focus-within {
    border-color: var(--canopy-400);
    background: var(--bg-surface);
    box-shadow: var(--ring-focus);
  }
  .dbc-input {
    flex: 1;
    border: 0;
    background: transparent;
    outline: none;
    font-size: 12.5px;
    color: var(--fg-primary);
    font-family: var(--font-sans);
    padding: 2px 0;
    min-width: 0;
  }
  .dbc-input::placeholder { color: var(--fg-tertiary); }
  .dbc-mic, .dbc-send {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }
  .dbc-mic {
    width: 22px; height: 22px;
    background: transparent;
    color: var(--fg-tertiary);
  }
  .dbc-mic:hover { background: var(--bg-sunken); color: var(--canopy-700); }
  .dbc-mic svg { width: 12px; height: 12px; stroke-width: 1.7; }
  .dbc-send {
    width: 24px; height: 24px;
    background: var(--canopy-700);
    color: var(--mist-25);
  }
  .dbc-send:hover { background: var(--canopy-800); }
  .dbc-send svg { width: 12px; height: 12px; stroke-width: 2; }

  /* =====================================================================
   * Live-demo adaptations (provider-desktop)
   * Pin to the desktop form factor — no responsive bounce. The page lives
   * inside a fixed-width iframe on the marketing home.
   * =================================================================== */
  html, body { min-width: 1180px; }

  /* The topbar "Ask Yarra ⌘K" control is briefed, not live. */
  .topbar-btn.yj-soon {
    border-style: dashed;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .topbar-btn.yj-soon .kbd span { opacity: 0.6; }

  /* The bottom Yarra channel (chat dock) is the AI copilot — briefed, paid.
   * It stays visible as a dashed, non-interactive preview. The shared
   * .yj-soon rule already makes its inner controls inert; we add a thin
   * gold-dashed top edge + a "coming soon" affordance in its header. */
  .dayboard-chat.yj-soon {
    border-top: 1px dashed var(--sunlight-400);
  }
  .dayboard-chat.yj-soon .dbc-stream,
  .dayboard-chat.yj-soon .dbc-input-wrap { opacity: 0.92; }

  /* The stats-bar "Yarra is watching" hint is an AI affordance — gate it. */
  .stats .ai-hint.yj-soon { border-style: none; }
  .stats .ai-hint.yj-soon .dot { animation: none; background: var(--sunlight-400); }
