/* /public/workspace/workspace.css
   Workspace SPA styling.
   Uses --bg/--surface/--accent/etc. theme tokens from /shared/themes.css
   so brand colors and dark/light modes come for free per active theme.
   No fixed hex colors except for status semantics that don't have a token. */

/* ───────────────────────── Reset & shell ───────────────────────── */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.ws-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to bottom, var(--surface), var(--surface2));
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.ws-header h1 {
  font-size: 18px;
  margin: 0;
  flex: 1;
  font-weight: 700;
  letter-spacing: -0.2px;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ws-header-actions a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 160ms ease;
}
.ws-header-actions a:hover { background: var(--surface3); }
.ws-back { display: flex; align-items: center; gap: 6px; }
.ws-back-mark { height: 22px; width: auto; display: none; opacity: 0.9; }
.ws-push-pill {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 5px 11px; font-size: 11px; font-weight: 600; border-radius: 16px;
  cursor: pointer; transition: all 160ms ease; font-family: inherit;
}
.ws-push-pill.ok   { color: var(--green); border-color: var(--green); }
.ws-push-pill.warn { color: var(--orange); border-color: var(--orange); animation: ws-pulse 2.4s ease-in-out infinite; }
.ws-push-pill:hover { background: var(--surface3); }
.ws-meeting-pill {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 5px 11px; font-size: 11px; font-weight: 600; border-radius: 16px;
  cursor: pointer; transition: all 160ms ease; font-family: inherit;
}
.ws-meeting-pill:hover { background: var(--surface3); }
.ws-menu-toggle {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 160ms ease;
}
.ws-menu-toggle:hover { background: var(--surface3); transform: translateY(-1px); }

.ws-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 65px);
  position: relative;
}

/* ───────────────────────── Sidebar ───────────────────────── */
.ws-sidebar {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 0 80px;
  background: var(--surface);
}
.ws-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  margin-bottom: 4px;
}
.ws-workspace-name {
  font-weight: 700;
  opacity: 0.6;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.ws-icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 140ms ease;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ws-icon-btn:hover {
  background: var(--surface3);
  border-color: var(--border);
}
.ws-icon-btn:active { transform: scale(0.96); }
.ws-icon-btn.ws-delete-btn { color: var(--text-dim); }
.ws-icon-btn.ws-delete-btn:hover {
  background: rgba(183, 117, 67, 0.18);
  border-color: var(--red);
  color: var(--red);
}

.ws-tree { display: flex; flex-direction: column; }
.ws-space {
  padding: 8px 16px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 140ms ease;
  border-left: 2px solid transparent;
}
.ws-space:hover {
  background: var(--surface2);
  border-left-color: var(--accent-dim);
}
.ws-space-icon { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.ws-space-name { font-size: 13px; font-weight: 600; flex: 1; color: var(--text); }
.ws-space-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 140ms ease; }
.ws-space:hover .ws-space-actions { opacity: 1; }
.ws-space-chevron {
  display: inline-block;
  width: 12px;
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform 160ms ease;
  cursor: pointer;
  user-select: none;
}
.ws-space-chevron.expanded { transform: rotate(90deg); }

.ws-list-row {
  padding: 7px 16px 7px 42px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  transition: all 140ms ease;
  border-left: 2px solid transparent;
}
.ws-list-row:hover { background: var(--surface2); color: var(--text); border-left-color: var(--accent-dim); }
.ws-list-row.active {
  background: linear-gradient(90deg, var(--accent-dim), transparent);
  color: var(--accent-hover);
  border-left-color: var(--accent);
  font-weight: 600;
}
.ws-list-row .ws-row-delete { opacity: 0; transition: opacity 140ms ease; margin-left: 6px; }
.ws-list-row:hover .ws-row-delete { opacity: 1; }

/* ───────────────────────── Main pane ───────────────────────── */
.ws-main {
  overflow-y: auto;
  padding: 22px 26px 100px;
  background: var(--bg);
  position: relative;
}

.ws-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.ws-toolbar h2 {
  margin: 0;
  font-size: 22px;
  flex: 1;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.ws-view-tabs {
  display: inline-flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2) inset;
}
.ws-view-tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 7px;
  transition: all 160ms ease;
  letter-spacing: 0.2px;
  font-family: inherit;
}
.ws-view-tab:hover:not(.active) { color: var(--text); background: var(--surface2); }
.ws-view-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--bg);
  box-shadow: 0 2px 8px var(--accent-dim);
}

