/* wysdm mock v2 — home.css: index.html (Home) specific styles (SPEC-V2 §5). */

/* ---- sidebar: home nav + DM list ---- */
.dm-row {
  width: calc(100% - 16px); margin: 1px 8px; padding: 4px 8px;
  border-radius: var(--r-md); display: flex; align-items: center; gap: 10px;
  min-height: 42px;
}
.dm-row:hover { background: var(--hover); }
.dm-row.active { background: var(--selected); }
.dm-row .dm-meta { flex: 1; min-width: 0; line-height: 1.3; }
.dm-row .dm-name {
  font-size: 13px; font-weight: 500; color: var(--text-2);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.dm-row:hover .dm-name, .dm-row.active .dm-name { color: var(--text-1); }
.dm-row .dm-status {
  display: block;
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* unread DM (H5) — name lifts to full weight; count pill yields to ✕ on hover
   (the pill/dot hide-on-hover rule lives in app.css) */
.dm-row.unread .dm-name { color: var(--text-1); font-weight: 600; }

/* group DM avatar cluster (H6) — two stacked mini avatars */
.av-stack { position: relative; width: 32px; height: 32px; flex: none; }
.av-stack .avatar:first-child { position: absolute; top: 0; left: 0; }
.av-stack .avatar:last-child {
  position: absolute; bottom: -2px; right: -2px;
  box-shadow: 0 0 0 2px var(--bg-sidebar),
    inset 0 0 0 1px rgba(255,255,255,.07), inset 0 1px 0 rgba(255,255,255,.08);
}

/* on Home the Active Now spinner is the single continuously-animating
   element (§1) — working-presence dots render static solid --warn here */
.presence.working { animation: none; }

/* ---- friends view (.tab recipe lives in app.css) ---- */
.topbar .btn.sm { margin-left: 10px; }

.friends-body { flex: 1; min-height: 0; display: flex; }
.friends-list { flex: 1; min-width: 0; padding: 16px 24px; overflow-y: auto; }
.friends-search {
  height: 32px; border-radius: var(--r-lg); background: var(--bg-sunken);
  border: 1px solid var(--border-faint); color: var(--text-3);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px; font-size: 13px; margin-bottom: 18px; max-width: 640px;
}
.tabpane { display: none; }
.tabpane.active { display: block; }
.friend-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; margin: 0 -10px 2px; border-radius: var(--r-lg);
  max-width: 660px;
  --presence-ring: var(--bg-content);
}
.friend-row:hover { background: var(--hover); }
.friend-row .fr-meta { flex: 1; min-width: 0; line-height: 1.35; }
.friend-row .fr-name { font-size: 14px; font-weight: 600; letter-spacing: var(--track-tight); }
.friend-row .fr-status { display: block; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-row .fr-actions { display: none; gap: 8px; }
.friend-row:hover .fr-actions { display: flex; }
.friend-row .fr-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-elevated); border: 1px solid var(--border-faint);
  display: flex; align-items: center; justify-content: center; color: var(--text-3);
  box-shadow: var(--edge-hi), var(--shadow-1);
}
.friend-row .fr-btn:hover { color: var(--text-1); }
.friends-list .section-h { display: block; margin: 4px 0 8px; }
.empty-state { padding: 40px 0; color: var(--text-3); font-size: 13px; max-width: 660px; text-align: center; }

