/* WannaPlan – Production CSS
   NOTE: Tailwind CDN does not process @apply in external files.
   All component styles are written in plain CSS with dark-mode variants. */

/* ── Base ─────────────────────────────────────────────────── */
[x-cloak] { display: none !important; }

*,
*::before,
*::after { box-sizing: border-box; }

/* ── Scrollbars ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.dark ::-webkit-scrollbar-thumb { background: #4b5563; }
.dark ::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* ── Navigation button ────────────────────────────────────── */
.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    border-radius: 0.5rem;
    transition: color 0.15s, background-color 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.nav-btn:hover { color: #111827; background-color: #f3f4f6; }
.dark .nav-btn { color: #9ca3af; }
.dark .nav-btn:hover { color: #fff; background-color: #1f2937; }

/* ── Icon button ──────────────────────────────────────────── */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4375rem;
    color: #6b7280;
    border-radius: 0.5rem;
    transition: color 0.15s, background-color 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}
.icon-btn:hover { color: #111827; background-color: #f3f4f6; }
.dark .icon-btn { color: #9ca3af; }
.dark .icon-btn:hover { color: #fff; background-color: #1f2937; }

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown-menu {
    position: absolute;
    top: 100%;
    margin-top: 0.375rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 20px -4px rgba(0,0,0,.12), 0 4px 8px -4px rgba(0,0,0,.08);
    padding: 0.375rem 0;
    z-index: 100;
    min-width: 10rem;
}
.dark .dropdown-menu { background: #1f2937; border-color: #374151; box-shadow: 0 10px 20px -4px rgba(0,0,0,.4); }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    color: #374151;
    transition: background-color 0.1s;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    text-decoration: none;
}
.dropdown-item:hover { background-color: #f9fafb; }
.dark .dropdown-item { color: #d1d5db; }
.dark .dropdown-item:hover { background-color: rgba(55,65,81,0.6); }

/* ── Sidebar link ─────────────────────────────────────────── */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    color: #4b5563;
    transition: color 0.15s, background-color 0.15s;
    text-decoration: none;
}
.sidebar-link:hover { color: #111827; background-color: #f3f4f6; }
.sidebar-link.active { background-color: #eff6ff; color: #1d4ed8; font-weight: 600; }
.dark .sidebar-link { color: #9ca3af; }
.dark .sidebar-link:hover { color: #f9fafb; background-color: #1f2937; }
.dark .sidebar-link.active { background-color: rgba(29,78,216,0.15); color: #93c5fd; }

/* ── Card ─────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,.05);
}
.dark .card { background: #111827; border-color: #1f2937; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #2563eb;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s;
    outline: none;
    flex-shrink: 0;
}
.btn-primary:hover { background-color: #1d4ed8; }
.btn-primary:active { background-color: #1e40af; }
.btn-primary:focus-visible { box-shadow: 0 0 0 3px rgba(37,99,235,.4); }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #fff;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s;
    outline: none;
    flex-shrink: 0;
}
.btn-secondary:hover { background-color: #f9fafb; border-color: #d1d5db; }
.dark .btn-secondary { background-color: #1f2937; color: #d1d5db; border-color: #374151; }
.dark .btn-secondary:hover { background-color: #374151; }

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #dc2626;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s;
}
.btn-danger:hover { background-color: #b91c1c; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s, background-color 0.15s;
}
.btn-ghost:hover { color: #111827; background-color: #f3f4f6; }
.dark .btn-ghost { color: #9ca3af; }
.dark .btn-ghost:hover { color: #f9fafb; background-color: #1f2937; }

/* ── Forms ────────────────────────────────────────────────── */
.form-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-input::placeholder { color: #9ca3af; }
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.dark .form-input { background-color: #1f2937; border-color: #374151; color: #f9fafb; }
.dark .form-input::placeholder { color: #6b7280; }
.dark .form-input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,.2); }

.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    color: #111827;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25em;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.dark .form-select {
    background-color: #1f2937;
    border-color: #374151;
    color: #f9fafb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}
.dark .form-select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,.2); }

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}
.dark .form-label { color: #d1d5db; }

.form-group { display: flex; flex-direction: column; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ticket type */
.type-epic   { background: #f3e8ff; color: #6d28d9; }
.type-story  { background: #e0f2fe; color: #0369a1; }
.type-task   { background: #d1fae5; color: #047857; }
.type-bug    { background: #fee2e2; color: #dc2626; }
.type-spike  { background: #fef3c7; color: #b45309; }
.type-refinement { background: #e0f9ff; color: #0369a1; }
.type-custom     { background: #f3f4f6; color: #4b5563; }
.type-abandoned  { background: #f5f5f4; color: #78716c; }

.dark .type-epic        { background: rgba(109,40,217,.2); color: #c4b5fd; }
.dark .type-story       { background: rgba(3,105,161,.2);  color: #7dd3fc; }
.dark .type-task        { background: rgba(4,120,87,.2);   color: #6ee7b7; }
.dark .type-bug         { background: rgba(220,38,38,.2);  color: #fca5a5; }
.dark .type-spike       { background: rgba(180,83,9,.2);   color: #fcd34d; }
.dark .type-refinement  { background: rgba(14,165,233,.2); color: #38bdf8; }
.dark .type-custom      { background: #1f2937; color: #9ca3af; }
.dark .type-abandoned   { background: #1c1917; color: #a8a29e; }

/* ── Mention ──────────────────────────────────────────────── */
.mention {
    color: #2563eb;
    font-weight: 500;
    background-color: #eff6ff;
    padding: 0 3px;
    border-radius: 3px;
}
.dark .mention {
    color: #60a5fa;
    background-color: rgba(37,99,235,.15);
}

/* Priority */
.priority-critical   { background: #fee2e2; color: #dc2626; }
.priority-high       { background: #ffedd5; color: #c2410c; }
.priority-medium     { background: #fef9c3; color: #a16207; }
.priority-low        { background: #dbeafe; color: #1d4ed8; }
.priority-no_priority { background: #f3f4f6; color: #6b7280; }

.dark .priority-critical    { background: rgba(220,38,38,.2);  color: #fca5a5; }
.dark .priority-high        { background: rgba(194,65,12,.2);  color: #fdba74; }
.dark .priority-medium      { background: rgba(161,98,7,.2);   color: #fde047; }
.dark .priority-low         { background: rgba(29,78,216,.2);  color: #93c5fd; }
.dark .priority-no_priority { background: #1f2937; color: #6b7280; }

/* Status */
.status-backlog     { background: #e5e7eb; color: #6b7280; }
.status-refinement  { background: #e0f2fe; color: #0284c7; }
.status-todo        { background: #f3f4f6; color: #4b5563; }
.status-in_progress { background: #dbeafe; color: #1d4ed8; }
.status-in_review   { background: #fef9c3; color: #a16207; }
.status-done        { background: #d1fae5; color: #047857; }
.status-abandoned   { background: #e7e5e4; color: #78716c; text-decoration: line-through; }

.dark .status-backlog     { background: #374151; color: #9ca3af; }
.dark .status-refinement  { background: rgba(2,132,199,.2); color: #7dd3fc; }
.dark .status-todo        { background: #1f2937; color: #9ca3af; }
.dark .status-in_progress { background: rgba(29,78,216,.2);  color: #93c5fd; }
.dark .status-in_review   { background: rgba(161,98,7,.2);   color: #fde047; }
.dark .status-done        { background: rgba(4,120,87,.2);   color: #6ee7b7; }
.dark .status-abandoned   { background: #44403c; color: #a8a29e; text-decoration: line-through; }

/* Sprint */
.sprint-planning  { background: #f3f4f6; color: #4b5563; }
.sprint-active    { background: #d1fae5; color: #047857; }
.sprint-completed { background: #f3e8ff; color: #6d28d9; }

.dark .sprint-planning  { background: #1f2937; color: #9ca3af; }
.dark .sprint-active    { background: rgba(4,120,87,.2);   color: #6ee7b7; }
.dark .sprint-completed { background: rgba(109,40,217,.2); color: #c4b5fd; }

/* ── Kanban board ─────────────────────────────────────────── */

/* Board content fills viewport height minus navbar */
.board-page {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: calc(100vh - 3.5rem); /* 3.5rem = 56px nav */
}

.board-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}
.dark .board-header { border-bottom-color: #1f2937; background: #111827; }

.board-meta {
    padding: 0.375rem 1.25rem;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    flex-shrink: 0;
}
.dark .board-meta { background: rgba(17,24,39,.5); border-bottom-color: #1f2937; }

.board-filter-bar {
    padding: 0.5rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.dark .board-filter-bar { background: #111827; border-bottom-color: #1f2937; }

.board-filter-active {
    box-shadow: 0 0 0 2px #3b82f6 !important;
}

/* Columns wrapper — horizontal scroll when too many columns */
.board-columns {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 0.75rem;
    padding: 0.875rem;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
}

.board-column {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    min-width: 240px;
    max-width: 400px;
    background: #f3f4f6;
    border-radius: 0.75rem;
    overflow: hidden;
}
.dark .board-column { background: rgba(31,41,55,.5); }

.board-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
}
.dark .board-column-header { border-bottom-color: rgba(255,255,255,.04); }

.board-column-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 60px;
}

/* ── Ticket card ──────────────────────────────────────────── */
.ticket-card {
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    cursor: grab;
    transition: border-color 0.15s, box-shadow 0.15s;
    user-select: none;
}
.ticket-card:hover { border-color: #bfdbfe; box-shadow: 0 4px 12px rgba(0,0,0,.07); }
.ticket-card:active { cursor: grabbing; }
.dark .ticket-card { background: #111827; border-color: #1f2937; }
.dark .ticket-card:hover { border-color: #3b82f6; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.ticket-card.sortable-ghost  { opacity: 0.35; }
.ticket-card.sortable-chosen { box-shadow: 0 16px 30px rgba(0,0,0,.15); transform: rotate(1.5deg); }

/* ── Virtual Scroll ───────────────────────────────────────── */
.virtual-scroll-container {
    position: relative;
    overflow-y: auto;
    max-height: 60vh;
}

.virtual-scroll-content {
    position: relative;
}

.virtual-scroll-item {
    position: absolute;
    left: 0;
    right: 0;
    height: 44px; /* Match ticket-row height + border */
}

/* ── Ticket row (list views) ──────────────────────────────── */
.ticket-row {
    display: grid;
    grid-template-columns: 1.5rem 4.5rem 3.5rem 1fr 1.5rem 6rem 5rem 4rem 2.5rem 5rem 4rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.1s;
}
.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background-color: #f9fafb; }
.dark .ticket-row { border-bottom-color: #1f2937; }
.dark .ticket-row:hover { background-color: rgba(31,41,55,.4); }

/* Column alignment helpers for ticket-row */
.ticket-row > * { min-width: 0; }
.ticket-row .col-drag { justify-self: center; }
.ticket-row .col-type { justify-self: start; }
.ticket-row .col-key { justify-self: start; }
.ticket-row .col-title { justify-self: stretch; overflow: hidden; }
.ticket-row .col-flag { justify-self: center; }
.ticket-row .col-status { justify-self: start; }
.ticket-row .col-priority { justify-self: start; }
.ticket-row .col-epic { justify-self: start; }
.ticket-row .col-points { justify-self: center; }
.ticket-row .col-assignees { justify-self: start; }
.ticket-row .col-actions { justify-self: end; }

/* Simple ticket row for sprints page (grid layout for alignment) */
.ticket-row-simple {
    display: grid;
    grid-template-columns: 4.5rem 3.5rem 1fr 6rem 5rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.1s;
}
.ticket-row-simple:last-child { border-bottom: none; }
.ticket-row-simple:hover { background-color: #f9fafb; }
.dark .ticket-row-simple { border-bottom-color: #1f2937; }
.dark .ticket-row-simple:hover { background-color: rgba(31,41,55,.4); }

.ticket-row-simple > * { min-width: 0; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert-success {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: #f0fdf4;
    color: #15803d;
    border-radius: 0.625rem;
    border: 1px solid #bbf7d0;
    font-size: 0.875rem;
}
.dark .alert-success { background: rgba(21,128,61,.12); color: #86efac; border-color: rgba(134,239,172,.2); }

.alert-error {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 0.625rem;
    border: 1px solid #fecaca;
    font-size: 0.875rem;
}
.dark .alert-error { background: rgba(185,28,28,.12); color: #fca5a5; border-color: rgba(252,165,165,.2); }

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
    gap: 1rem;
}
.dark .page-header { border-bottom-color: #1f2937; background: #111827; }

.page-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
}
.dark .page-title { color: #f9fafb; }

/* ── Stat card ────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1rem 1.25rem;
}
.dark .stat-card { background: #111827; border-color: #1f2937; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.25;
}
.dark .stat-value { color: #f9fafb; }

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}
.dark .stat-label { color: #9ca3af; }

/* ── Dashboard specific styles ─────────────────────────────── */
.dashboard-card {
    background: #fff;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}
.dark .dashboard-card { 
    background: #111827; 
    border-color: #1f2937; 
}

.dashboard-progress-bar {
    height: 6px;
    background: #f3f4f6;
    border-radius: 9999px;
    overflow: hidden;
}
.dark .dashboard-progress-bar { 
    background: #1f2937; 
}

.dashboard-progress-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* ── Search results row (aligned columns) ──────────────────── */
.search-row-header {
    display: grid;
    grid-template-columns: 4.5rem 3.5rem 1fr 8rem 6rem 5rem 5rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dark .search-row-header {
    background: rgba(31,41,55,0.5);
    border-bottom-color: #1f2937;
    color: #6b7280;
}

.search-row {
    display: grid;
    grid-template-columns: 4.5rem 3.5rem 1fr 8rem 6rem 5rem 5rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.1s;
}
.search-row:last-child {
    border-bottom: none;
}
.search-row:hover {
    background-color: #f9fafb;
}
.dark .search-row {
    border-bottom-color: #1f2937;
}
.dark .search-row:hover {
    background-color: rgba(31,41,55,0.4);
}

.search-row > *,
.search-row-header > * {
    min-width: 0;
}

.search-row .col-type,
.search-row-header .col-type {
    justify-self: start;
}

.search-row .col-key,
.search-row-header .col-key {
    justify-self: start;
}

.search-row .col-title,
.search-row-header .col-title {
    justify-self: stretch;
    overflow: hidden;
}

.search-row .col-project,
.search-row-header .col-project {
    justify-self: start;
}

.search-row .col-status,
.search-row-header .col-status {
    justify-self: start;
}

.search-row .col-priority,
.search-row-header .col-priority {
    justify-self: start;
}

.search-row .col-assignees,
.search-row-header .col-assignees {
    justify-self: start;
}

/* ── Avatars ──────────────────────────────────────────────── */
.avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
    overflow: hidden;
}

.avatar-sm {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
    overflow: hidden;
}

.avatar-lg {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
    user-select: none;
    overflow: hidden;
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
}
.empty-state-icon { width: 2rem; height: 2rem; color: #d1d5db; margin-bottom: 0.75rem; }
.dark .empty-state-icon { color: #374151; }
.empty-state-text { font-size: 0.8125rem; color: #9ca3af; }
.dark .empty-state-text { color: #6b7280; }

/* ── Divider ──────────────────────────────────────────────── */
.divider { border-top: 1px solid #e5e7eb; }
.dark .divider { border-top-color: #1f2937; }

/* ── Misc ─────────────────────────────────────────────────── */
/* Ensure checkboxes look decent cross-browser */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}

/* Date inputs in dark mode */
.dark input[type="date"] { color-scheme: dark; }

/* ── Prose / Markdown rendered content ───────────────────── */
.prose {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #374151;
    max-width: none;
}
.dark .prose { color: #d1d5db; }
.prose > *:first-child { margin-top: 0 !important; }
.prose > *:last-child { margin-bottom: 0 !important; }

/* Headings */
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #111827;
}
.dark .prose h1, .dark .prose h2, .dark .prose h3,
.dark .prose h4, .dark .prose h5, .dark .prose h6 { color: #f9fafb; }
.prose h1 { font-size: 1.375rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.3em; }
.prose h2 { font-size: 1.125rem; border-bottom: 1px solid #f3f4f6; padding-bottom: 0.2em; }
.prose h3 { font-size: 1rem; }
.prose h4, .prose h5, .prose h6 { font-size: 0.875rem; }
.dark .prose h1 { border-bottom-color: #374151; }
.dark .prose h2 { border-bottom-color: #1f2937; }

/* Paragraphs */
.prose p { margin-top: 0.75em; margin-bottom: 0.75em; }

/* Bold / Italic */
.prose strong { font-weight: 600; color: #111827; }
.dark .prose strong { color: #f9fafb; }
.prose em { font-style: italic; }

/* Links */
.prose a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: #1d4ed8; }
.dark .prose a { color: #60a5fa; }
.dark .prose a:hover { color: #93c5fd; }

/* Lists */
.prose ul { list-style-type: disc; padding-left: 1.5em; margin: 0.625em 0; }
.prose ol { list-style-type: decimal; padding-left: 1.5em; margin: 0.625em 0; }
.prose li { margin: 0.25em 0; }
.prose li > p { margin: 0.25em 0; }
.prose ul ul { list-style-type: circle; }
.prose ul ul ul { list-style-type: square; }

/* Task lists (GFM checkboxes) */
.prose li:has(input[type="checkbox"]) { list-style: none; margin-left: -1.5em; }
.prose input[type="checkbox"] { margin-right: 0.375em; vertical-align: middle; width: 0.875rem; height: 0.875rem; }

/* Blockquote */
.prose blockquote {
    border-left: 3px solid #3b82f6;
    padding-left: 1em;
    margin: 1em 0;
    color: #6b7280;
    font-style: italic;
}
.dark .prose blockquote { border-left-color: #2563eb; color: #9ca3af; }
.prose blockquote p { margin: 0; }

/* Inline code */
.prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125em;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    padding: 0.125em 0.3125em;
    color: #db2777;
    word-break: break-word;
}
.dark .prose code { background: #1f2937; border-color: #374151; color: #f472b6; }

/* Code blocks */
.prose pre {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1em 1.25em;
    overflow-x: auto;
    margin: 1em 0;
    border: 1px solid #334155;
}
.prose pre code {
    background: none;
    border: none;
    padding: 0;
    color: #e2e8f0;
    font-size: 0.8125em;
    word-break: normal;
}

/* Horizontal rule */
.prose hr { border: none; border-top: 1px solid #e5e7eb; margin: 1.5em 0; }
.dark .prose hr { border-top-color: #374151; }

/* Images */
.prose img { max-width: 100%; border-radius: 0.5rem; margin: 0.75em 0; display: block; }

/* Tables */
.prose table { width: 100%; border-collapse: collapse; font-size: 0.875em; margin: 1em 0; }
.prose th, .prose td { border: 1px solid #e5e7eb; padding: 0.5em 0.75em; text-align: left; }
.dark .prose th, .dark .prose td { border-color: #374151; }
.prose th { background: #f9fafb; font-weight: 600; color: #111827; }
.dark .prose th { background: #1f2937; color: #f3f4f6; }
.prose tbody tr:hover { background: #f9fafb; }
.dark .prose tbody tr:hover { background: rgba(31,41,55,0.5); }

/* Strikethrough */
.prose del { text-decoration: line-through; color: #9ca3af; }