.ws-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: none;
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
  transition: all 160ms ease;
  box-shadow: 0 2px 8px var(--accent-dim);
  font-family: inherit;
}
.ws-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px var(--accent-dim); }
.ws-btn-primary:active { transform: translateY(0); }

/* Add-to-Calendar .ics buttons. Dedicated secondary/outline class so they stay
   visible in portrait (the mobile media query hides .ws-btn-primary, not this). */
.ws-meeting-ics-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: all 160ms ease;
}
.ws-meeting-ics-btn:hover { background: var(--surface3); }

.ws-empty {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-dim);
}
.ws-empty p { font-size: 14px; margin: 0 0 4px; }
.ws-empty::before {
  content: '✦';
  display: block;
  font-size: 48px;
  color: var(--accent-dim);
  margin-bottom: 12px;
  opacity: 0.6;
}

/* ───────────────────────── List view ───────────────────────── */
.ws-items { list-style: none; padding: 0; margin: 0; }
.ws-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 140ms ease;
  background: var(--surface);
  margin-bottom: 1px;
  border-radius: 0;
}
.ws-item-row:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.ws-item-row:last-child { border-bottom: none; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
.ws-item-row:hover { background: var(--surface2); transform: translateX(2px); }
.ws-item-row .ws-row-delete { opacity: 0; transition: opacity 140ms ease; flex-shrink: 0; }
.ws-item-row:hover .ws-row-delete { opacity: 1; }
.ws-item-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.ws-item-title { flex: 1; font-size: 14px; color: var(--text); line-height: 1.4; }
.ws-item-title.done { opacity: 0.5; text-decoration: line-through; color: var(--text-dim); }
.ws-item-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}

/* ───────────────────────── Chips & badges ───────────────────────── */
.ws-pri-chip {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 12px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.6px;
  border: 1px solid;
}
.ws-pri-urgent { background: rgba(183, 117, 67, 0.2);  color: var(--red);    border-color: var(--red); }
.ws-pri-high   { background: rgba(196, 162, 76, 0.2);  color: var(--orange); border-color: var(--orange); }
.ws-pri-medium { background: rgba(158, 171, 160, 0.15); color: var(--green);  border-color: var(--green); }
.ws-pri-low    { background: var(--surface3);            color: var(--text-dim); border-color: var(--border); }

.ws-type-badge {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-weight: 700;
}

/* ───────────────────────── Detail drawer ───────────────────────── */
.ws-detail {
  position: fixed;
  right: 0;
  top: 65px;
  bottom: 0;
  width: 460px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 24px 26px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: -8px 0 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: ws-drawer-slide 220ms ease-out;
}
@keyframes ws-drawer-slide {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.ws-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 160ms ease;
}
.ws-detail-close:hover { background: var(--surface3); transform: rotate(90deg); }
.ws-detail-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  align-items: center;
}
.ws-detail-row label {
  width: 86px;
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.ws-detail-row select,
.ws-detail-row input {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  transition: border-color 140ms ease;
}
.ws-detail-row select:focus,
.ws-detail-row input:focus { outline: none; border-color: var(--accent); }
.ws-detail-body-md {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-family: inherit;
  font-size: 13px;
  box-sizing: border-box;
  line-height: 1.5;
  transition: border-color 140ms ease;
}
.ws-detail-body-md:focus { outline: none; border-color: var(--accent); }

.ws-comments {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.ws-comment {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--surface2);
  font-size: 13px;
  transition: border-color 140ms ease;
}
.ws-comment:hover { border-color: var(--accent-dim); }
.ws-comment-author {
  font-weight: 700;
  color: var(--accent);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.ws-comment-body { margin-top: 4px; color: var(--text); line-height: 1.45; }
.ws-comment-row-actions { float: right; opacity: 0; transition: opacity 140ms ease; }
.ws-comment:hover .ws-comment-row-actions { opacity: 1; }

.ws-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.ws-attachment {
  aspect-ratio: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  transition: all 160ms ease;
}
.ws-attachment:hover { border-color: var(--accent); transform: scale(1.03); }
.ws-attachment img { width: 100%; height: 100%; object-fit: cover; }
.ws-attachment-icon { font-size: 28px; color: var(--text-dim); }

/* ───────────────────────── Board view ───────────────────────── */
.ws-board-view {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
}
.ws-board-col {
  flex: 0 0 280px;
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 160ms ease;
}
.ws-board-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.ws-board-col-count {
  background: var(--surface3);
  border-radius: 10px;
  padding: 1px 9px;
  font-size: 11px;
  color: var(--text);
}
.ws-board-col.drag-over {
  background: var(--accent-dim);
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-dim) inset;
}
.ws-board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 160ms ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.ws-board-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-dim);
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.ws-board-card:active { cursor: grabbing; opacity: 0.7; transform: scale(0.98); }
.ws-board-card-title { font-weight: 600; color: var(--text); line-height: 1.35; }
.ws-board-card-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-dim);
}

