#sidebar-project-card {
  margin-top: 16px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0;
}

#sidebar-project-card .draft-top {
  display: block;
}

#sidebar-project-card .draft-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 12px;
}

#sidebar-project-card .draft-title-row {
  display: block;
  margin: 0;
  padding: 0;
  justify-content: center;
  width: 100%;
}

#sidebar-project-card .draft-meta {
  align-items: center;
  text-align: center;
  width: 100%;
}

#sidebar-project-card .draft-title {
  word-break: keep-all;
}

#sidebar-project-card .sidebar-card-title {
  margin: 10px 0 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text);
  white-space: normal;
  word-break: break-word;
  text-align: left;
  width: 100%;
  align-self: flex-start;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#sidebar-stage-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}

#sidebar-stage-actions .btn-secondary {
  width: 100%;
  justify-content: center;
  color: var(--text);
}

#sidebar-project-card .sidebar-card-lines {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  white-space: pre-line;
  word-break: break-word;
  text-align: left;
  width: 100%;
  display: block;
  line-height: 1.7;
}

#sidebar-project-card .sidebar-card-lines .sidebar-card-project {
  color: #6fb8ff;
  font-weight: 700;
}

#sidebar-project-card .sidebar-card-lines .sidebar-card-series {
  color: #89c5ff;
  font-weight: 700;
}

#sidebar-project-card .sidebar-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 16px;
}

#sidebar-project-card .sidebar-card-actions .btn-secondary {
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

[data-theme="light"] #sidebar-stage-actions .btn-secondary,
[data-theme="light"] #sidebar-project-card .sidebar-card-actions .btn-secondary {
  color: #0b0f1c;
}

#sidebar-project-card .sidebar-card-actions .btn-secondary.active {
  background: linear-gradient(135deg, #ff7a00, #ff9f3a);
  color: #0b0b0b;
  border-color: rgba(255, 122, 0, 0.6);
}

.sidebar.has-project-selection .nav {
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

body.layout-fixed .sidebar.has-project-selection #sidebar-project-card {
  grid-row: 3;
}

body.layout-fixed .sidebar.has-project-selection .nav {
  grid-row: 2;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

body.layout-fixed .sidebar.has-project-selection .nav::-webkit-scrollbar {
  display: none;
}

.draft-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  justify-content: flex-start;
  align-content: flex-start;
}

.series-filter-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 8px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, rgba(255, 140, 0, 0.42) 70%, var(--border) 30%);
  background:
    radial-gradient(circle at top right, rgba(255, 152, 59, 0.18), transparent 34%),
    linear-gradient(145deg, color-mix(in srgb, var(--panel) 88%, rgba(255, 140, 0, 0.12) 12%), color-mix(in srgb, var(--bg-2) 90%, rgba(255, 140, 0, 0.1) 10%));
  box-shadow: 0 16px 34px rgba(255, 140, 0, 0.1);
}

.series-filter-main {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.series-chip {
  cursor: pointer;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, rgba(255, 255, 255, 0.18) 28%);
  background: color-mix(in srgb, var(--panel) 76%, transparent 24%);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.series-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 140, 0, 0.38);
  box-shadow: 0 12px 24px rgba(255, 140, 0, 0.08);
}

.series-chip[data-series-id]:not([data-series-id="__all__"]) {
  color: #78bfff;
}

.series-chip[data-series-id]:not([data-series-id="__all__"]):hover,
.series-chip[data-series-id]:not([data-series-id="__all__"]):focus-visible {
  color: #9fd5ff;
}

.series-filter-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
}

.series-filter-title-block {
  display: grid;
  gap: 6px;
}

.series-filter-eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.series-filter-title {
  font-size: 22px;
  line-height: 1.15;
}

.series-filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.series-create-btn {
  width: 84px;
  height: 84px;
  min-width: 84px;
  padding: 0;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  align-self: center;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(255, 122, 0, 0.28);
}

