:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #6366f1; /* Vibrant Indigo */
  --accent-strong: #4f46e5;
  --gold: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.05), 0 8px 10px -6px rgba(99, 102, 241, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.sr-only {
  clip: rect(0 0 0 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.topbar {
  align-items: center;
  background: linear-gradient(135deg, #09090e 0%, #111827 55%, #1e1b4b 100%);
  color: white;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 72px;
  padding: 16px clamp(18px, 5vw, 48px);
  border-bottom: 2.5px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.logo-container {
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.logo-container h1 {
  background: linear-gradient(135deg, #a5b4fc 0%, #c084fc 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  margin: 0;
}

.logo-container:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.logo-container:active {
  transform: translateY(0);
}

.topbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.nav-group {
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  display: flex;
  gap: 4px;
  padding: 4px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.command-search {
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #94a3b8;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(200px, 320px) auto;
  min-height: 40px;
  padding: 0 12px;
  transition: all 0.2s ease;
}

.command-search:focus-within {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.command-search input {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: white;
  min-height: 34px;
  padding: 0;
}

.command-search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.command-search input:focus {
  box-shadow: none;
}

.command-search kbd {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 6px;
}

.nav-label {
  color: #818cf8;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-link {
  align-items: center;
  background: transparent;
  border-radius: 6px;
  color: #e2e8f0;
  display: inline-flex;
  font-weight: 600;
  font-size: 0.85rem;
  min-height: 32px;
  padding: 0 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.header-link svg {
  margin-right: 6px;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.header-link.icon-only svg {
  margin-right: 0;
}

.header-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.header-link:hover svg {
  transform: translateY(-1px);
}

.user-profile img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.eyebrow {
  color: #34d399; /* Glowing Green */
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.2);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0;
}

.shell {
  display: grid;
  gap: 24px;
  grid-template-columns: 280px 1fr;
  padding: 24px clamp(16px, 4vw, 48px) 48px;
  transition: grid-template-columns 180ms ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: 1fr;
  padding-left: clamp(14px, 4vw, 38px);
}

.panel,
.workspace {
  background: var(--panel);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.04), 0 2px 8px rgba(99, 102, 241, 0.02);
}

.sidebar {
  align-self: start;
  max-height: calc(100vh - 154px);
  overflow: auto;
  padding: 16px;
  position: sticky;
  top: 18px;
  transition: padding 180ms ease;
}

.section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sidebar-heading {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.section-title h2 {
  font-size: 1rem;
  margin: 0;
}

.section-title span {
  background: #e8efeb;
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 9px;
}

.sidebar-toggle {
  min-height: 32px;
  min-width: 32px;
}

.shell.sidebar-collapsed .sidebar {
  background: transparent;
  border: 0;
  box-shadow: none;
  height: 0;
  left: 0;
  overflow: hidden;
  padding: 0;
  position: fixed;
  top: 138px;
  width: 0;
  z-index: 20;
}

.shell.sidebar-collapsed .section-title {
  display: block;
  margin: 0;
}

.shell.sidebar-collapsed .sidebar-heading {
  display: block;
}

.shell.sidebar-collapsed .section-title h2,
.shell.sidebar-collapsed .section-title span,
.shell.sidebar-collapsed .project-list,
.shell.sidebar-collapsed .project-item span {
  display: none;
}

.shell.sidebar-collapsed .sidebar-toggle {
  border-radius: 0 8px 8px 0;
  box-shadow: 0 10px 30px rgba(23, 33, 29, 0.16);
  height: 48px;
  left: 0;
  min-height: 48px;
  min-width: 36px;
  position: fixed;
  top: 138px;
}

.project-list {
  display: grid;
  gap: 8px;
}

.project-item {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 5px;
  padding: 12px;
  text-align: left;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.project-item-top {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.project-title-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.project-color-dot {
  border-radius: 999px;
  flex: 0 0 auto;
  height: 9px;
  width: 9px;
}

.project-color-dot.success { background: #22c55e; }
.project-color-dot.warning { background: #f59e0b; }
.project-color-dot.danger { background: #ef4444; }
.project-color-dot.neutral { background: #94a3b8; }

.project-item-meta {
  align-items: center;
  font-size: 0.8rem;
}

.sidebar-empty {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 12px;
}

.mini-status {
  background: #f1f5f9;
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 700;
  padding: 3px 8px;
  border: 1px solid #e2e8f0;
}

.workspace {
  min-height: calc(100vh - 154px);
  outline: none;
  overflow: hidden;
}

.workspace:focus {
  border-color: #9ecbc1;
}

.empty-state {
  display: grid;
  justify-items: center;
  text-align: center;
  margin: auto;
  max-width: 480px;
  padding: 80px 32px;
  background: white;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
}

.empty-state h2 {
  font-size: 1.5rem;
  color: var(--ink);
  margin-bottom: 12px;
}

.empty-state p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.project-shell {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 300px; /* 70/30 split roughly, but strictly 1fr and 300px sidebar */
  align-items: stretch;
  padding: 24px;
}

.project-main {
  min-width: 0;
  display: grid;
  gap: 18px;
}

.breadcrumb {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.82rem;
  gap: 8px;
}

.breadcrumb span::after {
  color: #b7c3bd;
  content: "/";
  margin-left: 8px;
}

.breadcrumb strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.project-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 190px);
}

.project-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-head h2 {
  font-size: clamp(2rem, 4vw, 2.5rem); /* 36-40px equivalent */
  font-weight: 800;
  margin-bottom: 0;
  color: var(--ink);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.project-overview .breadcrumb {
  font-size: 0.7rem;
  gap: 5px;
  line-height: 1.15;
}

.project-overview .project-kicker {
  font-size: 0.7rem;
  gap: 6px;
  line-height: 1.15;
}

.project-overview .project-subtitle {
  display: none;
}

.project-overview .project-head {
  align-items: center;
  display: grid;
  gap: 5px 10px;
  grid-template-columns: minmax(180px, 1fr) auto;
}

.project-overview .project-kicker,
.project-overview .quick-actions {
  grid-column: 2;
  justify-self: end;
}

.project-overview .project-head h2 {
  grid-row: 1 / span 2;
  justify-self: start;
}

.project-overview .quick-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.project-overview .project-kicker {
  justify-content: flex-end;
}

.project-overview .quick-actions .primary,
.project-overview .quick-actions .secondary,
.project-overview .quick-actions .danger {
  font-size: 0.78rem;
  min-height: 30px;
  padding: 0 9px;
}

.project-overview .status-badge,
.project-overview .deploy-pill {
  font-size: 0.66rem;
  padding: 3px 7px;
}

.project-subtitle {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 4px;
  margin-bottom: 4px;
}

.project-kicker {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.85rem;
  gap: 12px;
  margin-bottom: 0;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.quick-link {
  text-decoration: none;
}

.status-badge {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border: 1px solid transparent;
}

.status-badge::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.neutral {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}
.status-badge.neutral::before { background: #94a3b8; }

.status-badge.info {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.status-badge.info::before { background: #0ea5e9; }

.status-badge.progress {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}
.status-badge.progress::before { background: #8b5cf6; }

.status-badge.warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.status-badge.warning::before { background: #fbbf24; }

.status-badge.danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.status-badge.danger::before { background: #ef4444; }

.status-badge.success {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}
.status-badge.success::before { background: #10b981; }

.progress-wrap {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, 280px) auto;
  margin-top: 8px;
}

.progress-track {
  background: #e2e8f0;
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
}

.progress-track span {
  background: var(--accent);
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.project-head p,
.markdown-body p {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 10px;
  max-width: 760px;
  overflow-wrap: anywhere;
}

.repo-link {
  align-items: center;
  background: #e9f2ef;
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 800;
  min-height: 32px;
  padding: 0 11px;
  text-decoration: none;
}

.repo-link:hover {
  background: #dbece7;
}

.head-actions,
.image-actions,
.dialog-actions,
.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-action {
  min-height: 34px;
  padding: 0 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 8px;
  width: fit-content;
}

.tab-toolbar {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.add-images-button {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 7px;
}

.add-images-button span {
  align-items: center;
  background: var(--accent);
  border-radius: 6px;
  color: white;
  display: inline-flex;
  font-size: 0.95rem;
  height: 22px;
  justify-content: center;
  line-height: 1;
  width: 22px;
}

.tab-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 36px;
  padding: 0 16px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-button.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.tab-button:not(.active):hover {
  background: #e2e8f0;
  color: var(--ink);
}

.tab-panel {
  display: grid;
  gap: 14px;
}


.content-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.card-head {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.notes-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 430px;
}

.clipboard-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.autosave-status {
  align-items: center;
  background: #eef7f4;
  border: 1px solid #cfe4de;
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  min-height: 32px;
  padding: 0 10px;
}

.autosave-status[data-tone="saving"] {
  background: #fff3db;
  border-color: #efd5a7;
  color: #865a18;
}

.autosave-status[data-tone="error"] {
  background: #f7e9e9;
  border-color: #edcaca;
  color: var(--danger);
}

.notes-clipboard {
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(23, 33, 29, 0.05) 36px) border-box;
  border: 1px solid #d7e1dc;
  border-radius: 10px;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 340px;
  padding: 18px;
  resize: vertical;
  width: 100%;
}

.notes-clipboard:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 93, 0.14);
}

.card-head h3,
.content-card h3 {
  font-size: 1.08rem;
  margin: 0;
}

.eyebrow.dark {
  color: var(--accent-strong);
}

.markdown-body {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
  max-width: 920px;
  overflow-wrap: anywhere;
}

.note-sections {
  display: grid;
  gap: 10px;
}

.note-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.note-section summary {
  background: #f7faf8;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
  padding: 14px 16px;
}

.note-section summary::-webkit-details-marker {
  display: none;
}

.note-section summary::after {
  color: var(--accent);
  content: "+";
  float: right;
  font-weight: 900;
}

.note-section[open] summary::after {
  content: "-";
}

.note-section .markdown-body {
  padding: 16px;
}

.markdown-body h3,
.markdown-body h4,
.markdown-body h5 {
  color: var(--ink);
  line-height: 1.25;
  margin: 22px 0 8px;
}

.markdown-body h3:first-child,
.markdown-body h4:first-child,
.markdown-body h5:first-child,
.markdown-body p:first-child {
  margin-top: 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 10px 0 14px;
  padding-left: 22px;
}

.markdown-body li {
  margin: 7px 0;
}

.markdown-body code {
  background: #eef1ef;
  border-radius: 5px;
  color: var(--ink);
  padding: 2px 5px;
}

.markdown-body pre {
  background: #12251f;
  border-radius: 8px;
  color: white;
  overflow: auto;
  padding: 14px;
}

.markdown-table {
  overflow: auto;
}

.markdown-table table {
  border-collapse: collapse;
  min-width: 100%;
}

.markdown-table th,
.markdown-table td {
  border: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
}

.markdown-table th {
  background: #f7faf8;
  color: var(--ink);
}

.upload-panel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.paste-zone {
  align-items: center;
  background: #f7faf8;
  border: 1px dashed #9ecbc1;
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  outline: none;
  padding: 14px;
}

.paste-zone:focus,
.paste-zone:hover {
  background: #eef7f4;
  border-color: var(--accent);
}

.paste-zone div {
  display: grid;
  gap: 4px;
}

.paste-zone strong {
  font-size: 0.95rem;
}

.paste-zone span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.paste-status {
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong) !important;
  flex: 0 0 auto;
  font-weight: 800;
  padding: 5px 10px;
}

.upload-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 180px;
}

.file-upload-panel .upload-grid {
  grid-template-columns: 230px 1fr;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.82rem;
  font-weight: 700;
  gap: 7px;
}

input,
textarea,
select {
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  color: var(--ink);
  outline: none;
  padding: 10px 11px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.primary,
.secondary,
.ghost,
.danger,
.icon-button {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 39px;
  padding: 0 14px;
}

.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
  transition: all 0.2s ease;
}

.primary:hover {
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}

.secondary {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
}
.secondary:hover {
  background: #e0e7ff;
  color: #4338ca;
}

.ghost {
  background: #eef1ef;
  color: var(--ink);
}

.danger {
  background: #f7e9e9;
  color: var(--danger);
}

.icon-button {
  background: #eef1ef;
  color: var(--ink);
  min-width: 39px;
  padding: 0;
}

.gallery {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  padding: 0;
}

.file-grid {
  display: grid;
  gap: 12px;
}

.file-card {
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  padding: 14px;
}

.file-icon {
  align-items: center;
  background: #e9f2ef;
  border-radius: 8px;
  color: var(--accent-strong);
  display: flex;
  font-size: 0.78rem;
  font-weight: 950;
  height: 58px;
  justify-content: center;
  width: 58px;
}

.file-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.file-info a {
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.file-info a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.file-info span,
.file-info p {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
  margin: 0;
}

.file-info em {
  background: #fff3db;
  border-radius: 999px;
  color: #865a18;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 850;
  justify-self: start;
  padding: 4px 8px;
}

.compact-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  max-width: none;
  padding: 34px 22px;
}


.activity-list {
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.activity-list li {
  border-left: 3px solid #9ecbc1;
  padding-left: 12px;
}

.activity-list span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.activity-list strong {
  display: block;
  margin-bottom: 4px;
}

.activity-list p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.image-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.image-card img {
  aspect-ratio: 4 / 3;
  background: #dde5e1;
  display: block;
  object-fit: cover;
  width: 100%;
}

.image-meta {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.badge {
  background: #fff3db;
  border-radius: 999px;
  color: #865a18;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  justify-self: start;
  padding: 4px 8px;
}

.description {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  min-height: 40px;
  overflow-wrap: anywhere;
}

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 520px;
  padding: 0;
  width: min(calc(100vw - 28px), 520px);
}

dialog::backdrop {
  background: rgba(10, 20, 17, 0.45);
}

.dialog-form {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.progress-field {
  grid-column: 1 / -1;
}

.dialog-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.dialog-head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.toast {
  background: #12251f;
  border-radius: 8px;
  bottom: 18px;
  color: white;
  left: 50%;
  padding: 11px 14px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 10;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.stat-card-title {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-card-title svg {
  opacity: 0.6;
}

.stat-card-value {
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.stat-card-trend {
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-card-trend.positive { color: var(--accent); }
.stat-card-trend.negative { color: var(--danger); }
.stat-card-trend.neutral { color: var(--muted); }

.metadata-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: grid;
  gap: 16px;
  flex: 1;
  min-height: 100%;
  align-content: start;
}

.metadata-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metadata-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metadata-value {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.metadata-value a {
  color: var(--accent);
  text-decoration: none;
}
.metadata-value a:hover {
  text-decoration: underline;
}

.sidebar-actions {
  display: grid;
  gap: 10px;
}

.sidebar-actions button {
  width: 100%;
}

.tab-button {
  cursor: pointer;
}

.stat-card {
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.metadata-card-head,
.rail-card-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.rail-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.text-button {
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 850;
  padding: 0;
}

.rail-timeline {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-timeline li {
  border-left: 2px solid #d8e7e2;
  display: grid;
  gap: 3px;
  padding-left: 10px;
}

.rail-timeline span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.rail-timeline strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.rail-timeline p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.avatar-row {
  display: flex;
  gap: 8px;
}

.avatar-row span,
.avatar-row button {
  align-items: center;
  background: #e9f2ef;
  border: 1px solid #d3e4de;
  border-radius: 999px;
  color: var(--accent-strong);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

/* Compact workspace pass */
.shell {
  gap: 14px;
  padding: 14px clamp(10px, 2vw, 28px) 22px;
}

.workspace {
  min-height: calc(100vh - 124px);
}

.project-shell {
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) 280px;
  min-height: calc(100vh - 124px);
  padding: 14px;
}

.project-shell.operations-collapsed {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.project-shell.operations-collapsed .metadata-card,
.project-shell.operations-collapsed .sidebar-actions,
.project-shell.operations-collapsed .rail-card {
  display: none;
}

.project-shell.operations-collapsed .project-sidebar {
  min-height: auto;
}

.operations-toggle {
  align-items: center;
  background: #eef7f4;
  border: 1px solid #d3e4de;
  border-radius: 8px;
  color: var(--accent-strong);
  display: inline-flex;
  font-weight: 900;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.project-main,
.project-head {
  gap: 7px;
}

.project-main {
  align-content: stretch;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: calc(100vh - 152px);
  position: relative;
  transition: gap 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.project-overview {
  display: grid;
  gap: 4px;
  max-height: 560px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition:
    max-height 320ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 220ms ease,
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: max-height, opacity, transform;
}

.project-overview-bar {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  min-height: 28px;
}

.project-overview-summary {
  display: none;
}

.project-overview-summary strong {
  color: var(--ink);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-overview-summary span {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 7px;
}

.overview-toggle {
  align-items: center;
  background: #eef7f4;
  border: 1px solid #d3e4de;
  border-radius: 8px;
  color: var(--accent-strong);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 900;
  min-height: 28px;
  padding: 0 8px;
}

.overview-restore-button {
  background: #eef7f4;
  border: 1px solid #d3e4de;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(23, 33, 29, 0.12);
  color: var(--accent-strong);
  display: none;
  font-size: 0.78rem;
  font-weight: 900;
  min-height: 34px;
  opacity: 0;
  padding: 0 11px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  transform: translateY(-6px);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 3;
}

.project-overview-body {
  display: grid;
  gap: 5px;
}

.project-shell.project-overview-collapsed .project-overview {
  display: none;
  pointer-events: none;
}

.project-shell.project-overview-collapsed .project-main {
  gap: 10px;
  grid-template-rows: auto minmax(0, 1fr);
}

.project-shell.project-overview-collapsed .overview-restore-button {
  display: inline-flex;
  justify-self: end;
  opacity: 1;
  pointer-events: auto;
  position: static;
  transform: translateY(0);
}

.project-shell.project-overview-collapsed .tab-panel {
  align-self: stretch;
  min-height: 100%;
}

.project-shell.project-overview-collapsed .focus-card {
  min-height: calc(100vh - 154px);
  padding-top: 16px;
}

.project-shell.project-overview-collapsed .notes-clipboard {
  min-height: calc(100vh - 292px);
}

.project-head h2 {
  font-size: clamp(1.05rem, 1.6vw, 1.28rem);
  line-height: 1.1;
}

.quick-actions {
  gap: 4px;
}

.primary,
.secondary,
.ghost,
.danger,
.icon-button {
  min-height: 34px;
  padding: 0 11px;
}

.stats-grid {
  gap: 6px;
  margin-bottom: 2px;
}

.stat-card {
  align-items: center;
  display: grid;
  gap: 2px 8px;
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  min-height: 42px;
  padding: 6px 9px;
}

.stat-card-title {
  font-size: 0.62rem;
  grid-column: 1;
}

.stat-card-value {
  font-size: 0.92rem;
  grid-column: 1;
}

.stat-card-trend {
  font-size: 0.66rem;
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-self: end;
  text-align: right;
}

.tabs {
  margin: 0;
  padding: 3px;
}

.tab-button {
  font-size: 0.8rem;
  min-height: 28px;
  padding: 0 9px;
}

.content-card,
.upload-panel {
  padding: 12px;
}

.image-upload-form {
  clip-path: inset(50%);
  height: 1px;
  margin: 0;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.advanced-upload {
  border: 1px solid #dbe7e2;
  border-radius: 8px;
  padding: 8px 10px;
}

.advanced-upload summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  list-style: none;
}

.advanced-upload summary::-webkit-details-marker {
  display: none;
}

.advanced-upload summary::after {
  content: "+";
  float: right;
}

.advanced-upload[open] summary {
  margin-bottom: 10px;
}

.advanced-upload[open] summary::after {
  content: "-";
}

.paste-zone {
  padding: 10px 12px;
}

.upload-grid {
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 160px;
}

input,
textarea,
select {
  padding: 8px 10px;
}

.image-list {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: auto;
}

.image-list-header,
.image-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 2fr) 130px 110px 80px minmax(160px, 1.3fr) auto;
  min-width: 860px;
}

.image-list-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  min-height: 32px;
  padding: 0 10px;
}

.image-row {
  border-bottom: 1px solid #eef2f7;
  color: var(--muted);
  font-size: 0.8rem;
  min-height: 38px;
  padding: 5px 10px;
}

.image-row:last-child {
  border-bottom: 0;
}

.image-row:hover {
  background: #eff6ff;
}

.image-name-cell {
  align-items: center;
  color: var(--ink);
  display: flex;
  gap: 8px;
  min-width: 0;
}

.image-name-cell strong {
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-type-icon {
  align-items: center;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  color: #1d4ed8;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.64rem;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.image-row-tags {
  align-items: center;
  display: flex;
  gap: 6px;
  min-width: 0;
}

.image-row-tags b,
.image-row-tags em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-row-tags b {
  background: #fff3db;
  border-radius: 999px;
  color: #865a18;
  flex: 0 0 auto;
  font-size: 0.68rem;
  padding: 2px 7px;
}

.image-row-tags em {
  color: var(--muted);
  font-style: normal;
}

.image-row-actions {
  display: flex;
  gap: 4px;
  justify-content: end;
}

.image-row-actions .secondary,
.image-row-actions .danger {
  font-size: 0.72rem;
  min-height: 26px;
  padding: 0 8px;
}

.image-empty-state {
  justify-items: start;
  min-height: 96px;
  text-align: left;
}

.image-preview-modal {
  align-items: center;
  background: rgba(8, 15, 12, 0.72);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 22px;
  position: fixed;
  z-index: 1000;
}

.image-preview-panel {
  background: white;
  border-radius: 10px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: 92vh;
  max-width: min(1180px, 94vw);
  overflow: hidden;
  width: 100%;
}

.image-preview-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.image-preview-head div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.image-preview-head strong,
.image-preview-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-preview-head span {
  color: var(--muted);
  font-size: 0.84rem;
}

.image-preview-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.image-preview-body {
  align-items: center;
  background: #0f172a;
  display: flex;
  justify-content: center;
  min-height: 360px;
  overflow: auto;
  padding: 12px;
}

.image-preview-body img {
  display: block;
  max-height: calc(92vh - 74px);
  max-width: 100%;
  object-fit: contain;
}

/* Persistent app navigation */
.shell {
  align-items: stretch;
  gap: 0;
  grid-template-columns: 320px minmax(0, 1fr);
  padding: 0 18px 24px 0;
}

.shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
  padding-left: 0;
}

.sidebar {
  align-self: stretch;
  background: #f8fafc;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: none;
  min-height: calc(100vh - 72px);
  overflow: hidden;
  padding: 18px 14px;
  position: sticky;
  top: 0;
}

.workspace {
  margin: 16px 0 0 18px;
}

.sidebar-brand {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr) auto 34px;
}

.workspace-mark,
.workspace-avatar,
.project-avatar,
.nav-icon {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 900;
  justify-content: center;
}

.workspace-mark {
  background: linear-gradient(135deg, #10b981, #047857);
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.24);
  color: white;
  height: 38px;
  width: 38px;
}

.workspace-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workspace-copy strong,
.workspace-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-copy strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.workspace-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.workspace-count {
  background: #dff5ec;
  border-radius: 999px;
  color: #047857;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 4px 8px;
}

.sidebar-create {
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.sidebar-search {
  align-items: center;
  background: white;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 0 10px;
}

.sidebar-search:focus-within {
  border-color: rgba(16, 185, 129, 0.7);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.sidebar-search input {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 34px;
  padding: 0;
}

.sidebar-search input:focus {
  box-shadow: none;
}

.sidebar-search kbd {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  padding: 3px 5px;
}

.sidebar-filters {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.filter-chip {
  background: transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 30px;
  padding: 0 8px;
}

.filter-chip:hover,
.filter-chip.active {
  background: white;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  color: var(--ink);
}

.project-list {
  display: grid;
  flex: 1;
  gap: 10px;
  margin: 2px -4px 0;
  overflow: auto;
  padding: 0 4px 8px;
}

.nav-section {
  display: grid;
  gap: 8px;
}

.nav-section summary {
  align-items: center;
  color: #64748b;
  cursor: pointer;
  display: flex;
  font-size: 0.74rem;
  font-weight: 900;
  justify-content: space-between;
  letter-spacing: 0.04em;
  list-style: none;
  min-height: 28px;
  padding: 0 4px;
  text-transform: uppercase;
}

.nav-section summary::-webkit-details-marker {
  display: none;
}

.nav-section summary::after {
  content: ">";
  font-size: 0.72rem;
  margin-left: 8px;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.nav-section[open] summary::after {
  transform: rotate(90deg);
}

.nav-section summary b {
  background: #e2e8f0;
  border-radius: 999px;
  color: #475569;
  font-size: 0.68rem;
  margin-left: auto;
  padding: 2px 7px;
}

.nav-section-list {
  display: grid;
  gap: 7px;
}

.nav-section-empty {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0;
  padding: 7px 8px 10px;
}

.project-item {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 9px 8px;
}

.project-item:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  border-left-color: #a5b4fc;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.05);
}

.project-item:focus-visible {
  outline: 3px solid rgba(16, 185, 129, 0.22);
  outline-offset: 2px;
}

.project-item.active {
  background: #f5f3ff;
  border-color: #c7d2fe;
  border-left-color: var(--accent);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.project-avatar {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.72rem;
  height: 34px;
  width: 34px;
}

.project-avatar {
  color: white;
  font-size: 0.75rem;
  font-weight: 800;
  height: 34px;
  width: 34px;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.project-avatar.success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.project-avatar.warning { background: linear-gradient(135deg, #fbbf24, #d97706); color: white; }
.project-avatar.danger { background: linear-gradient(135deg, #f87171, #dc2626); color: white; }
.project-avatar.info { background: linear-gradient(135deg, #60a5fa, #2563eb); color: white; }
.project-avatar.progress { background: linear-gradient(135deg, #a78bfa, #7c3aed); color: white; }
.project-avatar.neutral { background: linear-gradient(135deg, #94a3b8, #475569); color: white; }

.project-item-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.project-item-top {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.project-item-top strong {
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item.active .project-item-top strong {
  color: #052e24;
}

.project-progress-mini {
  color: #047857;
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 900;
}

.project-item-meta {
  color: #64748b;
  display: block;
  font-size: 0.76rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-quick-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.project-item:hover .project-quick-actions,
.project-item:focus-visible .project-quick-actions {
  opacity: 1;
}

.project-quick-actions span {
  align-items: center;
  background: white;
  border: 1px solid #dbe4ea;
  border-radius: 6px;
  color: #64748b;
  display: inline-flex;
  font-size: 0.65rem;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.sidebar-bottom {
  border-top: 1px solid #e2e8f0;
  display: grid;
  gap: 6px;
  padding-top: 12px;
}

.sidebar-nav-item,
.workspace-switcher {
  align-items: center;
  background: transparent;
  border-radius: 8px;
  color: #334155;
  display: grid;
  font-size: 0.86rem;
  font-weight: 800;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 38px;
  padding: 0 8px;
  text-align: left;
  text-decoration: none;
}

.sidebar-nav-item:hover,
.workspace-switcher:hover {
  background: #eef6f3;
}

.sidebar-nav-item.module-link {
  color: #047857;
}

.sidebar-nav-item.module-link .nav-icon {
  background: #dff5ec;
  color: #047857;
}

.nav-icon {
  background: #e2e8f0;
  color: #475569;
  font-size: 0.68rem;
  height: 26px;
  width: 26px;
}

.workspace-switcher {
  background: white;
  border: 1px solid #dbe4ea;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  margin-top: 6px;
  min-height: 58px;
  padding: 8px;
  width: 100%;
}

.workspace-avatar {
  background: linear-gradient(135deg, #10b981, #047857);
  color: white;
  height: 34px;
  width: 34px;
}

.workspace-switcher span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.workspace-switcher strong,
.workspace-switcher small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-switcher strong {
  color: var(--ink);
  font-size: 0.83rem;
}

.workspace-switcher small {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
}

.workspace-caret {
  color: var(--muted);
  font-weight: 900;
}

.shell.sidebar-collapsed .sidebar {
  background: #f8fafc;
  border-right: 1px solid var(--line);
  height: auto;
  left: auto;
  overflow: hidden;
  padding: 18px 10px;
  position: sticky;
  top: 0;
  width: auto;
  z-index: auto;
}

.shell.sidebar-collapsed .workspace-copy,
.shell.sidebar-collapsed .workspace-count,
.shell.sidebar-collapsed .sidebar-create,
.shell.sidebar-collapsed .sidebar-search,
.shell.sidebar-collapsed .sidebar-filters,
.shell.sidebar-collapsed .project-list,
.shell.sidebar-collapsed .sidebar-nav-item span:not(.nav-icon),
.shell.sidebar-collapsed .workspace-switcher span:nth-child(2),
.shell.sidebar-collapsed .workspace-caret {
  display: none;
}

.shell.sidebar-collapsed .sidebar-brand {
  grid-template-columns: 38px;
  justify-content: center;
}

.shell.sidebar-collapsed .sidebar-toggle {
  border-radius: 8px;
  box-shadow: none;
  height: 34px;
  left: auto;
  min-height: 34px;
  min-width: 34px;
  position: static;
  top: auto;
}

.shell.sidebar-collapsed .sidebar-bottom {
  align-items: center;
  border-top: 0;
  margin-top: auto;
}

.shell.sidebar-collapsed .sidebar-nav-item,
.shell.sidebar-collapsed .workspace-switcher {
  display: flex;
  justify-content: center;
  padding: 0;
}

.shell.dashboard-mode,
.shell.dashboard-mode.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
  padding: 0 clamp(14px, 3vw, 34px) 28px;
}

.shell.dashboard-mode .sidebar {
  display: none;
}

.shell.dashboard-mode .workspace {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 16px 0 0;
  min-height: calc(100vh - 108px);
  overflow: visible;
}

.projects-dashboard {
  display: grid;
  gap: 14px;
}

.dashboard-head,
.dashboard-toolbar,
.dashboard-table-card,
.dashboard-pagination {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dashboard-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 18px;
}

.dashboard-head h2 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.1;
  margin: 0;
}

.dashboard-metrics {
  display: flex;
  gap: 10px;
}

.dashboard-metric {
  flex: 1 1 0px;
  min-width: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 14px;
  text-align: left;
}

.dashboard-metric:hover {
  border-color: #b8d8ce;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.dashboard-metric {
  background: white;
  border-radius: 12px;
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 16px;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  color: white;
}

.dashboard-metric span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-metric strong {
  font-size: 1.6rem;
  line-height: 1;
  color: white !important;
}

/* Neutral Tone (Black/Zinc Gradient) */
.dashboard-metric.neutral {
  background: linear-gradient(135deg, #3f3f46 0%, #18181b 100%);
  box-shadow: 0 10px 20px -5px rgba(24, 24, 27, 0.35);
}
.dashboard-metric.neutral:hover {
  box-shadow: 0 14px 28px -5px rgba(24, 24, 27, 0.55);
}

/* Active Tone (Cyan/Blue Gradient) */
.dashboard-metric.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.35);
}
.dashboard-metric.active:hover {
  box-shadow: 0 14px 28px -5px rgba(14, 165, 233, 0.55);
}

/* Pending Tone (Rose/Red Gradient) */
.dashboard-metric.pending {
  background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  box-shadow: 0 10px 20px -5px rgba(244, 63, 94, 0.35);
}
.dashboard-metric.pending:hover {
  box-shadow: 0 14px 28px -5px rgba(244, 63, 94, 0.55);
}

/* Completed Tone (Emerald/Teal Gradient) */
.dashboard-metric.completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.35);
}
.dashboard-metric.completed:hover {
  box-shadow: 0 14px 28px -5px rgba(16, 185, 129, 0.55);
}

.dashboard-metric:hover {
  transform: translateY(-4px);
}

.dashboard-toolbar {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1fr) auto minmax(180px, 220px) minmax(180px, 220px);
  padding: 14px;
}

.dashboard-search,
.dashboard-select {
  color: var(--muted);
  display: grid;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 850;
}
.dashboard-search input,
.dashboard-select select {
  background: white;
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 10px;
  color: var(--ink);
  min-height: 42px;
  padding: 0 14px;
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.02);
  transition: all 0.2s ease;
}
.dashboard-search input:hover,
.dashboard-select select:hover {
  border-color: var(--accent);
}
.dashboard-search input:focus,
.dashboard-select select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.dashboard-status-tabs {
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.dashboard-status-tabs button {
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  min-height: 32px;
  padding: 0 12px;
}

.dashboard-status-tabs button.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.dashboard-table-card {
  max-height: 520px;
  overflow-y: auto;
}

.projects-table,
.tasks-table {
  border-collapse: collapse;
  width: 100%;
}

.projects-table th,
.projects-table td,
.tasks-table th,
.tasks-table td {
  border-bottom: 1px solid #edf2f7;
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

.projects-table th,
.tasks-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 #edf2f7;
}

.projects-table tbody tr:hover,
.tasks-table tbody tr:hover {
  background: #fbfefd;
}

.projects-table tbody tr:last-child td,
.tasks-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-sort {
  align-items: center;
  background: transparent;
  color: inherit;
  display: inline-flex;
  font-size: inherit;
  font-weight: inherit;
  gap: 6px;
  min-height: 24px;
  padding: 0;
  text-transform: inherit;
}

.table-sort span {
  color: var(--accent-strong);
  display: inline-block;
  min-width: 8px;
}

.project-table-link {
  align-items: center;
  background: transparent;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr);
  max-width: 420px;
  padding: 0;
  text-align: left;
  width: 100%;
}

.project-table-link strong,
.project-table-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-table-link strong {
  font-size: 0.92rem;
}

.project-table-link small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  margin-top: 2px;
}

.project-table-link:hover strong {
  color: var(--accent-strong);
  text-decoration: underline;
}

.dashboard-state,
.priority-pill,
.asset-count,
.muted-cell {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
}

.dashboard-state.active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.dashboard-state.pending {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.dashboard-state.completed {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.priority-pill {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.priority-pill.urgent {
  background: #fff1f2;
  color: #e11d48;
  border-color: #fecdd3;
  box-shadow: 0 0 8px rgba(225, 29, 72, 0.1);
}

.priority-pill.high {
  background: #fff7ed;
  color: #ea580c;
  border-color: #ffedd5;
}

.priority-pill.normal {
  background: #f0fdf4;
  color: #16a34a;
  border-color: #dcfce7;
}

.priority-pill.low {
  background: #f8fafc;
  color: #64748b;
  border-color: #edf2f7;
}

.asset-count {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: var(--muted);
  margin: 2px 4px 2px 0;
}

.muted-cell {
  background: #f8fafc;
  color: var(--muted);
}

.dashboard-empty {
  align-items: center;
  display: grid;
  gap: 12px;
  justify-items: center;
  min-height: 260px;
  padding: 28px;
  text-align: center;
}

.dashboard-empty h3 {
  margin: 0;
}

.dashboard-pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.dashboard-pagination span,
.dashboard-pagination strong {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.dashboard-pagination div {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.dashboard-head-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.add-task-button {
  flex: 0 0 auto;
  gap: 0;
  min-height: 39px;
  min-width: 39px;
  padding: 0;
}

.add-task-button svg {
  display: block;
}

.dashboard-view-tabs {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.dashboard-view-tabs button {
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  width: 38px;
  padding: 0;
  transition: all 0.2s ease;
}

.dashboard-view-tabs button svg {
  display: block;
}

.dashboard-view-tabs button.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

.task-toolbar {
  grid-template-columns: minmax(240px, 1fr) auto minmax(180px, 240px);
}

.task-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  min-height: 0;
}

.task-composer,
.task-list-panel,
.calendar-panel,
.event-composer,
.calendar-agenda {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.task-composer,
.event-composer,
.calendar-agenda {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.task-form-grid,
.event-form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-list-panel {
  display: block;
  min-height: 420px;
  overflow: auto;
  padding: 0;
}

.task-composer {
  max-width: 760px;
}

.tasks-table th:first-child,
.tasks-table td:first-child {
  text-align: center;
  width: 62px;
}

.tasks-table th:last-child,
.tasks-table td:last-child {
  text-align: right;
  width: 160px;
}

.task-row.completed {
  background: #f8fafc;
}

.task-row.overdue {
  box-shadow: inset 4px 0 0 #ef4444;
}

.task-row.today {
  box-shadow: inset 4px 0 0 #10b981;
}

.task-row.upcoming {
  box-shadow: inset 4px 0 0 #3b82f6;
}

.task-row.completed {
  box-shadow: inset 4px 0 0 #22c55e;
}

.task-table-check {
  margin: 0 auto;
}

.task-table-title {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.task-table-title strong {
  overflow-wrap: anywhere;
}

.task-table-title small,
.muted-inline {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.task-row.completed .task-table-title strong {
  color: var(--muted);
  text-decoration: line-through;
}

.task-note-cell {
  color: var(--muted);
  line-height: 1.45;
  max-width: 340px;
  overflow-wrap: anywhere;
}

.task-group {
  display: grid;
  gap: 9px;
}

.task-group-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.task-group-head h3 {
  font-size: 0.9rem;
  margin: 0;
}

.task-group-head span {
  background: #f1f5f9;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 4px 8px;
}

.task-list {
  display: grid;
  gap: 8px;
}

.task-item {
  align-items: start;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  min-height: 78px;
  padding: 12px;
}

.task-item.overdue {
  border-left-color: #ef4444;
}

.task-item.today {
  border-left-color: #10b981;
}

.task-item.upcoming {
  border-left-color: #3b82f6;
}

.task-item.completed {
  background: #f8fafc;
  border-left-color: #22c55e;
}

.task-check {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  height: 26px;
  justify-content: center;
  margin-top: 1px;
  position: relative;
  width: 26px;
}

.task-check input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.task-check span {
  background: white;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  display: block;
  height: 22px;
  width: 22px;
}

.task-check input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.task-check input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}

.task-check input:checked + span::after {
  border: solid white;
  border-width: 0 2px 2px 0;
  content: "";
  display: block;
  height: 9px;
  margin: 3px 0 0 6px;
  transform: rotate(45deg);
  width: 5px;
}

.task-item-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.task-title-row,
.task-meta-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-title-row strong {
  overflow-wrap: anywhere;
}

.task-item.completed .task-title-row strong {
  color: var(--muted);
  text-decoration: line-through;
}

.task-meta-row {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.task-date-pill {
  background: #f1f5f9;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 5px 8px;
}

.task-date-pill.overdue {
  background: #fef2f2;
  color: #b91c1c;
}

.task-date-pill.today {
  background: #dcfce7;
  color: #166534;
}

.task-date-pill.upcoming {
  background: #dbeafe;
  color: #1d4ed8;
}

.task-date-pill.completed {
  background: #ecfdf5;
  color: #047857;
}

.task-item p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
}

.task-actions,
.agenda-actions,
.calendar-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.task-actions .compact-action {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
}

.calendar-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  min-height: 0;
}

.calendar-panel {
  overflow: hidden;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 10px;
  text-align: center;
  text-transform: uppercase;
}

.calendar-grid {
  background: #e2e8f0;
  gap: 1px;
}

.calendar-day {
  background: white;
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 122px;
  padding: 9px;
  text-align: left;
}

.calendar-day:hover {
  background: #fbfefd;
}

.calendar-day.outside {
  background: #f8fafc;
  color: #94a3b8;
}

.calendar-day.selected {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.calendar-day.today .calendar-day-number {
  background: var(--accent);
  color: white;
}

.calendar-day-number {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.calendar-day-items {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.calendar-pill,
.calendar-more {
  align-items: center;
  border-radius: 6px;
  display: flex;
  font-size: 0.72rem;
  font-weight: 850;
  gap: 4px;
  min-height: 22px;
  overflow: hidden;
  padding: 3px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-pill b {
  flex: 0 0 auto;
  font-size: 0.68rem;
}

.calendar-pill.info,
.calendar-pill.progress,
.calendar-pill.normal {
  background: #dbeafe;
  color: #1d4ed8;
}

.calendar-pill.success,
.calendar-pill.low {
  background: #dcfce7;
  color: #166534;
}

.calendar-pill.warning,
.calendar-pill.high {
  background: #fef3c7;
  color: #92400e;
}

.calendar-pill.danger,
.calendar-pill.urgent {
  background: #fee2e2;
  color: #991b1b;
}

.calendar-pill.task {
  border-left: 3px solid currentColor;
}

.calendar-pill.deadline {
  background: #fef2f2;
  color: #b91c1c;
}

.calendar-more {
  background: #f1f5f9;
  color: var(--muted);
}

.calendar-side {
  display: grid;
  gap: 14px;
}

.calendar-side .calendar-controls {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: space-between;
  width: 100%;
}

.calendar-side .calendar-controls button {
  flex: 1;
  justify-content: center;
  min-height: 34px;
  padding: 0 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.checkbox-field {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 9px;
}

.checkbox-field input {
  width: auto;
}

.agenda-list {
  display: grid;
  gap: 8px;
}

.agenda-item {
  align-items: start;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 11px;
}

.agenda-item.task {
  grid-template-columns: 28px minmax(0, 1fr);
}

.agenda-item.info,
.agenda-item.progress {
  border-left-color: #3b82f6;
}

.agenda-item.success {
  border-left-color: #22c55e;
}

.agenda-item.warning {
  border-left-color: #f59e0b;
}

.agenda-item.danger,
.agenda-item.deadline {
  border-left-color: #ef4444;
}

.agenda-item span {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  font-weight: 900;
  margin-bottom: 3px;
}

.agenda-item strong {
  overflow-wrap: anywhere;
}

.agenda-item p {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.agenda-item.completed strong {
  color: var(--muted);
  text-decoration: line-through;
}

.compact-dashboard-empty {
  min-height: 120px;
  padding: 16px;
}

@media (max-width: 840px) {
  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
    min-height: auto;
    padding: 18px;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .shell {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
    padding-left: 14px;
  }

  .sidebar {
    max-height: none;
    position: static;
  }

  .shell.sidebar-collapsed .sidebar,
  .shell.sidebar-collapsed .sidebar-toggle {
    top: 96px;
  }

  .workspace {
    min-height: 420px;
  }

  .project-head,
  .upload-grid,
  .paste-zone,
  .project-shell,
  .file-upload-panel .upload-grid,
  .file-card {
    grid-template-columns: 1fr;
  }

  .project-head {
    display: grid;
  }

  .project-sidebar,
  .metadata-card {
    min-height: auto;
  }

  .project-shell,
  .project-shell.operations-collapsed {
    grid-template-columns: 1fr;
  }

  .project-shell.operations-collapsed .metadata-card,
  .project-shell.operations-collapsed .sidebar-actions,
  .project-shell.operations-collapsed .rail-card {
    display: grid;
  }

  .operations-toggle {
    display: none;
  }

  .paste-zone {
    align-items: start;
    display: grid;
  }

  .header-link,
  .topbar-actions .primary {
    flex: 1 1 130px;
  }

  .nav-group {
    flex: 1 1 100%;
  }

  .command-search {
    flex: 1 1 100%;
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: auto;
    overflow: visible;
    padding: 14px;
  }

  .workspace {
    margin: 14px 0 0;
  }

  .shell.sidebar-collapsed .sidebar {
    min-height: 70px;
    padding: 12px;
  }

  .shell.sidebar-collapsed .sidebar-brand {
    grid-template-columns: 38px 34px;
    justify-content: space-between;
  }

  .shell.dashboard-mode,
  .shell.dashboard-mode.sidebar-collapsed {
    padding: 0 12px 20px;
  }

  .dashboard-head {
    align-items: stretch;
    display: grid;
  }

  .dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-toolbar {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .dashboard-status-tabs {
    overflow-x: auto;
  }

  .dashboard-status-tabs button {
    flex: 1 0 auto;
  }

  .dashboard-table-card {
    background: transparent;
    border: 0;
    overflow: visible;
    max-height: none;
  }

  .projects-table,
  .projects-table thead,
  .projects-table tbody,
  .projects-table tr,
  .projects-table td,
  .tasks-table,
  .tasks-table thead,
  .tasks-table tbody,
  .tasks-table tr,
  .tasks-table td {
    display: block;
    width: 100%;
  }

  .projects-table thead,
  .tasks-table thead {
    display: none;
  }

  .projects-table tr,
  .tasks-table tr {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
  }

  .projects-table td,
  .tasks-table td {
    align-items: center;
    border-bottom: 1px solid #edf2f7;
    display: grid;
    gap: 12px;
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 44px;
    padding: 10px 12px;
  }

  .projects-table td::before,
  .tasks-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .projects-table td:last-child,
  .tasks-table td:last-child {
    border-bottom: 0;
  }

  .project-table-link {
    max-width: none;
  }

  .dashboard-pagination {
    align-items: stretch;
    display: grid;
  }

  .dashboard-pagination div {
    justify-content: space-between;
  }

  .dashboard-head-actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .dashboard-view-tabs {
    width: 100%;
  }

  .dashboard-view-tabs button {
    flex: 1 1 0;
  }

  .task-layout,
  .task-form-grid,
  .event-form-grid,
  .calendar-layout,
  .task-toolbar {
    grid-template-columns: 1fr;
  }

  .task-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .tasks-table th:first-child,
  .tasks-table td:first-child,
  .tasks-table th:last-child,
  .tasks-table td:last-child {
    text-align: left;
    width: 100%;
  }

  .task-table-check {
    margin: 0;
  }

  .task-note-cell {
    max-width: none;
  }

  .task-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .calendar-panel {
    overflow-x: auto;
  }

  .calendar-weekdays,
  .calendar-grid {
    min-width: 720px;
  }

  .calendar-day {
    min-height: 94px;
  }

  .agenda-item,
  .agenda-item.task {
    grid-template-columns: 1fr;
  }

  .agenda-actions {
    justify-content: flex-start;
  }
}

/* Full-width workspace layout: project navigation lives in the dashboard now. */
.shell,
.shell.sidebar-collapsed,
.shell.dashboard-mode,
.shell.dashboard-mode.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
  padding: 0 clamp(14px, 3vw, 34px) 28px;
}

.workspace {
  margin: 16px 0 0;
}

.project-shell,
.project-shell.operations-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.project-sidebar,
.operations-toggle {
  display: none;
}

/* Row shortcuts styles */
.row-shortcuts {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row-shortcut-link,
.row-shortcut-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: white;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.row-shortcut-link img,
.row-shortcut-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  vertical-align: middle;
}

.row-shortcut-link:hover,
.row-shortcut-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.row-shortcut-link:active,
.row-shortcut-btn:active {
  transform: translateY(0);
}

/* Connected state styles */
.row-shortcut-link.connected:hover {
  border-color: var(--accent);
  background: #f0fdf4;
}

/* Unconnected/unconfigured state styles */
.row-shortcut-btn.unconnected {
  border-style: dashed;
  border-color: #cbd5e1;
}

.row-shortcut-btn.unconnected img {
  filter: grayscale(100%) opacity(0.35);
  transition: all 0.2s ease;
}

.row-shortcut-btn.unconnected:hover {
  border-style: solid;
  border-color: #94a3b8;
}

.row-shortcut-btn.unconnected:hover img {
  filter: none;
  opacity: 0.9;
}

/* Desktop flex styles to eliminate outer page scrollbar and keep dashboard self-contained */
@media (min-width: 768px) {
  body:has(#shell.dashboard-mode) {
    overflow: hidden;
  }

  body:has(#shell.dashboard-mode) #app {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .shell.dashboard-mode {
    flex: 1;
    height: auto;
    min-height: 0;
    padding-bottom: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .shell.dashboard-mode .workspace {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 16px 0 16px;
  }

  .projects-dashboard {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 14px;
  }

  .dashboard-head,
  .dashboard-metrics,
  .dashboard-toolbar,
  .dashboard-pagination {
    flex-shrink: 0;
  }

  .dashboard-table-card {
    flex: 1;
    max-height: none;
    overflow-y: auto;
  }
}

/* Unified Calendar Composer */
.calendar-composer {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.calendar-composer form {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 16px !important;
}

.composer-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.composer-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.composer-tab-btn:hover {
  color: var(--ink);
  background: #f1f5f9;
}

.composer-tab-btn.active {
  color: var(--accent);
  background: white;
  border-bottom-color: var(--accent);
}

/* Day tasks badge on calendar days */
.calendar-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.day-tasks-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.day-tasks-badge.all-completed {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.day-tasks-badge svg {
  flex-shrink: 0;
}

/* Agenda list task specific columns */
.agenda-item.task {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}