/* ───────────────────────── Calendar view ───────────────────────── */
.ws-cal-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ws-cal-header h3 { margin: 0; font-size: 18px; min-width: 200px; font-weight: 700; }
.ws-cal-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  transition: all 160ms ease;
}
.ws-cal-nav-btn:hover { background: var(--surface2); border-color: var(--accent-dim); }
.ws-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)); /* minmax(0,…) forces equal-width columns regardless of content */
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  table-layout: fixed;
  width: 100%;
}
.ws-cal-dow {
  background: var(--surface2);
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.ws-cal-day {
  background: var(--surface);
  min-height: 100px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  position: relative;
  transition: background 140ms ease;
  min-width: 0;       /* allows children with overflow:hidden to actually clip */
  overflow: hidden;
}
.ws-cal-day:hover { background: var(--surface2); }
.ws-cal-day.muted { opacity: 0.4; background: var(--bg); }
.ws-cal-day.today {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: linear-gradient(135deg, var(--surface), var(--accent-dim));
}
.ws-cal-day-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.ws-cal-day.today .ws-cal-day-num { color: var(--accent); }
.ws-cal-item {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--accent-dim);
  color: var(--accent-hover);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  font-weight: 500;
  transition: all 140ms ease;
  min-width: 0;
  max-width: 100%;
  display: block;
}
.ws-cal-item:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
.ws-cal-item.priority-urgent { background: rgba(183, 117, 67, 0.3); color: var(--red); }
.ws-cal-item.priority-high   { background: rgba(196, 162, 76, 0.3); color: var(--orange); }
.ws-cal-item.done { opacity: 0.4; text-decoration: line-through; }

/* ───────────────────────── Gallery view ───────────────────────── */
.ws-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.ws-gallery-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  transition: all 200ms ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.ws-gallery-tile:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}
.ws-gallery-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ws-gallery-tile-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 40px;
  color: var(--text-dim);
  opacity: 0.5;
}
.ws-gallery-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.92), rgba(0,0,0,0));
  padding: 10px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1px;
}
.ws-gallery-overlay-meta {
  font-size: 10px;
  opacity: 0.8;
  font-weight: 400;
  margin-top: 3px;
}
.ws-gallery-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}

/* ───────────────────────── Doc view ───────────────────────── */
.ws-doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 18px;
  min-height: 60vh;
}
.ws-doc-list {
  border-right: 1px solid var(--border);
  padding-right: 14px;
  overflow-y: auto;
}
.ws-doc-list-item {
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 7px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 140ms ease;
  color: var(--text-muted);
}
.ws-doc-list-item:hover { background: var(--surface2); color: var(--text); }
.ws-doc-list-item.active {
  background: linear-gradient(90deg, var(--accent-dim), transparent);
  color: var(--accent-hover);
  font-weight: 600;
}
.ws-doc-list-pinned { font-size: 10px; opacity: 0.7; color: var(--text-dim); }
.ws-doc-pane { overflow-y: auto; padding-right: 8px; }
.ws-doc-pane h1 { margin-top: 0; font-size: 26px; letter-spacing: -0.5px; }
.ws-doc-pane h2 { font-size: 21px; margin-top: 28px; }
.ws-doc-pane h3 { font-size: 17px; margin-top: 18px; color: var(--accent); }
.ws-doc-pane p { line-height: 1.6; color: var(--text); }
.ws-doc-pane ul, .ws-doc-pane ol { padding-left: 24px; }
.ws-doc-pane li { line-height: 1.7; }
.ws-doc-pane code {
  background: var(--surface3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--border);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
}
.ws-doc-pane pre {
  background: var(--surface);
  padding: 14px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
}
.ws-doc-pane pre code { border: none; padding: 0; background: none; }
.ws-doc-banner {
  background: linear-gradient(135deg, var(--accent-dim), var(--surface2));
  border: 1px solid var(--accent);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--accent-hover);
}
.ws-doc-textarea {
  width: 100%;
  min-height: 60vh;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color 160ms ease;
}
.ws-doc-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.ws-doc-empty { text-align: center; padding: 80px 20px; color: var(--text-dim); }
.ws-doc-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }

/* ───────────────────────── Inline help tips ───────────────────────── */
.ws-help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface3); color: var(--text-dim); border: 1px solid var(--border);
  font-size: 11px; font-weight: 700; font-family: inherit; cursor: pointer;
  margin-left: 6px; vertical-align: middle;
  transition: all 140ms ease; padding: 0; line-height: 1;
}
.ws-help-tip:hover { background: var(--accent-dim); color: var(--accent-hover); border-color: var(--accent); }
.ws-help-pop {
  position: fixed; z-index: 200;
  background: var(--surface); border: 1px solid var(--accent);
  border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.55);
  font-size: 12px; line-height: 1.55; color: var(--text);
  max-width: 320px;
}
.ws-help-pop::before {
  content: ''; position: absolute; top: -7px; left: 16px;
  width: 12px; height: 12px; background: var(--surface);
  border-top: 1px solid var(--accent); border-left: 1px solid var(--accent);
  transform: rotate(45deg);
}
.ws-help-pop strong { color: var(--accent); }
.ws-help-pop code { background: var(--surface2); padding: 1px 5px; border-radius: 3px; font-size: 11px; }

/* ───────────────────────── Notification trainer ───────────────────────── */
.ws-trainer-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.ws-trainer-tab {
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.ws-trainer-tab:hover { color: var(--text); border-color: var(--accent-dim); }
.ws-trainer-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.ws-trainer-body { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.ws-trainer-body ol { margin: 0; padding-left: 22px; }
.ws-trainer-body li { margin: 6px 0; line-height: 1.5; font-size: 13px; }
.ws-trainer-callout {
  margin-top: 12px; background: var(--accent-dim); border: 1px solid var(--accent);
  border-radius: 8px; padding: 10px 14px; font-size: 12px; color: var(--accent-hover);
}
.ws-trainer-help-link {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-size: 13px;
  transition: all 160ms ease;
}
.ws-trainer-help-link:hover { background: var(--surface3); border-color: var(--accent); transform: rotate(10deg); }

/* ───────────────────────── @mention autocomplete ───────────────────────── */
.ws-mention-pop {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
}
.ws-mention-item {
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.ws-mention-item:hover, .ws-mention-item.selected {
  background: linear-gradient(90deg, var(--accent-dim), transparent);
  color: var(--accent-hover);
}
.ws-mention-role {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px;
  background: var(--surface3); color: var(--text-dim);
  border: 1px solid var(--border); padding: 1px 6px; border-radius: 10px;
}
.ws-mention-item.is-group {
  background: linear-gradient(90deg, var(--accent-dim) 0%, transparent 100%);
}
.ws-mention-item.is-group .ws-mention-role {
  background: var(--accent-dim); color: var(--accent-hover); border-color: var(--accent);
}

/* Export dropdown */
.ws-export-pop {
  position: fixed; z-index: 80;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,0.5); min-width: 180px;
}
.ws-export-pop button {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; color: var(--text);
  padding: 8px 12px; border-radius: 6px; width: 100%; text-align: left;
  cursor: pointer; font-family: inherit; font-size: 13px;
}
.ws-export-pop button:hover { background: var(--surface2); }

/* ───────────────────────── Message Board / Feed ───────────────────────── */
.ws-feed-view { max-width: 720px; margin: 0 auto; padding-bottom: 40px; }

.ws-feed-composer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.ws-feed-composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.ws-feed-composer textarea {
  width: 100%; min-height: 60px; resize: vertical;
  background: transparent; color: var(--text); border: none;
  font-family: inherit; font-size: 14px; line-height: 1.5; box-sizing: border-box;
  padding: 4px 0;
}
.ws-feed-composer textarea:focus { outline: none; }
.ws-feed-composer-tools {
  display: flex; align-items: center; gap: 8px; padding-top: 10px;
  border-top: 1px solid var(--border); margin-top: 6px; flex-wrap: wrap;
}
.ws-feed-composer-tools input[type="text"] {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px; font-family: inherit; font-size: 12px;
}
.ws-feed-composer-preview {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.ws-feed-preview-chip {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 10px; font-size: 11px; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.ws-feed-preview-chip .x { cursor: pointer; opacity: 0.5; }
.ws-feed-preview-chip .x:hover { opacity: 1; color: var(--red); }

.ws-feed-empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.ws-feed-empty::before { content: '📣'; display: block; font-size: 54px; color: var(--accent-dim); margin-bottom: 12px; opacity: 0.6; }

.ws-feed-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  transition: border-color 160ms ease;
}
.ws-feed-post:hover { border-color: var(--accent-dim); }
.ws-feed-post-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.ws-feed-post-author {
  font-weight: 700; color: var(--accent); font-size: 13px;
}
.ws-feed-post-time { font-size: 11px; color: var(--text-dim); }
.ws-feed-post-due {
  background: var(--accent-dim); color: var(--accent-hover);
  border: 1px solid var(--accent); border-radius: 8px;
  font-size: 11px; padding: 2px 9px; font-weight: 600; margin-left: auto;
}
.ws-feed-post-body { color: var(--text); line-height: 1.55; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.ws-feed-post-body a { color: var(--accent); text-decoration: underline; }
.ws-mention-chip {
  display: inline-block; padding: 1px 7px; border-radius: 10px; font-weight: 600;
  background: var(--accent-dim); color: var(--accent-hover); border: 1px solid var(--accent);
  font-size: 0.9em;
}
.ws-feed-post-images {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px; margin-top: 12px;
}
.ws-feed-post-image {
  aspect-ratio: 4/3; border-radius: 10px; overflow: hidden;
  background: var(--surface2); border: 1px solid var(--border);
  cursor: pointer; transition: transform 180ms ease;
}
.ws-feed-post-image:hover { transform: scale(1.02); }
.ws-feed-post-image img { width: 100%; height: 100%; object-fit: cover; }

/* Poll widget inside feed posts */
.ws-poll { margin-top: 12px; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; }
.ws-poll-q { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.ws-poll-closed, .ws-poll-multi { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--surface3); color: var(--text-muted); font-weight: 500; }
.ws-poll-options { display: flex; flex-direction: column; gap: 4px; }
.ws-poll-option {
  position: relative; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; transition: border-color 140ms ease, background 140ms ease;
  text-align: left; color: var(--text); font-size: 13px; overflow: hidden;
}
.ws-poll-option:hover:not(:disabled) { border-color: var(--accent-dim); }
.ws-poll-option:disabled { opacity: 0.6; cursor: default; }
.ws-poll-option.voted { border-color: var(--accent); background: var(--accent-dim); }
.ws-poll-option-bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(212,164,74,0.18); transition: width 220ms ease; pointer-events: none; z-index: 0; }
.ws-poll-option.voted .ws-poll-option-bar { background: rgba(212,164,74,0.35); }
.ws-poll-option-text { flex: 1; position: relative; z-index: 1; }
.ws-poll-option-meta { position: relative; z-index: 1; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ws-poll-foot { margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.ws-poll-foot a { color: var(--accent); text-decoration: none; cursor: pointer; }
.ws-poll-foot a:hover { text-decoration: underline; }

.ws-feed-post-files { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ws-feed-post-file {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; text-decoration: none; color: var(--text);
  transition: all 140ms ease;
}
.ws-feed-post-file:hover { border-color: var(--accent); transform: translateX(2px); }
.ws-feed-post-file-name { flex: 1; font-weight: 600; word-break: break-word; }
.ws-feed-post-file-meta { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }

.ws-feed-post-actions {
  display: flex; gap: 14px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 12px;
}
.ws-feed-action {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-family: inherit; font-size: 12px; padding: 4px 6px; border-radius: 4px;
  transition: all 140ms ease;
}
.ws-feed-action:hover { background: var(--surface2); color: var(--text); }

.ws-feed-replies { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--accent-dim); display: none; }
.ws-feed-replies.open { display: block; }
.ws-feed-reply {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 6px; font-size: 13px;
}
.ws-feed-reply-author { font-weight: 700; color: var(--accent); font-size: 11px; }
.ws-feed-reply-body { margin-top: 2px; line-height: 1.4; }
.ws-feed-reply-compose {
  display: flex; gap: 6px; margin-top: 8px;
}
.ws-feed-reply-compose input {
  flex: 1; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; font-family: inherit; font-size: 13px;
}

/* Sidebar Message Board hint */
.ws-space[data-board="1"] {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  background: linear-gradient(90deg, var(--surface2), transparent);
}
.ws-space[data-board="1"] .ws-space-name { color: var(--accent); }

/* ───────────────────────── File Cabinet ───────────────────────── */
.ws-files-view { padding-bottom: 40px; }
.ws-files-drop {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 18px;
  color: var(--text-muted);
  transition: all 160ms ease;
  cursor: pointer;
  background: var(--surface);
}
.ws-files-drop:hover, .ws-files-drop.drag {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent-hover);
}
.ws-files-drop strong { color: var(--accent); }
.ws-files-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.ws-files-toolbar input {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; font-family: inherit; font-size: 13px; width: 200px;
}
.ws-files-toolbar select {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 10px; font-family: inherit; font-size: 13px;
}
.ws-files-count { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }

.ws-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.ws-file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 180ms ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 150px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ws-file-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(0,0,0,0.4);
}
.ws-file-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 6px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  margin-bottom: 6px;
  overflow: hidden;
  position: relative;
}
.ws-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ws-file-ext-chip {
  position: absolute; top: 6px; right: 6px;
  font-size: 9px; padding: 2px 6px; border-radius: 3px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.ws-file-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; word-break: break-word; overflow: hidden; max-height: 36px; }
.ws-file-meta { font-size: 11px; color: var(--text-dim); display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.ws-file-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 140ms ease; position: absolute; bottom: 8px; right: 8px; }
.ws-file-card:hover .ws-file-actions { opacity: 1; }

.ws-files-empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.ws-files-empty::before {
  content: '🗂'; display: block; font-size: 56px; color: var(--accent-dim); margin-bottom: 12px; opacity: 0.6;
}

/* Preview modal — bigger for full document view */
.ws-modal-preview { width: min(960px, 100%); max-height: 90vh; padding: 16px; }
.ws-preview-header {
  display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px;
  border-bottom: 1px solid var(--border); margin-bottom: 12px;
}
.ws-preview-header h3 { margin: 0; font-size: 16px; flex: 1; word-break: break-word; }
.ws-preview-frame {
  width: 100%; height: 70vh; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.ws-preview-image {
  width: 100%; max-height: 70vh; object-fit: contain; background: var(--bg); border-radius: 8px;
}
.ws-preview-text {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; white-space: pre-wrap; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 13px; max-height: 70vh; overflow: auto; color: var(--text); line-height: 1.5;
}
.ws-preview-fallback {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 40px 20px; text-align: center; color: var(--text-muted);
}
.ws-preview-fallback strong { color: var(--accent); }

/* ───────────────────────── Toolbar actions + filter bar ───────────────────────── */
.ws-toolbar-actions { display: flex; gap: 6px; align-items: center; }
.ws-filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; margin-bottom: 14px;
}
.ws-filter-bar select, .ws-filter-bar input {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px;
  font-family: inherit; font-size: 12px;
}
.ws-filter-bar select:focus, .ws-filter-bar input:focus { outline: none; border-color: var(--accent); }
.ws-filter-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); font-weight: 700; }
.ws-filter-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 6px; }
.ws-filter-chip {
  background: var(--surface3); border: 1px solid var(--border); border-radius: 12px;
  padding: 3px 10px; font-size: 11px; cursor: pointer; color: var(--text-muted);
  transition: all 140ms ease;
}
.ws-filter-chip:hover { color: var(--text); border-color: var(--accent-dim); }
.ws-filter-chip.active { background: var(--accent-dim); color: var(--accent-hover); border-color: var(--accent); }
.ws-filter-chip-x { margin-left: 4px; opacity: 0.5; }
.ws-filter-chip-x:hover { opacity: 1; color: var(--red); }