/* Active Now panel (280px) */
.active-now {
  width: 280px; flex: none; border-left: 1px solid var(--line);
  padding: 16px; overflow-y: auto;
  --presence-ring: var(--bg-elevated);
}
.active-now h3 { font-size: 16px; font-weight: 600; letter-spacing: var(--track-head); margin-bottom: 2px; }
.active-now .an-sub { font-size: 12px; color: var(--text-3); margin-bottom: 10px; }
.an-card {
  background: var(--bg-elevated); border: 1px solid var(--border-faint);
  border-radius: var(--r-xl); padding: 12px; margin-top: 8px;
  box-shadow: var(--edge-hi), var(--shadow-1);
}
.an-card + .an-card { margin-top: 10px; }
.an-card .an-head { display: flex; align-items: center; gap: 10px; }
.an-card .an-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; letter-spacing: var(--track-tight); }
.an-card .an-doing { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.an-card .an-live {
  display: flex; align-items: center; gap: 7px; margin-top: 9px;
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.an-card .an-link { display: inline-block; margin-top: 8px; font-size: 12.5px; }

/* nested activity sub-card (H2) — Discord-style tile-within-tile */
.an-sub-card {
  margin-top: 10px; padding: 9px 11px;
  background: var(--bg-sunken); border: 1px solid var(--border-faint);
  border-radius: var(--r-md);
}
.an-sub-card .an-live { margin-top: 0; }
.an-sub-card .an-link { margin-top: 6px; font-size: 12px; }

/* ---- agent hub ---- */
.hub-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.hub-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; max-width: 960px;
}
.hub-card {
  background: var(--bg-elevated); border: 1px solid var(--border-faint);
  border-radius: var(--r-xl); padding: 14px 16px;
  box-shadow: var(--edge-hi), var(--shadow-1);
  --presence-ring: var(--bg-elevated);
}
.hub-card:hover {
  border-color: var(--border);
  transform: translateY(-1px);
  box-shadow: var(--edge-hi), var(--shadow-2);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.hub-card .hc-head { display: flex; align-items: center; gap: 12px; }
.hub-card .hc-name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; letter-spacing: var(--track-tight); }
.hub-card .hc-owner { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.hub-card .hc-desc { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-top: 10px; }
.hub-card.connect .hc-title { font-size: 14.5px; font-weight: 600; }
.connect-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; font-size: 13px; color: var(--text-1);
}
.connect-row + .connect-row { border-top: 1px solid var(--border-faint); }
.connect-row .coming { font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 2px 8px; }
.connect-div { height: 1px; background: var(--border); margin: 8px 0; }

/* ---- knowledge (personal, mini) — primitives moved to app.css ---- */

/* ---- DM views ---- */
.chipbar {
  min-height: 34px; flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 16px; border-bottom: 1px solid var(--border);
}
.chipbar .cb-hint { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* narrative check line in ship DM */
.done-line { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.done-line .ok { color: var(--ok); font-weight: 600; }
.action-row { display: flex; gap: 8px; margin-top: 8px; }

/* transcript depth (machine view) */
.transcript { padding: 2px 0; }
.transcript .trow, .transcript .tres { max-width: 560px; }

/* clone recap list */
.recap-list { list-style: none; counter-reset: recap; margin-top: 6px; max-width: 640px; }
.recap-list > li {
  counter-increment: recap; position: relative;
  padding: 7px 0 7px 30px; font-size: 14.5px; line-height: 1.45; color: var(--text-1);
}
.recap-list > li + li { border-top: 1px solid var(--border); }
.recap-list > li::before {
  content: counter(recap); position: absolute; left: 2px; top: 9px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--text-3);
  font-size: 10.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.link-btn {
  color: var(--accent-400); font-size: 13px; padding: 0;
  display: inline-flex; align-items: center; gap: 4px;
}
.link-btn:hover { text-decoration: underline; }
.quote-block {
  border-left: 2px solid var(--border-strong);
  background: var(--bg-elevated); border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 8px 12px; margin-top: 8px;
  font-size: 13.5px; color: var(--text-2); line-height: 1.5;
}
.quote-block .qb-meta { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.okmark { color: var(--ok); }

/* ---- quick switcher (S7-B, Cmd+K style — static demo) ---- */
.qk-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4,5,7,.6);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 160px;
}
.qk-backdrop[hidden] { display: none; }
.qk {
  width: 560px; border-radius: var(--r-2xl); padding: 14px;
  background: var(--glass-grad), var(--glass-bg-heavy);
  border: 1px solid rgba(255,255,255,.07);
  box-shadow: var(--edge-hi-strong), var(--shadow-3);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .qk { -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .qk { background: var(--bg-popover); }
}
.qk-input {
  height: 44px; display: flex; align-items: center; padding: 0 14px;
  background: var(--bg-sunken); border: 1px solid var(--border-faint);
  border-radius: var(--r-lg); font-size: 16px; color: var(--text-3); margin-bottom: 12px;
}
.qk .section-h { display: block; padding: 2px 6px 4px; }
.qk-row {
  width: 100%; height: 34px; display: flex; align-items: center; gap: 10px;
  padding: 0 8px; border-radius: var(--r-md); font-size: 13.5px; color: var(--text-2);
}
.qk-row:hover { background: var(--hover); color: var(--text-1); }
.qk-row .ch-like { color: var(--text-3); width: 16px; text-align: center; }
.qk .av-mini {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--av-group-a), var(--av-group-b));
  color: transparent; font-size: 7px;
}
.qk-foot { margin-top: 10px; padding: 8px 6px 0; border-top: 1px solid var(--border-faint); font-family: var(--mono); font-size: 11px; color: var(--text-3); }

/* ================= live-control layer (zero dead buttons) ================= */

/* search fields that are real inputs (tb-search/kn-search recipes: app.css) */
input.friends-search, input.qk-input {
  font-family: inherit; color: var(--text-1); outline: none;
  display: block; width: 100%;
}
input.friends-search::placeholder, input.qk-input::placeholder { color: var(--text-3); }
input.friends-search:focus { border-color: var(--focus-ring); }

/* legacy alias of .hidden (app.css) — DM close ✕, removed friends */
.gone { display: none !important; }

/* glass popover panels (.pop) live in app.css */

/* unread dot on the topbar inbox tray (approver-inbox mirror) */
.tb-btn { position: relative; }
.tb-dot {
  position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--danger); pointer-events: none;
}

/* composer reply mode chip (.cp-reply) lives in app.css */

/* pinned-message jump highlight */
.mrow.flash { background: var(--mention-bg); }
.mrow { transition: background .4s var(--ease); }

/* agent hub cards are clickable; wired connect state */
.hub-card { cursor: pointer; }
.hub-card.connect { cursor: default; }
.friend-row { cursor: pointer; }
.cp-plus, .cp-ic, .row-x { cursor: pointer; }
.btn.connected {
  background: transparent; border: 1px solid var(--border);
  color: var(--ok); box-shadow: none; pointer-events: none;
}

/* ship DM undo state */
.file-chip.struck { text-decoration: line-through; opacity: .55; }

/* knowledge edit-in-place styling lives in app.css (wysdm.noteEditor) */

/* connect modal mock */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; background: rgba(4,5,7,.6);
  display: flex; align-items: center; justify-content: center;
}
.modal { width: 380px; border-radius: var(--r-2xl); padding: 18px; }
.modal h2 { font-size: 15px; font-weight: 600; margin-bottom: 4px; letter-spacing: var(--track-head); }
.modal .m-sub { font-size: 12px; color: var(--text-3); margin-bottom: 12px; line-height: 1.45; }
.modal .m-label {
  display: block; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-3); margin-bottom: 4px;
}
.modal .m-row {
  display: flex; justify-content: space-between; font-size: 13px;
  padding: 8px 0; border-bottom: 1px solid var(--border-faint); color: var(--text-2);
}
.modal .m-row + .m-row { border-top: 0; }
.modal .m-row span:last-child { color: var(--text-1); }
.modal .pop-input { margin-bottom: 12px; height: 32px; font-size: 13px; }
.modal .m-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
