/* Paper · Editorial — desktop Home (the Inbox place's middle with no conversation open) and the waiting card that
   Home, the phone's Home and Bob's chat share. Markup: #homePage in public/index.html; behaviour: app/home.js.
   Mock: mocks/ui-redo "Desktop · Home" (.dN.v2.ed). Loaded before paper.css. */

/* The waiting card: project, time and agent; the title; the question; Answer, Push it on, Done … Open. */
.ws-wait {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 18px 20px 14px;
  border-radius: 16px; background: var(--field); color: var(--text);
}
.ws-wait-top { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.ws-wait-top .ws-dot { margin-top: 0; }
.ws-wait-project { min-width: 0; overflow: hidden; color: var(--text); opacity: 0.8; text-overflow: ellipsis; white-space: nowrap; }
.ws-wait-top time { flex: none; margin-left: auto; font-weight: 500; }
.ws-wait-title { overflow: hidden; color: var(--heading); font: 400 18px/1.3 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
/* Hover summary: while a mouse is on a card that has a summary, the question gives way to the whole summary, in place. It stops
   at a height and scrolls when longer. Touch screens never show it (a tap opens the detail sheet). */
.ws-wait-summary { display: none; max-height: 240px; overflow-y: auto; overscroll-behavior: contain; color: var(--muted); font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ws-wait-summary > :first-child { margin-top: 0; }
.ws-wait-summary > :last-child { margin-bottom: 0; }
.ws-home-cards { align-items: start; }
@media (hover: hover) and (pointer: fine) {
  .ws-wait.has-summary:hover > .ws-wait-question { display: none; }
  .ws-wait.has-summary:hover > .ws-wait-summary { display: block; }
}
.ws-wait-question {
  display: -webkit-box; min-height: 2.9em; margin: 0; overflow: hidden; color: var(--muted); font-size: 13.5px; line-height: 1.45;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.ws-wait-actions { display: flex; align-items: center; gap: 6px; margin-top: 6px; min-width: 0; }
.ws-wait-actions > button { min-height: 30px; height: 30px; padding: 0 11px; border-radius: 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.ws-wait-actions > button > .ws-wait-action-icon { display: none; }
.ws-wait-actions > .soft { border: 0; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); box-shadow: none; }
.ws-wait-actions > .soft:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.ws-wait-actions > .ghost:not(.ws-wait-open) { border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); }
.ws-wait-open { display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; box-shadow: none; color: var(--muted); }
.ws-wait-open:hover:not(:disabled) { color: var(--text); background: transparent; }
.ws-wait-open svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ws-wait .ws-home-spacer, .ws-home-spacer { flex: 1; }
.ws-wait-push { display: grid; gap: 6px; margin-top: 4px; }
.ws-wait-push textarea { min-height: 54px; resize: none; border-radius: 12px; font-size: 13.5px; }
.ws-wait.pushing .ws-wait-question { -webkit-line-clamp: 1; min-height: 0; }
/* While the instructions are written, the box's own Push it on and Cancel are the card's actions. */
.ws-wait.pushing > .ws-wait-actions { display: none; }

/* The phone's Home: one calm Paper card under the greeting, with 44 px buttons. */
body.focus-ui .ws-wait.compact { gap: 5px; margin: 0 4px 8px; padding: 15px 16px 13px; border-radius: 18px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
body.focus-ui .ws-wait.compact .ws-wait-top { font-size: 13px; font-weight: 500; }
body.focus-ui .ws-wait.compact .ws-wait-title { font: 600 16px/1.3 var(--sans); }
body.focus-ui .ws-wait.compact .ws-wait-question { font-size: 14px; line-height: 1.45; min-height: 0; }
body.focus-ui .ws-wait.compact .ws-wait-actions { gap: 4px; flex-wrap: nowrap; margin-top: 6px; }
body.focus-ui .ws-wait.compact .ws-wait-actions > button { min-height: 44px; height: 44px; padding: 0 10px; border-radius: 999px; font-size: 14px; }
body.focus-ui .ws-wait.compact .ws-wait-open { padding: 0 4px; }
body.focus-ui .ws-wait.compact .ws-wait-push textarea { font-size: 16px; }

@media (max-width: 700px) {
  .ws-wait .ws-wait-actions { flex-wrap: wrap; }
  .ws-wait-actions > .ws-home-spacer { display: none; }
  .ws-wait > .ws-wait-actions > button {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px;
    width: 44px; min-width: 44px; min-height: 44px; height: 44px; padding: 0;
  }
  body.focus-ui .ws-wait.compact .ws-wait-actions > button { padding: 0; }
  .ws-wait-actions > button > .ws-wait-action-icon { display: block; width: 20px; height: 20px; margin: 0; }
  .ws-wait-actions .ws-wait-action-label, .ws-wait-actions .ws-wait-open-chevron { display: none; }
}

/* The desktop only: the phone has its own Home (phone.css). */
#homePage { display: none; }

@media (min-width: 701px) {
  /* The brand is the way Home: the mark and the name, as one quiet button. */
  body:not(.focus-ui) .ws-home-button {
    display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; min-height: 32px; padding: 0; border: 0; border-radius: 10px;
    background: transparent; box-shadow: none; color: inherit; text-align: left; cursor: pointer; place-items: initial; justify-content: flex-start;
  }
  body:not(.focus-ui) .ws-home-button:hover:not(:disabled) { background: transparent; }
  body:not(.focus-ui) .ws-home-button:hover .ws-name { color: var(--accent); }
  body:not(.focus-ui):is(.projects-collapsed, .ws-auto-rail) .ws-home-button { flex: none; justify-content: center; }
  body:not(.focus-ui).ws-home .shell > :is(#chatPanel, #controlCenterPanel) { display: none; }
  body:not(.focus-ui).ws-home #homePage:not([hidden]) {
    display: flex; grid-area: main; min-width: 0; min-height: 0; overflow: hidden;
    border: 0; border-radius: var(--ws-card-radius, 24px); background: var(--panel); box-shadow: var(--shadow-soft);
  }
  :root[data-theme="dark"] body:not(.focus-ui).ws-home #homePage { box-shadow: 0 0 0 1px var(--line); }

  .ws-home-in {
    display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0;
    width: min(1120px, 100%); height: 100%; margin: 0 auto; padding: clamp(22px, 4.5vh, 44px) clamp(24px, 4.2vw, 60px) clamp(18px, 3vh, 32px);
    zoom: var(--ui-zoom-conversation, 1);
  }
  .ws-home-top { display: flex; flex-direction: column; min-width: 0; }
  .ws-home-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
  .ws-home-head-copy { flex: 1; min-width: 0; }
  .ws-home-head-right { display: flex; align-items: center; gap: 8px; flex: none; }
  .ws-home-close { flex: none; width: 44px; height: 44px; }
  .ws-home-close[hidden] { display: none; }
  .ws-home-greet { margin: 0; overflow: hidden; color: var(--heading); font: 400 clamp(32px, 3.2vw, 46px)/1.05 var(--serif); letter-spacing: -0.01em; text-overflow: ellipsis; white-space: nowrap; }
  .ws-home-sub { min-height: 1.5em; margin: 8px 0 0; color: var(--muted); font-size: 16.5px; }
  .ws-home-sub b { color: var(--ws-need, #b86e00); font-weight: 650; }

  /* Option C: Customize Home popover, Glance Strip & Focus Tabs. */
  .ws-home-customize-wrap { position: relative; }
  .ws-home-customize-btn {
    display: inline-flex; align-items: center; gap: 7px; min-height: 34px; height: 34px; padding: 0 13px;
    border: 1px solid var(--line-strong); border-radius: 11px; background: var(--field); box-shadow: none;
    color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
  }
  .ws-home-customize-btn svg { width: 15px; height: 15px; flex: none; }
  .ws-home-customize-btn:hover:not(:disabled), .ws-home-customize-btn.on {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--accent) 12%, var(--field));
    color: var(--accent);
  }
  .ws-home-customize-pop {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: 276px;
    display: grid; gap: 6px; padding: 12px; border-radius: 16px;
    border: 1px solid var(--line-strong); background: var(--panel); box-shadow: var(--shadow, 0 18px 44px rgba(0, 0, 0, 0.35));
  }
  .ws-home-customize-pop[hidden] { display: none; }
  .ws-home-customize-head {
    margin: 0 0 2px; color: var(--muted); font: 700 11px/1.2 var(--sans);
    letter-spacing: 0.08em; text-transform: uppercase;
  }
  .ws-home-check-row {
    display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px;
    background: var(--field); cursor: pointer; font-size: 13px;
  }
  .ws-home-check-row:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
  .ws-home-check-row input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
  .ws-home-check-copy { display: grid; gap: 1px; min-width: 0; }
  .ws-home-check-copy b { font-size: 13px; font-weight: 600; color: var(--heading); }
  .ws-home-check-copy small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }

  .ws-home-glance-strip {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px;
  }
  .ws-home-glance {
    display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-width: 0; padding: 10px 13px;
    border: 1px solid transparent; border-radius: 14px; background: var(--field); box-shadow: none;
    color: var(--text); text-align: left; cursor: pointer; place-items: initial; justify-content: flex-start;
    transition: background-color 120ms ease, border-color 120ms ease;
  }
  .ws-home-glance:hover:not(:disabled) { border-color: var(--line-strong); background: var(--field); }
  .ws-home-glance.active {
    border-color: color-mix(in srgb, var(--accent) 52%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, var(--field));
  }
  .ws-home-glance-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .ws-home-glance strong { overflow: hidden; color: var(--heading); font-size: 15.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
  .ws-home-glance small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }

  .ws-home-focus-tabs {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    margin-top: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  }
  .ws-home-ftab {
    min-height: 30px; height: 30px; padding: 0 12px; border: 0; border-radius: 9px;
    background: transparent; box-shadow: none; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap;
  }
  .ws-home-ftab:hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--field) 80%, transparent); }
  .ws-home-ftab.on { background: var(--paper-raised, var(--field)); color: var(--heading); }

  /* Pill chips reused inside the Dashboard overview switcher. */
  .ws-home-pick {
    display: inline-flex; align-items: center; gap: 6px; min-height: 28px; height: 28px; padding: 0 11px;
    border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; box-shadow: none;
    color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
  }
  .ws-home-pick:hover:not(:disabled) { color: var(--text); background: color-mix(in srgb, var(--panel) 80%, transparent); }
  .ws-home-pick.on {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
  }

  /* Default Activity-only layout fits the window cleanly without outer scroll. */
  .ws-home-sections { display: grid; grid-template-rows: minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; }
  .ws-home-activity { display: grid; grid-template-rows: minmax(0, 1.35fr) minmax(0, 1fr); min-width: 0; min-height: 0; }
  .ws-home-activity[hidden] { display: none; }
  #homePage.need-empty:not(.ws-home-custom) .ws-home-activity { grid-template-rows: auto minmax(0, 1fr); }

  /* Custom / multi-section layout scrolls smoothly inside .ws-home-sections while #homePage keeps overflow: hidden. */
  #homePage.ws-home-custom .ws-home-sections {
    display: flex; flex-direction: column; gap: 6px; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; padding-bottom: 12px;
  }
  #homePage.ws-home-custom .ws-home-activity { display: flex; flex-direction: column; flex: none; min-height: auto; }
  #homePage.ws-home-custom .ws-home-need { display: flex; flex-direction: column; flex: none; }
  #homePage.ws-home-custom .ws-home-cards { max-height: 440px; }
  #homePage.ws-home-custom .ws-home-two { flex: none; min-height: auto; }
  #homePage.ws-home-custom .ws-home-list { display: flex; flex-direction: column; min-height: auto; }
  #homePage.ws-home-custom .ws-home-table { overflow: visible; }

  .ws-home-need, .ws-home-list { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
  .ws-home-sechead { display: flex; align-items: baseline; gap: 8px; min-width: 0; margin: clamp(14px, 2.8vh, 24px) 0 10px; flex-wrap: wrap; }
  .ws-home-panel-head { align-items: center; }
  .ws-home-sechead h2 { margin: 0; color: var(--heading); font: 400 22px/1.2 var(--serif); white-space: nowrap; }
  .ws-home-count { color: var(--muted); font-size: 13px; font-weight: 600; }
  .ws-home-head-actions { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
  .ws-home-all, .ws-home-pager button {
    display: inline-flex; align-items: center; gap: 2px; min-height: 28px; height: 28px; padding: 0 6px; border: 0;
    background: transparent; box-shadow: none; color: var(--muted); font-size: 13px; font-weight: 600; align-self: center;
  }
  .ws-home-all:hover, .ws-home-pager button:hover:not(:disabled) { color: var(--text); background: transparent; }
  .ws-home-all svg, .ws-home-pager svg { width: 14px; height: 14px; }
  .ws-home-all[hidden], .ws-home-pager[hidden] { display: none; }
  .ws-home-pager { display: inline-flex; align-items: center; gap: 2px; align-self: center; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
  .ws-home-pager button { width: 28px; justify-content: center; padding: 0; }

  .ws-home-cards { display: grid; grid-template-columns: repeat(var(--home-columns, 2), minmax(0, 1fr)); align-content: start; gap: 12px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .ws-home-cards > .ws-empty, .ws-home-table > .ws-empty { height: auto; padding: 4px 0; }

  .ws-home-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; min-height: 0; }
  .ws-home-table { display: grid; align-content: start; min-height: 0; overflow: hidden; }
  .ws-home-row { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 6px 14px 6px 4px; background: var(--field); }
  .ws-home-row:first-child { border-radius: 16px 16px 0 0; }
  .ws-home-row:last-child { border-radius: 0 0 16px 16px; }
  .ws-home-row:only-child { border-radius: 16px; }
  .ws-home-row + .ws-home-row { box-shadow: inset 0 1px 0 var(--line); }
  .ws-home-row-main {
    display: flex; gap: 12px; min-width: 0; flex: 1; min-height: 44px; padding: 0 0 0 10px; border: 0;
    background: transparent; box-shadow: none; color: var(--text); text-align: left; font: inherit; place-items: initial; align-items: center; justify-content: flex-start;
  }
  .ws-home-row-main:hover:not(:disabled) { background: transparent; }
  .ws-home-row-main:hover b { text-decoration: underline; text-underline-offset: 3px; }
  .ws-home-row-main .ws-dot { margin-top: 0; }
  .ws-home-row-copy { display: grid; min-width: 0; }
  .ws-home-row-copy b { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .ws-home-row-copy small { overflow: hidden; color: var(--muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
  .ws-home-row time { flex: none; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
  .ws-home-row > .soft { flex: none; min-height: 30px; height: 30px; padding: 0 11px; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); box-shadow: none; font-size: 13px; font-weight: 600; }

  /* Shared badges, notices, and empty cards for selectable Home panels. */
  .ws-home-panel { display: flex; flex-direction: column; flex: none; min-width: 0; }
  .ws-home-panel[hidden] { display: none; }
  .ws-home-pills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: 4px; }
  .ws-home-pill {
    display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px;
    background: var(--field); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap;
  }
  .ws-home-pill.ok { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
  .ws-home-pill.warn { background: color-mix(in srgb, var(--ws-need, #b86e00) 16%, transparent); color: var(--ws-need, #b86e00); }
  .ws-home-pill.bad { background: color-mix(in srgb, var(--danger, #c0392b) 16%, transparent); color: var(--danger, #c0392b); }
  .ws-home-pill.muted { color: var(--muted); }
  .ws-home-tag {
    display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px;
    background: color-mix(in srgb, var(--line-strong) 45%, transparent); color: var(--muted);
    font-size: 11.5px; font-weight: 600; white-space: nowrap; flex: none;
  }
  .ws-home-notice {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px;
    padding: 10px 14px; border-radius: 12px; font-size: 13px;
  }
  .ws-home-notice.warn { background: color-mix(in srgb, var(--ws-need, #b86e00) 12%, transparent); color: var(--ws-need, #b86e00); }
  .ws-home-notice.bad { background: color-mix(in srgb, var(--danger, #c0392b) 12%, transparent); color: var(--danger, #c0392b); }
  .ws-home-empty-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 16px 18px; border-radius: 16px; background: var(--field);
  }
  .ws-home-empty-card .ws-empty { margin: 0; padding: 0; }
  .ws-home-empty-all {
    display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 24px;
    padding: 24px; border-radius: 18px; background: var(--field);
  }
  .ws-home-empty-all[hidden] { display: none; }
  .ws-home-empty-all h2 { margin: 0; color: var(--heading); font: 400 22px/1.2 var(--serif); }
  .ws-home-empty-all .ws-empty { margin: 0; padding: 0; }
  .ws-home-empty-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

  /* Automation statuses panel. */
  .ws-home-auto-row { padding: 6px 14px; gap: 12px; }
  .ws-home-auto-row .ws-home-row-main { padding-left: 0; }
  .ws-home-auto-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .ws-home-auto-title b { min-width: 0; }
  .ws-home-switch {
    position: relative; flex: none; width: 34px; min-width: 34px; height: 20px; min-height: 20px; padding: 0;
    border: 0; border-radius: 999px; background: var(--line-strong); box-shadow: none; cursor: pointer;
    transition: background-color 140ms ease;
  }
  .ws-home-switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--panel); transition: transform 140ms ease;
  }
  .ws-home-switch[aria-checked="true"] { background: var(--accent); }
  .ws-home-switch[aria-checked="true"]::after { transform: translateX(14px); }
  .ws-home-switch:disabled { opacity: 0.45; cursor: default; }

  /* Connected clusters panel & shared status dots. */
  .ws-home-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
  .ws-home-dot.online { background: var(--accent); }
  .ws-home-dot.need { background: var(--ws-need, var(--amber, #b86e00)); }
  .ws-home-dot.rev { background: #7f8ef3; }
  .ws-home-dot.offline { background: var(--danger, #c0392b); }
  .ws-home-dot.checking, .ws-home-dot.unknown, .ws-home-dot.muted { background: var(--line-strong); }
  .ws-home-cluster-local {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
    padding: 10px 14px; border-radius: 12px; background: var(--field); font-size: 13.5px;
  }
  .ws-home-cluster-url { margin-left: auto; color: var(--muted); font-size: 12.5px; font-family: var(--mono); }
  .ws-home-cluster-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ws-home-cluster-card {
    display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px 18px;
    border-radius: 16px; background: var(--field); color: var(--text); cursor: pointer;
    transition: box-shadow 120ms ease;
  }
  .ws-home-cluster-card:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
  .ws-home-cluster-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .ws-home-cluster-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
  .ws-home-cluster-name { overflow: hidden; color: var(--heading); font: 400 18px/1.25 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
  .ws-home-cluster-meta { margin: 0; color: var(--muted); font-size: 13px; }
  .ws-home-cluster-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
  .ws-home-member {
    display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 9px;
    border-radius: 999px; background: var(--panel); font-size: 12.5px; color: var(--text);
  }
  .ws-home-member em { font-style: normal; color: var(--muted); font-size: 11px; font-weight: 600; }
  .ws-home-member em.manager { color: var(--ws-need, #b86e00); }
  .ws-home-cluster-links { display: grid; margin-top: 12px; }
  .ws-home-cluster-link {
    display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px;
    background: var(--field); font-size: 13.5px;
  }
  .ws-home-cluster-link:first-child { border-radius: 14px 14px 0 0; }
  .ws-home-cluster-link:last-child { border-radius: 0 0 14px 14px; }
  .ws-home-cluster-link:only-child { border-radius: 14px; }
  .ws-home-cluster-link + .ws-home-cluster-link { box-shadow: inset 0 1px 0 var(--line); }

  /* Dashboard features panel. */
  .ws-home-dash-form { display: grid; gap: 8px; margin-bottom: 12px; padding: 14px 16px; border-radius: 16px; background: var(--field); }
  .ws-home-dash-form textarea { min-height: 60px; resize: vertical; border-radius: 12px; font-size: 14px; }
  .ws-home-dash-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
  .ws-home-dash-overview { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--field); }
  .ws-home-dash-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  .ws-home-dash-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
  .ws-home-dash-controls { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
  .ws-home-dash-controls > .soft {
    min-height: 28px; height: 28px; padding: 0 10px; border: 0; border-radius: 9px;
    background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
    box-shadow: none; font-size: 12.5px; font-weight: 600;
  }
  .ws-home-dash-btn {
    min-height: 28px; height: 28px; padding: 0 9px; border: 0; border-radius: 9px;
    background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong);
    color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  }
  .ws-home-dash-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--panel) 75%, transparent); }
  .ws-home-dash-btn.danger { color: var(--danger, #c0392b); }
  .ws-home-dash-card-actions { display: inline-flex; align-items: center; gap: 8px; }
  .ws-home-dash-stage {
    position: relative; min-height: 160px; border-radius: 12px; background: var(--panel);
    box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
  }
  .ws-home-dash-stage > .ws-empty { padding: 24px 18px; margin: 0; }
  .ws-home-dash-frame { display: block; width: 100%; height: 420px; border: 0; background: transparent; }
  .ws-home-subhead { margin: 16px 0 8px; color: var(--muted); font: 600 13px/1.2 var(--sans); letter-spacing: 0.01em; }
  .ws-home-dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
  .ws-home-dash-card {
    display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 14px 16px;
    border-radius: 16px; background: var(--field); color: var(--text); cursor: pointer;
    transition: box-shadow 120ms ease;
  }
  .ws-home-dash-card:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
  .ws-home-dash-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
  .ws-home-dash-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
  .ws-home-dash-where { overflow: hidden; color: var(--muted); font-size: 12.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
  .ws-home-dash-card-title { overflow: hidden; color: var(--heading); font: 400 17px/1.25 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
  .ws-home-dash-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
  .ws-home-dash-card-foot small { color: var(--muted); font-size: 12px; }

  /* Narrow middles: one column of cards, 2x2 glance strip, the two lists one over the other. */
  @media (max-width: 1023px) {
    .ws-home-glance-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ws-home-two { grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); }
    .ws-home-two .ws-home-sechead { margin-top: 12px; }
    .ws-home-cluster-grid { grid-template-columns: minmax(0, 1fr); }
  }
}

/* ---------- the phone's Needs you deck: every card in one swipeable row ---------- */
.ws-deck { display: grid; gap: 0; min-width: 0; margin: 0 -8px 4px; }
.ws-deck-track {
  display: flex; gap: 10px; min-width: 0; padding: 2px 28px 4px 8px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.ws-deck-track::-webkit-scrollbar { display: none; }
.ws-deck-track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 16px; }
.ws-deck-track.dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.ws-deck-slide { display: flex; flex: 0 0 calc(100% - 36px); min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.ws-deck-slide > .ws-wait { flex: 1; min-width: 0; margin: 0 !important; cursor: pointer; }
.ws-deck-bar { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.ws-deck-step { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--text); font-size: 22px; line-height: 1; }
.ws-deck-step:disabled { opacity: 0.3; }
.ws-wait:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- what a card needs, in a sheet over Home (bottom sheet on the phone) ---------- */
.need-sheet {
  box-sizing: border-box; width: min(640px, calc(100vw - 32px)); max-width: none; max-height: min(88dvh, 780px); margin: auto; padding: 0;
  border: 0; border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35); overflow: hidden;
}
.need-sheet[open] { display: flex; flex-direction: column; }
.need-sheet::backdrop { background: rgba(10, 8, 6, 0.5); }
.need-sheet-grab { display: none; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--line-strong); }
.need-sheet-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 8px; }
.need-sheet-heading { min-width: 0; flex: 1; }
.need-sheet-meta { margin: 0 0 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.need-sheet-head h2 { margin: 0; color: var(--heading); font: 400 22px/1.25 var(--serif); overflow-wrap: anywhere; }
.need-sheet-close { flex: none; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--field); box-shadow: none; color: var(--text); }
.need-sheet-close svg { width: 18px; height: 18px; }
.need-sheet-body { flex: 1; min-height: 0; padding: 4px 18px 12px; overflow-y: auto; overscroll-behavior: contain; }
.need-sheet-section { display: grid; gap: 6px; margin: 18px 0 0; }
.need-sheet-section[hidden] { display: none; }
.need-sheet-section h3 { margin: 0; color: var(--muted); font: 600 13px/1.2 var(--sans); letter-spacing: 0.02em; }
.need-sheet-ask-text { margin: 0; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.need-sheet-note { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
/* The ask and the last message read as plain text in the sheet's own scroll: no boxes with scrollbars of their own. */
.need-sheet-request-text { color: var(--text); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.need-sheet-request-text > :first-child, .need-sheet-markdown > :first-child { margin-top: 0; }
.need-sheet-request-text > :last-child, .need-sheet-markdown > :last-child { margin-bottom: 0; }
.need-sheet-code { margin: 0; padding: 10px 12px; overflow-x: auto; border-radius: 10px; background: var(--field); font: 13.5px/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.need-sheet-markdown { padding: 12px 14px; border-radius: 12px; background: var(--field); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.need-sheet-steplist { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.need-sheet-steplist li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.need-sheet-steplist li.failed { color: var(--danger, #c0392b); }
.need-sheet-steplist code { font: 400 13px var(--mono); color: var(--muted); }
.need-sheet-foot { display: grid; gap: 8px; padding: 10px 18px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--panel); }
.need-sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.need-sheet-actions[hidden], .need-sheet-box[hidden] { display: none; }
.need-sheet-actions > button { min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.need-sheet-actions > .soft { border: 0; background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent); box-shadow: none; }
.need-sheet-actions > .ghost { border: 0; background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); }
.need-sheet-box { display: grid; gap: 8px; }
.need-sheet-box textarea { min-height: 84px; resize: none; border-radius: 12px; font-size: 16px; }
body.focus-ui .need-sheet { width: 100%; max-height: 90dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; --m-from: translateY(100%); }
body.focus-ui .need-sheet-grab { display: block; }
body.focus-ui .need-sheet-head { padding-top: 10px; }