/* ───────────────────────── Modals (cmdk, ai-draft, activity, dashboard) ───────────────────────── */
.ws-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
  animation: ws-modal-fade 200ms ease-out;
}
@keyframes ws-modal-fade { from { opacity: 0 } to { opacity: 1 } }
.ws-modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  width: min(560px, 100%);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: ws-modal-pop 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes ws-modal-pop { from { transform: translateY(-12px) scale(0.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.ws-modal-wide { width: min(880px, 100%); }
.ws-modal-close {
  float: right; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); width: 30px; height: 30px; border-radius: 8px;
  cursor: pointer; font-size: 16px;
  transition: all 160ms ease;
}
.ws-modal-close:hover { background: var(--surface3); transform: rotate(90deg); }
.ws-modal-card textarea {
  width: 100%; background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px;
  font-family: inherit; font-size: 13px; line-height: 1.5; box-sizing: border-box; resize: vertical;
}
.ws-modal-card textarea:focus { outline: none; border-color: var(--accent); }

/* Cmd+K palette */
.ws-cmdk-card { padding: 0; overflow: hidden; }
.ws-cmdk-input {
  width: 100%; padding: 16px 20px; font-size: 16px;
  background: transparent; color: var(--text); border: none; border-bottom: 1px solid var(--border);
  font-family: inherit;
}
.ws-cmdk-input:focus { outline: none; }
.ws-cmdk-results { max-height: 380px; overflow-y: auto; }
.ws-cmdk-result {
  padding: 12px 20px; cursor: pointer; display: flex; gap: 10px; align-items: center;
  border-bottom: 1px solid var(--border); transition: all 120ms ease;
}
.ws-cmdk-result:hover, .ws-cmdk-result.selected {
  background: linear-gradient(90deg, var(--accent-dim), transparent);
}
.ws-cmdk-result-icon { font-size: 18px; opacity: 0.8; }
.ws-cmdk-result-title { flex: 1; font-size: 14px; color: var(--text); }
.ws-cmdk-result-kind { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); }
.ws-cmdk-hint { padding: 8px 14px; font-size: 11px; color: var(--text-dim); border-top: 1px solid var(--border); text-align: center; }
.ws-cmdk-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 20px 4px; color: var(--text-dim); font-weight: 700;
  background: var(--surface2);
}
mark {
  background: var(--accent);
  color: var(--bg);
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
}

