/* ════════════════════════════════════════════════════════════════════
   workspace-dashboard.css — adaptive bento dashboard (.wsd-*)
   2026-06-06 (per K). Pure liquid glass: every tile uses the canonical
   card recipe; tiles appear only when their section has content.
   ════════════════════════════════════════════════════════════════════ */

/* 2026-06-06 (per K, r4): tiles HUG their content — no stretched rows, no
   dead space inside cards. The grid packs densely; each card is exactly as
   tall as what it shows (growing naturally as content grows, capped by the
   per-tile item limits). */
#wsDashboardMount {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.wsd-grid {
  flex: 1 1 auto;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  /* Masonry: 4px micro-rows with NO row gap — the 12px gutter is built into
     each card as margin-bottom, so span rounding wastes <4px instead of up
     to a full 22px row unit (the slack K saw under every box). */
  grid-auto-rows: 4px;
  grid-auto-flow: dense;
  row-gap: 0;
  column-gap: 18px;
  align-content: start;
}
.wsd-grid > .wsd-tile { margin-bottom: 18px; }

.wsd-tile {
  appearance: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 32px rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;          /* content can never bleed past the glass */
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.wsd-tile:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.wsd-tile--wide { grid-column: span 2; }
@media (max-width: 980px) { .wsd-tile--wide { grid-column: span 1; } }
.wsd-tile--static { cursor: default; }
.wsd-tile--static:hover { transform: none; background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); }

.wsd-big {
  font: 600 40px/1.05 var(--sj-font-display, ui-sans-serif, system-ui);
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.97);
}

.wsd-tile__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.wsd-tile__icon {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font: 500 13px/1 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.85);
}
.wsd-tile__name {
  font: 600 14px/1.2 ui-sans-serif, system-ui;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.95);
  flex: 0 0 auto;
}
.wsd-tile__badge {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font: 500 10.5px/1.2 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.62);
}
.wsd-tile__go {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.35);
  font: 400 14px/1 ui-sans-serif, system-ui;
  transition: color 140ms ease, transform 140ms ease;
}
.wsd-tile:hover .wsd-tile__go { color: rgba(255, 255, 255, 0.9); transform: translateX(2px); }

.wsd-tile__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.wsd-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font: 400 12.5px/1.35 ui-sans-serif, system-ui;
}
.wsd-row__main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.86);
}
.wsd-row__meta {
  flex: 0 0 auto;
  max-width: 38%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}
.wsd-row__time {
  flex: 0 0 auto;
  min-width: 52px;
  font: 600 11px/1.2 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.65);
  font-variant-numeric: tabular-nums;
}

.wsd-dot {
  flex: 0 0 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}
.wsd-dot--ok   { background: #6ee7a8; box-shadow: 0 0 8px rgba(110, 231, 168, 0.5); }
.wsd-dot--run  { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.5); animation: wsd-pulse 1.6s ease-in-out infinite; }
.wsd-dot--wait { background: #c4b5fd; box-shadow: 0 0 8px rgba(196, 181, 253, 0.5); }
.wsd-dot--bad  { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.5); }
.wsd-dot--dim  { background: rgba(255, 255, 255, 0.22); }
@keyframes wsd-pulse { 50% { opacity: 0.45; } }

.wsd-foot {
  font: 400 11.5px/1.4 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.48);
}

.wsd-meter {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  overflow: hidden;
}
.wsd-meter__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.55), rgba(255,255,255,0.30));
}

/* Loading ghosts */
.wsd-tile--ghost {
  min-height: 120px;
  pointer-events: none;
  background: linear-gradient(100deg,
    rgba(255,255,255,0.04) 40%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 60%);
  background-size: 200% 100%;
  animation: wsd-shimmer 1.4s linear infinite;
}
@keyframes wsd-shimmer { to { background-position: -200% 0; } }

.wsd-tile--onboard .wsd-tile__name { font-size: 15px; }

/* ═══ Per-tile custom UIs (2026-06-06, per K) ═══════════════════════ */