.series-chip.active {
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.3), rgba(255, 159, 58, 0.24));
  border-color: rgba(255, 122, 0, 0.72);
  color: var(--text);
  box-shadow: 0 14px 28px rgba(255, 140, 0, 0.16);
}

/* Shell-specific visibility rules for dashboard card actions */
html.page-shell-brand .draft-card .draft-actions,
body.page-shell-brand .draft-card .draft-actions { display: none !important; }
html.page-shell-brand .draft-card .edit-btn,
body.page-shell-brand .draft-card .edit-btn { display: inline-flex !important; }
html.page-shell-brand .draft-card .trash-btn,
body.page-shell-brand .draft-card .trash-btn { display: inline-flex !important; }

html.page-shell-video .draft-card .trash-btn,
body.page-shell-video .draft-card .trash-btn { display: inline-flex !important; }
html.page-shell-video .draft-card .edit-btn,
body.page-shell-video .draft-card .edit-btn { display: inline-flex !important; }
html.page-shell-video .draft-card .draft-actions,
body.page-shell-video .draft-card .draft-actions { display: block !important; }

html.page-shell-image .draft-card .draft-actions,
body.page-shell-image .draft-card .draft-actions,
html.page-shell-image .draft-card .edit-btn,
body.page-shell-image .draft-card .edit-btn,
html.page-shell-image .draft-card .trash-btn,
body.page-shell-image .draft-card .trash-btn { display: none !important; }

.series-chip[data-series-id]:not([data-series-id="__all__"]).active {
  color: #b8e0ff;
}

[data-theme="light"] .series-chip[data-series-id]:not([data-series-id="__all__"]) {
  color: #1e3a8a;
}

[data-theme="light"] .series-chip[data-series-id]:not([data-series-id="__all__"]):hover,
[data-theme="light"] .series-chip[data-series-id]:not([data-series-id="__all__"]):focus-visible {
  color: #1d4ed8;
}

[data-theme="light"] .series-chip[data-series-id]:not([data-series-id="__all__"]).active {
  color: #0f2f74;
}

.series-manage-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 78%, transparent 22%);
}

.series-manage-label {
  color: var(--muted);
  font-size: 13px;
  margin-right: 4px;
}

.btn-secondary.compact {
  padding: 8px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-secondary.compact.danger {
  border-color: rgba(255, 96, 73, 0.45);
  color: #b83a27;
  background: rgba(255, 96, 73, 0.08);
}

[data-theme="dark"] .btn-secondary.compact.danger {
  color: #ffb3a5;
}

.btn-secondary.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.draft-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.draft-card:hover {
  transform: none;
  border-color: rgba(255, 140, 0, 0.38);
}

.draft-card.is-selected {
  border-color: rgba(255, 140, 0, 0.78);
  box-shadow: 0 20px 40px rgba(255, 140, 0, 0.16);
  background: linear-gradient(
    160deg,
    color-mix(in srgb, rgba(255, 140, 0, 0.16) 75%, transparent 25%),
    color-mix(in srgb, var(--panel) 92%, var(--bg-2) 8%)
  );
}

.draft-top {
  display: flex;
  gap: 16px;
}

.draft-info {
  min-width: 0;
  flex: 1 1 auto;
}

.draft-thumb {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 122, 0, 0.18), rgba(11, 191, 165, 0.18));
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.draft-title {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
  line-height: 28px;
}

.draft-title-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-right: 88px;
}

.draft-title.editing {
  border-bottom: 1px dashed var(--border);
  outline: none;
}

.inline-trash {
  margin-left: auto;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  color: var(--text);
}
.inline-trash:hover {
  transform: translateY(-1px);
}

.edit-btn {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, rgba(255, 255, 255, 0.12) 22%);
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 159, 63, 0.2), transparent 48%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 82%, rgba(255, 255, 255, 0.03) 18%), color-mix(in srgb, var(--bg-2) 92%, rgba(255, 255, 255, 0.02) 8%));
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.edit-btn::before {
  content: '';
  width: 22px;
  height: 22px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14.14 5.86a2 2 0 0 1 2.83 0l1.17 1.17a2 2 0 0 1 0 2.83l-8.8 8.8-3.66.83.83-3.66 8.8-8.8Z' stroke='%23AEB7C7' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m13 7 4 4' stroke='%23AEB7C7' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.9;
}