/* Activity feed */
.ws-activity-row {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; font-size: 13px;
}
.ws-activity-row:last-child { border-bottom: none; }
.ws-activity-time { color: var(--text-dim); font-size: 11px; min-width: 110px; }
.ws-activity-action { font-weight: 600; color: var(--accent); margin-right: 6px; }
.ws-activity-detail { color: var(--text); flex: 1; }

/* Dashboard */
.ws-dash-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.ws-dash-tab {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted);
  padding: 5px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; font-weight: 600;
  font-family: inherit; transition: all 140ms ease;
}
.ws-dash-tab:hover { color: var(--text); border-color: var(--accent-dim); }
.ws-dash-tab.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.ws-dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; }
.ws-dash-stat {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; text-align: center;
}
.ws-dash-stat-val {
  font-size: 28px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ws-dash-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-top: 4px; font-weight: 700; }
.ws-dash-sparkline {
  width: 100%; height: 90px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}

/* Subtasks */
.ws-item-row.is-subtask { padding-left: 40px; background: var(--surface); }
.ws-item-row.is-subtask::before {
  content: '↳';
  color: var(--text-dim);
  margin-right: 6px;
  font-size: 14px;
}
.ws-subtask-toggle {
  background: transparent; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 14px; padding: 0 4px;
}

