/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  --accent: #E9FE69;
  --accent-ink: #1a1d12;
  --accent-soft: #f4ffb5;

  --bg: #f5f5f5;
  --bg-dot: #d6d6d6;
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --border: #ececec;
  --border-strong: #d9d9d9;

  --ink: #121212;
  --ink-soft: #2a2a2a;
  --ink-muted: #6b6b6b;
  --ink-faint: #a0a0a0;

  --danger: #e7484d;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-soft: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lift: 0 2px 4px rgba(0,0,0,0.06), 0 10px 24px rgba(0,0,0,0.08);
  --shadow-modal: 0 20px 50px rgba(0,0,0,0.18);

  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* Make the `hidden` HTML attribute win over component-level display rules
   like `display: grid/flex`. Without this, elements such as .modal-backdrop,
   .view, .tab-switch, .empty-state and .media-preview stay visible even when
   JS sets `el.hidden = true`. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "ss01" on, "ss02" on;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
a { color: inherit; }

/* =========================================================
   APP SHELL
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  height: 100vh;
  overflow: hidden;
}

.app.collapsed { grid-template-columns: 0 1fr; }
.app.collapsed .sidebar { transform: translateX(-100%); }

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 12px;
  transition: transform 240ms ease;
  position: relative;
  z-index: 5;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 14px;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,254,105,0.3);
}
.logo-dot.big {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  box-shadow: 0 0 0 6px rgba(233,254,105,0.28);
}

.new-workspace-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--ink-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 180ms ease;
}
.new-workspace-btn:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
  background: var(--surface-muted);
}
.new-workspace-btn svg { width: 16px; height: 16px; }

.sidebar-section-label {
  margin: 22px 10px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.workspace-list {
  list-style: none;
  margin: 0;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  flex: 1;
}

.workspace-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 140ms ease;
  position: relative;
}
.workspace-item:hover { background: var(--surface-muted); }

.workspace-item.active {
  background: var(--accent-soft);
}
.workspace-item.active .wi-name { color: var(--ink); font-weight: 600; }

.wi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f2f2f2;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  flex-shrink: 0;
}
.workspace-item.active .wi-icon {
  background: var(--accent);
  color: var(--accent-ink);
}
.wi-icon svg { width: 16px; height: 16px; }

.wi-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.wi-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wi-meta {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.wi-delete {
  opacity: 0;
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  padding: 4px;
  border-radius: 6px;
  transition: all 140ms ease;
}
.workspace-item:hover .wi-delete { opacity: 1; }
.wi-delete:hover { color: var(--danger); background: rgba(231,72,77,0.08); }
.wi-delete svg { width: 14px; height: 14px; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.user-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 6px 4px;
}
.user-initials {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
}

/* =========================================================
   MAIN
   ========================================================= */
.main {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--bg-dot) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  opacity: 0.55;
  z-index: 0;
}

/* TOP BAR */
.topbar {
  position: relative;
  z-index: 2;
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.topbar-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px 6px 10px;
  box-shadow: var(--shadow-soft);
  min-height: 44px;
}

.grip {
  display: inline-flex;
  padding: 4px;
  color: var(--ink-faint);
}
.grip svg { width: 18px; height: 18px; }

.topbar-title {
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
  padding-right: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.tab-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-muted);
  transition: all 160ms ease;
}
.tab-btn svg { width: 16px; height: 16px; }
.tab-btn:hover { color: var(--ink); background: var(--surface-muted); }
.tab-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.topbar-right {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 6px 4px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}
.user-chip.compact {
  padding: 0;
  font-size: 13px;
}

.icon-btn {
  background: transparent;
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: var(--ink-muted);
  transition: all 140ms ease;
}
.icon-btn:hover { background: var(--surface-muted); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* EMPTY STATE */
.empty-state {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px;
}
.empty-card {
  max-width: 460px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  box-shadow: var(--shadow-soft);
}
.empty-logo {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--surface-muted);
  display: grid; place-items: center;
  margin: 0 auto 18px;
}
.empty-card h1 {
  font-size: 22px;
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.empty-card p {
  color: var(--ink-muted);
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.5;
}

/* BUTTONS */
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: transform 120ms ease, filter 160ms ease;
}
.primary-btn:hover { filter: brightness(0.97); }
.primary-btn:active { transform: translateY(1px); }
.primary-btn svg { width: 16px; height: 16px; }