.edit-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 140, 0, 0.4);
  box-shadow:
    0 16px 30px rgba(255, 122, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.edit-btn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M14.14 5.86a2 2 0 0 1 2.83 0l1.17 1.17a2 2 0 0 1 0 2.83l-8.8 8.8-3.66.83.83-3.66 8.8-8.8Z' stroke='%23F5F7FD' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m13 7 4 4' stroke='%23F5F7FD' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.edit-btn.top-right {
  position: absolute;
  top: 12px;
  right: 52px;
  z-index: 2;
}

.draft-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
}

.draft-meta-project {
  color: #6fb8ff;
  font-size: 15px;
  font-weight: 700;
}

.draft-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.draft-actions .btn-primary,
.draft-actions .btn-secondary {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.9), rgba(255, 110, 0, 0.9));
  color: #0b0f1c;
  border: 1px solid rgba(255, 140, 0, 0.35);
  box-shadow: 0 6px 14px rgba(255, 140, 0, 0.25);
}

.draft-actions .btn-primary:hover,
.draft-actions .btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(255, 140, 0, 0.35);
}

[data-theme="light"] .draft-actions .btn-primary,
[data-theme="light"] .draft-actions .btn-secondary {
  color: #0b0f1c;
  border-color: rgba(255, 140, 0, 0.4);
}

[data-theme="dark"] .draft-actions .btn-primary,
[data-theme="dark"] .draft-actions .btn-secondary {
  color: #0b0f1c;
}

.draft-actions .action-trash {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--layer-soft);
  color: var(--text);
  cursor: pointer;
}
.draft-actions .action-trash:hover {
  transform: translateY(-1px);
}

.trash-btn {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 78%, rgba(255, 255, 255, 0.12) 22%);
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 159, 63, 0.2), transparent 48%),
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 82%, rgba(255, 255, 255, 0.03) 18%), color-mix(in srgb, var(--bg-2) 92%, rgba(255, 255, 255, 0.02) 8%));
  cursor: pointer;
  color: var(--muted);
  font-size: 0;
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.trash-btn::before {
  content: '';
  width: 22px;
  height: 22px;
  display: block;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 4.75h6l.6 1.5H19a.75.75 0 0 1 0 1.5h-.66l-.8 10.05A2.25 2.25 0 0 1 15.29 20H8.71a2.25 2.25 0 0 1-2.24-2.2l-.81-10.05H5a.75.75 0 0 1 0-1.5h3.4L9 4.75Z' stroke='%23AEB7C7' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10 10v5.25M14 10v5.25' stroke='%23AEB7C7' stroke-width='1.45' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.9;
  flex: 0 0 auto;
}

.trash-btn:hover {
  border-color: rgba(255, 140, 0, 0.4);
  box-shadow:
    0 16px 30px rgba(255, 122, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.trash-btn:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 4.75h6l.6 1.5H19a.75.75 0 0 1 0 1.5h-.66l-.8 10.05A2.25 2.25 0 0 1 15.29 20H8.71a2.25 2.25 0 0 1-2.24-2.2l-.81-10.05H5a.75.75 0 0 1 0-1.5h3.4L9 4.75Z' stroke='%23F5F7FD' stroke-width='1.45' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M10 10v5.25M14 10v5.25' stroke='%23F5F7FD' stroke-width='1.45' stroke-linecap='round'/%3E%3C/svg%3E");
}

.trash-btn.top-right {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.empty-project-card {
  position: relative;
  height: 260px;
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.empty-project-card .empty-card-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.empty-project-card .plus-icon {
  font-size: 120px;
  color: var(--muted);
}

.empty-project-card:hover {
  border-color: rgba(255, 122, 0, 0.6);
}