/* AI draft preview */
.ws-ai-preview {
  background: linear-gradient(135deg, var(--accent-dim), var(--surface2));
  border: 1px solid var(--accent); border-radius: 10px; padding: 14px;
}
.ws-ai-preview-field { display: flex; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.ws-ai-preview-label { width: 80px; opacity: 0.7; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }

/* Duplicate banner */
.ws-dup-banner {
  background: rgba(196, 162, 76, 0.15); border: 1px solid var(--orange); border-radius: 8px;
  padding: 8px 12px; font-size: 12px; color: var(--orange); margin: 8px 0;
}

/* SSE live-dot indicator */
.ws-live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 0 var(--green);
  animation: ws-pulse 2.2s ease-in-out infinite;
  vertical-align: middle; margin-left: 6px;
}
@keyframes ws-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--green); opacity: 0.8; }
  50%      { box-shadow: 0 0 0 6px transparent; opacity: 1; }
}
.ws-live-dot.disconnected { background: var(--text-dim); animation: none; box-shadow: none; }

/* ───────────────────────── FAB (Floating Action Button) ───────────────────────── */
.ws-fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
  z-index: 30;
  pointer-events: none;
}
.ws-fab-container > * { pointer-events: auto; }
.ws-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px var(--accent-dim), 0 2px 6px rgba(0,0,0,0.3);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.ws-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 10px 28px var(--accent-dim), 0 4px 10px rgba(0,0,0,0.4); }
.ws-fab:active { transform: scale(0.96); }
.ws-fab-sub {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 180ms ease;
}
.ws-fab-sub:hover { background: var(--surface3); border-color: var(--accent); transform: translateY(-1px); }