.ghost-btn {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  transition: all 140ms ease;
}
.ghost-btn:hover { background: var(--surface-muted); border-color: var(--border-strong); }

.danger-btn {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--danger);
  font-weight: 500;
  font-size: 14px;
  transition: all 140ms ease;
}
.danger-btn:hover { background: rgba(231,72,77,0.08); }

/* =========================================================
   WORKBOARD / KANBAN
   ========================================================= */
.view {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow: hidden;
  display: flex;
}

.workboard { padding: 8px 20px 20px; }

.kanban {
  display: flex;
  gap: 16px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0 20px;
  align-items: flex-start;
}

.column {
  flex: 0 0 300px;
  background: transparent;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 140px;
  max-height: 100%;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 0;
}
.column-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.column-count {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 500;
}

.column-body {
  flex: 1;
  padding: 10px 10px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 80px;
}

.column-footer {
  padding: 8px 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.add-card-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 140ms ease;
}
.add-card-btn:hover { border-color: var(--ink-soft); color: var(--ink); background: var(--surface-muted); }
.add-card-btn svg { width: 14px; height: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 12px 10px;
  cursor: grab;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  position: relative;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}
.card:active { cursor: grabbing; }

.card-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}
.card-text.empty {
  color: var(--ink-faint);
  font-style: italic;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.media-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
}
.media-badge svg { width: 12px; height: 12px; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.status-badge a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  flex-shrink: 0;
}
.status-dot-draft     { background: #cbd5e1; }
.status-dot-scheduled { background: #f59e0b; }
.status-dot-published { background: #10b981; }
.status-dot-partial   { background: #fbbf24; }
.status-dot-failed    { background: #ef4444; }
.status-dot-cancelled { background: #94a3b8; }

.card.status-failed   { border-color: #fecaca; background: #fef2f2; }
.card.status-published { border-color: #bbf7d0; }

.card-error {
  margin: 6px 0 0;
  font-size: 11px;
  color: #b91c1c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sortable-ghost {
  opacity: 0.35;
  background: var(--accent-soft) !important;
  border: 1.5px dashed var(--accent) !important;
}
.sortable-chosen { box-shadow: var(--shadow-lift); }
.sortable-drag { cursor: grabbing; }

/* =========================================================
   SCHEDULER
   ========================================================= */
.scheduler {
  padding: 8px 20px 20px;
  gap: 16px;
  align-items: stretch;
}

.staged-panel {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.panel-count {
  font-size: 11px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.panel-hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0;
  line-height: 1.4;
}

.staged-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}
.staged-list:empty::before {
  content: "Nothing staged yet. Move a card to the Staged column in Workboard.";
  display: block;
  padding: 20px 12px;
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  line-height: 1.5;
}

.staged-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: grab;
  transition: all 140ms ease;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.staged-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}
.staged-card.scheduled {
  opacity: 0.45;
  cursor: default;
}

.calendar-wrap {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 2px;
}

.view-switch {
  display: inline-flex;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.view-btn {
  background: transparent;
  border: 0;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  border-radius: 999px;
  transition: all 140ms ease;
}
.view-btn:hover { color: var(--ink); }
.view-btn.active {
  background: var(--accent);
  color: var(--accent-ink);
}

#calendar { flex: 1; min-height: 0; }

/* FullCalendar style overrides */
.fc {
  font-family: var(--font);
  --fc-border-color: var(--border);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--surface-muted);
  --fc-today-bg-color: rgba(233, 254, 105, 0.16);
  --fc-event-bg-color: var(--accent);
  --fc-event-border-color: var(--accent);
  --fc-event-text-color: var(--accent-ink);
  --fc-button-text-color: var(--ink-soft);
  --fc-button-bg-color: var(--surface);
  --fc-button-border-color: var(--border);
  --fc-button-hover-bg-color: var(--surface-muted);
  --fc-button-hover-border-color: var(--border-strong);
  --fc-button-active-bg-color: var(--ink);
  --fc-button-active-border-color: var(--ink);
  height: 100%;
}
.fc .fc-toolbar { padding: 4px 2px 10px; }
.fc .fc-toolbar-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.fc .fc-button {
  font-family: var(--font);
  font-weight: 500;
  font-size: 12.5px;
  border-radius: 999px !important;
  padding: 5px 12px;
  box-shadow: none !important;
  text-transform: capitalize;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { color: #fff; }

.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
  font-size: 12px;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 6px 8px;
}
.fc .fc-event {
  border-radius: 8px;
  padding: 3px 6px;
  font-size: 12px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.fc .fc-event:hover { filter: brightness(0.97); }
.fc .fc-timegrid-slot { height: 2.4em; }
.fc .fc-daygrid-day.fc-day-today,
.fc .fc-timegrid-col.fc-day-today { background: var(--fc-today-bg-color); }
.fc .fc-highlight { background: rgba(233, 254, 105, 0.45); }

/* =========================================================
   MODAL
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 20px;
  animation: fadeIn 180ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: slideUp 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.modal.wide { max-width: 560px; }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-soft);
}
.field > span {
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.field > span em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 400;
}
.field small { color: var(--ink-faint); font-size: 11.5px; }
.field small a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(233,254,105,0.45);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
}
.modal-footer.spaced { justify-content: space-between; }
.footer-right { display: flex; gap: 8px; }

/* MEDIA PICKER */
.media-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.media-dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 160ms ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.media-dropzone:hover {
  border-color: var(--ink-soft);
  background: var(--surface-muted);
  color: var(--ink);
}
.media-dropzone svg { width: 24px; height: 24px; color: var(--ink-muted); }
.media-dropzone small { color: var(--ink-faint); font-size: 11.5px; }

.media-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-muted);
}
.media-preview-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.media-preview-icon svg { width: 18px; height: 18px; }
.media-preview-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.media-preview-meta strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-preview-meta span { font-size: 11.5px; color: var(--ink-faint); }

/* =========================================================
   CONTEXT MENU (calendar event right-click)
   ========================================================= */
.ctx-menu {
  position: fixed;
  z-index: 60;
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  padding: 4px;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  animation: ctxIn 120ms ease;
}
@keyframes ctxIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ctx-item {
  appearance: none;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  transition: background 120ms ease, color 120ms ease;
}
.ctx-item:hover,
.ctx-item:focus-visible {
  background: var(--surface-muted);
  color: var(--ink);
  outline: none;
}
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover,
.ctx-item.danger:focus-visible {
  background: rgba(231, 72, 77, 0.08);
  color: var(--danger);
}

/* scrollbars */
.kanban::-webkit-scrollbar,
.column-body::-webkit-scrollbar,
.workspace-list::-webkit-scrollbar,
.staged-list::-webkit-scrollbar { height: 8px; width: 8px; }
.kanban::-webkit-scrollbar-thumb,
.column-body::-webkit-scrollbar-thumb,
.workspace-list::-webkit-scrollbar-thumb,
.staged-list::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 999px; }
.kanban::-webkit-scrollbar-thumb:hover,
.column-body::-webkit-scrollbar-thumb:hover,
.workspace-list::-webkit-scrollbar-thumb:hover,
.staged-list::-webkit-scrollbar-thumb:hover { background: #c9c9c9; }

/* Responsive-ish */
@media (max-width: 900px) {
  .app { grid-template-columns: 0 1fr; }
  .sidebar { position: absolute; top: 0; bottom: 0; left: 0; width: 280px; transform: translateX(-100%); }
  .app.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-modal); }
  .scheduler { flex-direction: column; }
  .staged-panel { width: auto; max-height: 220px; }
}