/* Status / time chips */
.wsd-chip {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font: 500 10.5px/1.2 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.66);
  white-space: nowrap;
}
.wsd-chip--ok   { color: #a7f3cb; border-color: rgba(110,231,168,0.25); }
.wsd-chip--run  { color: #fde68a; border-color: rgba(251,191,36,0.30); }
.wsd-chip--wait { color: #ddd6fe; border-color: rgba(196,181,253,0.30); }
.wsd-chip--bad  { color: #fecaca; border-color: rgba(248,113,113,0.30); }

/* Missions — status-edged rows */
.wsd-mission {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  padding: 7px 10px 7px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left-width: 2.5px;
  font: 400 12.5px/1.35 ui-sans-serif, system-ui;
}
.wsd-edge--ok   { border-left-color: rgba(110,231,168,0.75); }
.wsd-edge--run  { border-left-color: rgba(251,191,36,0.85); }
.wsd-edge--wait { border-left-color: rgba(196,181,253,0.85); }
.wsd-edge--bad  { border-left-color: rgba(248,113,113,0.85); }

/* Today — mini timeline */
.wsd-timeline { display: flex; flex-direction: column; }
.wsd-tl { display: flex; align-items: stretch; gap: 10px; min-width: 0; }
.wsd-tl__time {
  flex: 0 0 56px;
  padding-top: 2px;
  font: 600 11px/1.2 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.65);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.wsd-tl__rail { flex: 0 0 10px; position: relative; }
.wsd-tl__rail::before {
  content: ''; position: absolute; left: 4px; top: 0; bottom: 0;
  width: 1.5px; background: rgba(255, 255, 255, 0.12);
}
.wsd-tl__rail i {
  position: absolute; left: 1px; top: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #6ee7a8; box-shadow: 0 0 8px rgba(110,231,168,0.5);
}
.wsd-tl:last-child .wsd-tl__rail::before { bottom: auto; height: 12px; }
.wsd-tl__card {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
  padding: 2px 0 12px;
}
.wsd-tl__title {
  font: 500 12.5px/1.35 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.90);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wsd-tl__loc {
  font: 400 11px/1.3 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.45);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Reminders — checklist */
.wsd-todo {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
  font: 400 12.5px/1.35 ui-sans-serif, system-ui;
  padding: 2px 0;
}
.wsd-todo__ring {
  flex: 0 0 14px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.wsd-todo--overdue .wsd-todo__ring { border-color: rgba(248,113,113,0.85); box-shadow: 0 0 8px rgba(248,113,113,0.35); }

/* Inbox — avatar messages */
.wsd-msg { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 0; }
.wsd-msg__avatar {
  flex: 0 0 26px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.05));
  border: 1px solid rgba(255, 255, 255, 0.14);
  font: 600 9.5px/1 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.85);
}
.wsd-msg__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.wsd-msg__subject {
  font: 500 12.5px/1.35 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.78);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wsd-msg__from {
  font: 400 11px/1.3 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.42);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wsd-msg--unread .wsd-msg__subject { color: rgba(255, 255, 255, 0.98); font-weight: 600; }
.wsd-msg--unread .wsd-msg__avatar { border-color: rgba(196,181,253,0.55); }

/* Newsroom — swipeable highlights carousel */
.wsd-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  margin: 0 -4px;
  padding-left: 4px; padding-right: 4px;
  scrollbar-width: none;
  flex: 1 1 auto;
  min-height: 0;
}
.wsd-carousel::-webkit-scrollbar { display: none; }
.wsd-news-card {
  position: relative;
  flex: 0 0 228px;
  min-height: 148px;
  border-radius: 14px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 160ms ease, border-color 160ms ease;
}
.wsd-news-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.28); }
.wsd-news-card__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.wsd-news-card__img--blank {
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02));
}
.wsd-news-card__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 30%, rgba(0,0,0,0.72) 100%);
}
.wsd-news-card__src {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font: 600 9.5px/1.2 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.92);
  max-width: 75%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wsd-news-card__title {
  position: relative;
  padding: 0 10px 9px;
  font: 600 12px/1.35 ui-sans-serif, system-ui;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wsd-news-card__age {
  position: absolute; top: 8px; right: 8px;
  font: 500 9.5px/1.2 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* Agents — run bars */
.wsd-bar { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 0; }
.wsd-bar__name {
  flex: 0 0 38%;
  display: flex; align-items: center; gap: 6px;
  font: 500 12px/1.3 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.82);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-transform: capitalize;
}
.wsd-bar__track {
  flex: 1 1 auto;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.wsd-bar__fill {
  display: block; height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.55), rgba(255,255,255,0.25));
}
.wsd-bar__val {
  flex: 0 0 auto;
  font: 500 10.5px/1.2 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.50);
  font-variant-numeric: tabular-nums;
}

/* Connectors / Engines — chip cloud */
.wsd-chips { display: flex; flex-wrap: wrap; gap: 9px; align-content: flex-start; }
.wsd-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font: 500 12px/1.25 ui-sans-serif, system-ui;
  color: rgba(255, 255, 255, 0.82);
  text-transform: capitalize;
  white-space: nowrap;
}


/* 2026-06-13 — overview breathes wider at low tile-count without breaking
   the adaptive bento growth rules (tiles still appear only with content). */
#wsDashboardMount {
  width: 100%;
  padding: 4px 2px 12px;
}
.ws-main > .ws-section[data-ws-section-view="overview"] {
  max-width: min(1560px, 100%);
}
.ws-main > .ws-section[data-ws-section-view="overview"] .ws-section__title {
  font-size: clamp(26px, 2.4vw, 34px);
  letter-spacing: -0.03em;
}