/* ───────────────────────── Mobile ───────────────────────── */
@media (max-width: 768px) {
  /* Tighter header for narrow portrait — keeps hamburger + title + actions on one row */
  .ws-header { padding: 10px 12px; gap: 8px; }
  .ws-header h1 { font-size: 16px; }
  .ws-header-actions { gap: 4px; }
  .ws-header-actions a { padding: 4px 6px; font-size: 12px; }

  /* Feed composer: full-width date input and post button on portrait */
  .ws-feed-composer { padding: 12px; }
  .ws-feed-composer-tools { gap: 6px; padding-top: 8px; }
  .ws-feed-composer-tools input[type="date"] { flex: 1 1 140px; min-width: 120px; }
  .ws-feed-composer-tools .ws-btn-primary { flex: 0 0 auto; }

  /* Feed post cards: less horizontal padding on narrow viewports */
  .ws-feed-post { padding: 14px 12px; }

  .ws-layout { grid-template-columns: 1fr; }
  .ws-sidebar {
    position: fixed;
    left: -300px;
    top: 65px;
    bottom: 0;
    width: 300px;
    background: var(--surface);
    transition: left 240ms cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40;
    box-shadow: 4px 0 16px rgba(0,0,0,0.4);
  }
  .ws-sidebar.open { left: 0; }
  .ws-menu-toggle { display: inline-flex; }
  .ws-main { padding: 16px; padding-bottom: 100px; }

  /* Sidebar overlay backdrop when open */
  .ws-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 65px 0 0 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 35;
  }
  .ws-sidebar.open + .ws-sidebar-backdrop { display: block; }

  /* Detail = bottom sheet on mobile */
  .ws-detail {
    width: 100%;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: 88vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    padding: 22px 18px;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.5);
    animation: ws-sheet-slide 240ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  @keyframes ws-sheet-slide {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  /* Drag handle suggestion at top of bottom sheet */
  .ws-detail::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
  }

  /* Touch devices: always show action buttons (no hover) */
  .ws-space-actions,
  .ws-list-row .ws-row-delete,
  .ws-item-row .ws-row-delete,
  .ws-comment-row-actions { opacity: 1; }

  /* Bigger tap targets on mobile */
  .ws-icon-btn { min-width: 38px; min-height: 38px; padding: 6px 10px; }
  .ws-item-row { padding: 16px; gap: 12px; }
  .ws-item-check { width: 22px; height: 22px; }
  .ws-list-row { padding: 12px 16px 12px 42px; }
  .ws-space { padding: 10px 16px; }

  .ws-doc-layout { grid-template-columns: 1fr; }
  .ws-doc-list {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 12px;
    max-height: 200px;
  }
  .ws-cal-day { min-height: 72px; padding: 4px 6px; }
  .ws-cal-header h3 { font-size: 16px; min-width: auto; }

  .ws-toolbar { gap: 10px; }
  .ws-toolbar h2 { font-size: 18px; }
  .ws-view-tabs { width: 100%; justify-content: space-between; }
  .ws-view-tab { flex: 1; padding: 8px 6px; font-size: 11px; }
  .ws-btn-primary { display: none; } /* Replaced by FAB on mobile */

  .ws-fab { width: 64px; height: 64px; font-size: 28px; }
  .ws-fab-sub { width: 50px; height: 50px; font-size: 20px; }
  .ws-fab-container { bottom: 20px; right: 20px; gap: 14px; }
}

/* ───────────────────────── Scrollbar polish (webkit) ───────────────────────── */
.ws-sidebar::-webkit-scrollbar,
.ws-main::-webkit-scrollbar,
.ws-detail::-webkit-scrollbar,
.ws-board-view::-webkit-scrollbar { width: 8px; height: 8px; }
.ws-sidebar::-webkit-scrollbar-thumb,
.ws-main::-webkit-scrollbar-thumb,
.ws-detail::-webkit-scrollbar-thumb,
.ws-board-view::-webkit-scrollbar-thumb {
  background: var(--surface3); border-radius: 4px;
}
.ws-sidebar::-webkit-scrollbar-thumb:hover,
.ws-main::-webkit-scrollbar-thumb:hover,
.ws-detail::-webkit-scrollbar-thumb:hover,
.ws-board-view::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ───────────────────────── Meeting time poll card ───────────────────────── */
.ws-mtp-slot{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;border:1px solid var(--border,#333);background:var(--bg,#15151f);color:var(--text);border-radius:6px;padding:8px 10px;margin-bottom:6px;cursor:pointer;overflow:hidden}
.ws-mtp-slot .ws-mtp-bar{position:absolute;left:0;top:0;bottom:0;background:var(--accent-dim,#2a3a5c);z-index:0}
.ws-mtp-slot .ws-mtp-label,.ws-mtp-slot .ws-mtp-meta{position:relative;z-index:1}
.ws-mtp-slot .ws-mtp-meta{margin-left:auto;opacity:0.8;font-size:12px}
.ws-mtp-slot.voted{border-color:var(--accent,#5b8def)}
.ws-mtp-slot.winner{box-shadow:inset 0 0 0 2px var(--accent,#5b8def)}
.ws-mtp-slot.winner .ws-mtp-label{font-weight:600}
