/* ==========================================================================
   TO-DO — Editorial dark UI
   Design system: near-black canvas, ivory type, electric lime accent,
   hairline borders, Space Grotesk display + Inter body.
   ========================================================================== */

:root {
    /* Canvas + surfaces */
    --bg: #0a0a0b;
    --surface: #111113;
    --surface-2: #17171a;
    --surface-3: #1e1e22;

    /* Type */
    --ink: #f2f1ec;
    --ink-dim: #9c9ba4;
    --ink-faint: #5f5e66;

    /* Hairlines */
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);

    /* Accent + status */
    --accent: #d8ff3e;
    --accent-ink: #101200;
    --c-not-started: #8a8a93;
    --c-in-progress: #ffb224;
    --c-done: #3dd68c;
    --c-danger: #ff5c47;

    /* Type stacks */
    --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    /* Shape + motion */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::selection {
    background: var(--accent);
    color: var(--accent-ink);
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(216, 255, 62, 0.05), transparent),
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 100% 100%, 56px 56px, 56px 56px;
    color: var(--ink);
    display: flex;
    min-height: 100vh;
    letter-spacing: 0.01em;
}

button {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

.sidebar {
    width: 264px;
    background: rgba(17, 17, 19, 0.75);
    backdrop-filter: blur(14px);
    padding: 28px 20px 20px;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-top {
    flex: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.check-icon {
    background: var(--accent);
    color: var(--accent-ink);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 0 24px rgba(216, 255, 62, 0.25);
}

.board-view {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
}

.board-icon,
.workflow-icon {
    font-size: 1rem;
    opacity: 0.9;
}

/* View selector */
.view-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.view-selector::before {
    content: 'Views';
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-faint);
    margin-bottom: 8px;
}

.view-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-dim);
    transition: color 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.view-option:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.view-option.active {
    background: var(--surface-3);
    border-color: var(--line-strong);
    color: var(--ink);
    position: relative;
}

.view-option.active::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    margin-left: auto;
    box-shadow: 0 0 10px rgba(216, 255, 62, 0.6);
}

.tutorial-restart-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.tutorial-restart-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink-dim);
    padding: 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s var(--ease);
}

.tutorial-restart-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tutorial-restart-btn span {
    font-size: 1rem;
    font-weight: 700;
}

/* Profile */
.profile-section {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    transition: border-color 0.25s var(--ease);
}

.profile-card:hover {
    border-color: var(--line-strong);
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #6ee7b7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-ink);
    text-transform: uppercase;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    overflow: hidden;
}

.profile-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-email {
    font-size: 0.78rem;
    color: var(--ink-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-actions {
    margin-top: 8px;
}

.logout-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    color: var(--c-danger);
    border: 1px solid rgba(255, 92, 71, 0.35);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.25s var(--ease);
}

.logout-btn:hover {
    background: var(--c-danger);
    border-color: var(--c-danger);
    color: #fff;
}

/* Sign-in prompt */
.signin-prompt {
    text-align: center;
    padding: 24px 16px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    margin-top: auto;
}

.signin-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    opacity: 0.4;
    filter: grayscale(1);
}

.signin-prompt p {
    color: var(--ink-dim);
    margin-bottom: 14px;
    font-size: 0.85rem;
}

.signin-btn {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.25s var(--ease);
}

.signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(216, 255, 62, 0.3);
}

/* ==========================================================================
   Main content + board header
   ========================================================================== */

.main-content {
    flex: 1;
    padding: 36px 40px;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
}

.board-header {
    margin-bottom: 32px;
}

.board-eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--ink-faint);
    margin-bottom: 8px;
}

.board-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.board-title .title-dot {
    color: var(--accent);
}

.board {
    display: flex;
    gap: 20px;
    min-height: 100%;
    align-items: stretch;
}

/* ==========================================================================
   Columns
   ========================================================================== */

.column {
    flex: 1;
    min-width: 280px;
    background: rgba(17, 17, 19, 0.6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.column::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--col-color, var(--line-strong));
    opacity: 0.85;
}

.column[data-status="not-started"] { --col-color: var(--c-not-started); }
.column[data-status="in-progress"] { --col-color: var(--c-in-progress); }
.column[data-status="done"] { --col-color: var(--c-done); }

.column-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 0 4px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--col-color, #666);
    box-shadow: 0 0 12px var(--col-color, transparent);
}

.not-started-indicator { background: var(--c-not-started); }
.in-progress-indicator { background: var(--c-in-progress); }
.done-indicator { background: var(--c-done); }

.column-title {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--ink-dim);
}

.count {
    font-family: var(--font-display);
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink);
    min-width: 30px;
    text-align: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Cards container */
.cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    min-height: 100px;
}

/* ==========================================================================
   Task cards
   ========================================================================== */

.task-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: grab;
    transition: transform 0.25s var(--ease), border-color 0.25s var(--ease),
                box-shadow 0.25s var(--ease), background 0.25s var(--ease);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.task-card:active {
    cursor: grabbing;
}

.task-card:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.task-card.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    border-style: dashed;
}

.task-emoji {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.task-text {
    flex: 1;
    color: var(--ink);
    font-size: 0.94rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.column[data-status="done"] .task-text {
    color: var(--ink-dim);
    text-decoration: line-through;
    text-decoration-color: rgba(61, 214, 140, 0.5);
    text-decoration-thickness: 1px;
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.task-card:hover .task-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.action-btn:hover {
    transform: scale(1.35);
}

.action-btn.move-not-started {
    background: var(--c-not-started);
}

.action-btn.move-not-started:hover {
    box-shadow: 0 0 10px var(--c-not-started);
}

.action-btn.move-in-progress {
    background: var(--c-in-progress);
}

.action-btn.move-in-progress:hover {
    box-shadow: 0 0 10px var(--c-in-progress);
}

.action-btn.move-done {
    background: var(--c-done);
}

.action-btn.move-done:hover {
    box-shadow: 0 0 10px var(--c-done);
}

.delete-btn {
    background: var(--c-danger);
}

.delete-btn:hover {
    box-shadow: 0 0 10px var(--c-danger);
}

/* New task button */
.new-page-btn {
    background: transparent;
    border: 1px dashed var(--line-strong);
    color: var(--ink-faint);
    padding: 12px;
    text-align: center;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.25s var(--ease);
}

.new-page-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(216, 255, 62, 0.04);
}

.new-page-btn span {
    font-size: 1rem;
    margin-right: 6px;
}

/* ==========================================================================
   Task groups
   ========================================================================== */

.task-group {
    margin-bottom: 16px;
    border-left: 1px solid var(--line-strong);
    padding-left: 12px;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.group-name {
    font-size: 0.68rem;
    color: var(--ink-faint);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.group-delete-btn {
    background: var(--c-danger);
    border: none;
    cursor: pointer;
    padding: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    opacity: 0;
}

.task-group:hover .group-delete-btn {
    opacity: 1;
}

.group-delete-btn:hover {
    transform: scale(1.35);
    box-shadow: 0 0 10px var(--c-danger);
}

.group-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 6, 0.7);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--line-strong);
    padding: 32px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 420px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.3s var(--ease);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content h2 {
    margin-bottom: 22px;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modal-content input,
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 14px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.modal-content input::placeholder,
.modal-content textarea::placeholder {
    color: var(--ink-faint);
}

.modal-content input:focus,
.modal-content select:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-3);
}

.modal-content textarea {
    min-height: 84px;
    resize: vertical;
}

/* Group picker row inside the task modal */
.group-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.group-row select {
    flex: 1;
    margin-bottom: 0;
}

.group-add-btn {
    padding: 0 18px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.25s var(--ease);
}

.group-add-btn:hover {
    background: var(--accent);
    color: var(--accent-ink);
}

.new-group-input {
    margin-bottom: 14px;
}

.new-group-input input {
    margin-bottom: 8px;
}

.new-group-actions {
    display: flex;
    gap: 8px;
}

.new-group-actions button {
    flex: 1;
    padding: 9px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s var(--ease);
}

.new-group-actions .confirm {
    background: var(--accent);
    color: var(--accent-ink);
}

.new-group-actions .confirm:hover {
    filter: brightness(1.08);
}

.new-group-actions .cancel {
    background: transparent;
    color: var(--ink-dim);
    border: 1px solid var(--line-strong);
}

.new-group-actions .cancel:hover {
    color: var(--ink);
    border-color: var(--ink-dim);
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

.modal-buttons button {
    padding: 11px 26px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all 0.25s var(--ease);
}

.modal-buttons button:first-child {
    background: var(--accent);
    color: var(--accent-ink);
}

.modal-buttons button:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(216, 255, 62, 0.3);
}

.modal-buttons button:last-child {
    background: transparent;
    color: var(--ink-dim);
    border: 1px solid var(--line-strong);
}

.modal-buttons button:last-child:hover {
    color: var(--ink);
    border-color: var(--ink-dim);
}

/* ==========================================================================
   Scrollbars
   ========================================================================== */

.cards-container::-webkit-scrollbar,
.main-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.cards-container::-webkit-scrollbar-track,
.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.cards-container::-webkit-scrollbar-thumb,
.main-content::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 3px;
}

.cards-container::-webkit-scrollbar-thumb:hover,
.main-content::-webkit-scrollbar-thumb:hover {
    background: var(--ink-faint);
}

/* ==========================================================================
   Workflow canvas
   ========================================================================== */

.workflow-canvas {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 28px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    min-height: 0;
}

.workflow-toolbar {
    position: relative;
    display: flex;
    gap: 10px;
    z-index: 10;
    background: rgba(17, 17, 19, 0.85);
    padding: 14px 16px;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    justify-content: flex-start;
}

.workflow-btn {
    padding: 10px 18px;
    background: transparent;
    color: var(--ink-dim);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all 0.25s var(--ease);
    display: flex;
    align-items: center;
    gap: 8px;
}

.workflow-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(216, 255, 62, 0.05);
}

.workflow-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

.canvas-grid {
    position: relative;
    flex: 1;
    overflow: auto;
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulate;
    z-index: 1;
    width: 100%;
    min-height: 1000px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.canvas-grid::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.canvas-grid.connecting {
    cursor: crosshair;
}

.workflow-task {
    position: absolute;
    min-width: 170px;
    max-width: 250px;
    background: rgba(23, 23, 26, 0.92);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: move;
    transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    z-index: 1;
    touch-action: none;
}

.workflow-task:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 24px rgba(216, 255, 62, 0.12);
}

.workflow-task.dragging {
    opacity: 0.85;
    cursor: grabbing;
    z-index: 100;
}

.workflow-task.connecting-source {
    border-color: var(--c-done);
    box-shadow: 0 0 24px rgba(61, 214, 140, 0.4);
}

.workflow-task.connecting-target {
    border-color: var(--c-in-progress);
}

.workflow-task-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.workflow-task-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ink);
    width: 100%;
}

.workflow-task-emoji {
    font-size: 1.15rem;
}

.workflow-task-actions {
    position: absolute;
    top: -12px;
    right: -12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
    z-index: 10;
}

.workflow-task:hover .workflow-task-actions {
    opacity: 1;
}

.workflow-task-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    cursor: pointer;
    color: var(--ink);
    font-size: 0.8rem;
    transition: all 0.2s var(--ease);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    touch-action: manipulation;
}

.workflow-task-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    transform: scale(1.1);
}

.workflow-task-btn.delete:hover {
    background: var(--c-danger);
    border-color: var(--c-danger);
    color: #fff;
}

.workflow-task-description {
    font-size: 0.82rem;
    color: var(--ink-dim);
    line-height: 1.5;
    margin-top: 6px;
    max-height: 60px;
    overflow-y: auto;
}

.workflow-task-connection-point {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border: 2px solid var(--bg);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.25s var(--ease);
    z-index: 2;
}

.workflow-task-connection-point.left {
    left: -7px;
    top: 50%;
    transform: translateY(-50%);
}

.workflow-task-connection-point.right {
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
}

.workflow-task-connection-point.top {
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
}

.workflow-task-connection-point.bottom {
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
}

.workflow-task-connection-point:hover {
    transform: scale(1.5) translate(-50%, -50%);
    background: var(--c-in-progress);
}

.connections-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    display: block;
}

.connection-line {
    stroke: var(--accent);
    stroke-width: 1.5;
    fill: none;
    filter: drop-shadow(0 0 5px rgba(216, 255, 62, 0.35));
}

.connection-arrow {
    fill: var(--accent);
    filter: drop-shadow(0 0 5px rgba(216, 255, 62, 0.35));
}

/* ==========================================================================
   Tutorial
   ========================================================================== */

.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 6, 0.78);
    z-index: 9990;
    backdrop-filter: blur(3px);
    pointer-events: none;
}

.tutorial-dialog {
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
    z-index: 9999;
    min-width: 350px;
    max-width: 500px;
    animation: tutorialSlideIn 0.3s var(--ease);
}

@keyframes tutorialSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.tutorial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--line);
}

.tutorial-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.tutorial-close {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink-dim);
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s var(--ease);
    font-weight: 600;
}

.tutorial-close:hover {
    border-color: var(--c-danger);
    color: var(--c-danger);
}

.tutorial-content {
    padding: 24px;
}

.tutorial-content p {
    margin: 0 0 20px;
    font-size: 0.96rem;
    line-height: 1.65;
    color: var(--ink-dim);
}

.tutorial-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tutorial-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
}

.tutorial-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s var(--ease);
    border-radius: 2px;
}

.tutorial-step-counter {
    font-size: 0.78rem;
    color: var(--ink-faint);
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tutorial-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
}

.tutorial-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all 0.2s var(--ease);
}

.tutorial-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4 !important;
}

.tutorial-btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.tutorial-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(216, 255, 62, 0.3);
}

.tutorial-btn-secondary {
    background: transparent;
    color: var(--ink-dim);
    border: 1px solid var(--line-strong);
}

.tutorial-btn-secondary:hover:not(:disabled) {
    color: var(--ink);
    border-color: var(--ink-dim);
}

/* Tutorial highlight effect */
.tutorial-highlight {
    position: relative;
    z-index: 9995 !important;
    box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.6),
                0 0 0 7px rgba(216, 255, 62, 0.2),
                0 0 30px rgba(216, 255, 62, 0.25) !important;
    animation: tutorialPulse 2s infinite;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.6),
                    0 0 0 7px rgba(216, 255, 62, 0.2),
                    0 0 30px rgba(216, 255, 62, 0.25);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(216, 255, 62, 0.8),
                    0 0 0 11px rgba(216, 255, 62, 0.28),
                    0 0 40px rgba(216, 255, 62, 0.4);
    }
}

/* ==========================================================================
   Responsive — tablets & phones
   ========================================================================== */

@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
        min-height: 100vh;
        height: 100vh;
        height: 100dvh; /* track the real visible area as browser chrome hides/shows */
    }

    /* Sidebar becomes a top bar on mobile.
       backdrop-filter is dropped here: it makes the sidebar a containing
       block, which would trap the fixed logout bar inside the top bar. */
    .sidebar {
        width: 100%;
        padding: 12px 15px;
        border-right: none;
        border-bottom: 1px solid var(--line);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        backdrop-filter: none;
        background: var(--surface);
    }

    .sidebar-top {
        flex: 1;
        min-width: 0;
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .logo {
        margin-bottom: 0;
        font-size: 1.1rem;
    }

    .check-icon {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .view-selector {
        flex-direction: row;
        gap: 6px;
        flex: 1;
    }

    .view-selector::before {
        display: none;
    }

    .view-option {
        flex: 1;
        padding: 8px 6px;
        font-size: 0.75rem;
        min-height: 40px;
        justify-content: center;
        white-space: nowrap;
        gap: 6px;
    }

    .view-option.active::after {
        display: none;
    }

    .board-icon,
    .workflow-icon {
        font-size: 0.95rem;
    }

    .board-view {
        display: none;
    }

    .tutorial-restart-section {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
        margin-left: auto;
    }

    .tutorial-restart-btn {
        padding: 8px 12px;
        font-size: 0.72rem;
        min-width: 40px;
    }

    .tutorial-restart-btn span {
        font-size: 0.9rem;
    }

    .profile-section {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }

    /* Avatar-only chip in the top bar */
    .profile-card {
        padding: 0;
        margin-bottom: 0;
        background: transparent;
        border: none;
    }

    .profile-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .profile-info {
        display: none;
    }

    .profile-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(17, 17, 19, 0.92);
        backdrop-filter: blur(12px);
        padding: 10px;
        border-top: 1px solid var(--line);
        z-index: 999;
        margin-top: 0;
    }

    .logout-btn {
        padding: 12px;
        font-size: 0.85rem;
    }

    .signin-prompt {
        padding: 8px 12px;
        margin-top: 0;
    }

    .signin-icon {
        font-size: 1.6rem;
        margin-bottom: 5px;
    }

    .signin-prompt p {
        font-size: 0.78rem;
        margin-bottom: 8px;
    }

    .signin-btn {
        padding: 8px;
        font-size: 0.78rem;
    }

    /* Main content adjustments */
    .main-content {
        padding: 16px;
        padding-bottom: 74px;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    .board-header {
        margin-bottom: 14px;
    }

    .board-title {
        font-size: 1.7rem;
    }

    /* Columns grow with their content and the page scrolls.
       Without this, flex: 1 + overflow: hidden squeezes all three
       columns into one viewport and clips the task lists. */
    .board {
        flex-direction: column;
        gap: 12px;
        min-height: 0;
    }

    .column {
        flex: 0 0 auto;
        min-width: 100%;
        width: 100%;
        padding: 14px 12px 12px;
    }

    .cards-container {
        gap: 8px;
        margin-bottom: 10px;
        min-height: 60px;
    }

    .task-group {
        padding-left: 10px;
        margin-bottom: 12px;
    }

    .task-card {
        padding: 12px 14px;
    }

    .task-emoji {
        font-size: 1rem;
    }

    .task-text {
        font-size: 0.9rem;
    }

    /* Always show action buttons on mobile */
    .task-actions {
        opacity: 1;
        transform: none;
        gap: 6px;
    }

    .action-btn {
        width: 16px;
        height: 16px;
        min-width: 16px;
        min-height: 16px;
    }

    /* Modal adjustments */
    .modal-content {
        width: 95%;
        padding: 22px;
    }

    .modal-content h2 {
        font-size: 1.25rem;
        margin-bottom: 16px;
    }

    .modal-content input {
        padding: 11px;
        font-size: 0.9rem;
    }

    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .modal-buttons button {
        width: 100%;
        padding: 12px;
    }

    .group-name {
        font-size: 0.62rem;
    }

    .group-delete-btn {
        opacity: 1;
    }

    .new-page-btn {
        padding: 12px;
        font-size: 0.8rem;
    }

    .column-header {
        margin-bottom: 12px;
    }

    /* Tutorial on mobile */
    .tutorial-dialog {
        left: 10px !important;
        right: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        max-width: calc(100% - 20px);
        min-width: auto;
    }

    .tutorial-header h3 {
        font-size: 1.1rem;
    }

    .tutorial-content p {
        font-size: 0.9rem;
    }

    .tutorial-footer {
        flex-direction: column;
    }

    .tutorial-btn {
        width: 100%;
    }

    /* Workflow canvas on mobile */
    .workflow-canvas {
        flex-direction: column;
        height: 100%;
        min-height: 0;
        flex: 1;
    }

    .workflow-toolbar {
        position: relative;
        top: 0;
        left: 0;
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
        justify-content: center;
        flex-shrink: 0;
    }

    .workflow-btn {
        flex: 1;
        min-width: 80px;
        padding: 11px 10px;
        font-size: 0.72rem;
    }

    .canvas-grid {
        flex: 1;
        overflow: auto;
        min-height: 0;
        width: 100%;
        position: relative;
    }

    .workflow-task {
        min-width: 140px;
        max-width: 200px;
        padding: 12px;
    }

    .workflow-task-header {
        margin-bottom: 6px;
    }

    .workflow-task-title {
        font-size: 0.9rem;
        gap: 6px;
    }

    .workflow-task-emoji {
        font-size: 1rem;
    }

    .workflow-task-description {
        font-size: 0.75rem;
        max-height: 40px;
    }

    .workflow-task-actions {
        top: -16px;
        right: -16px;
    }

    .workflow-task-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .workflow-task-connection-point {
        width: 14px;
        height: 14px;
    }

    .workflow-task-connection-point.left { left: -7px; }
    .workflow-task-connection-point.right { right: -7px; }
    .workflow-task-connection-point.top { top: -7px; }
    .workflow-task-connection-point.bottom { bottom: -7px; }

    .workflow-task:active {
        box-shadow: 0 8px 20px rgba(216, 255, 62, 0.2);
    }
}

/* Extra small devices (phones in portrait) */
@media screen and (max-width: 480px) {
    .logo {
        font-size: 1rem;
    }

    .logo-text {
        display: none;
    }

    .check-icon {
        width: 32px;
        height: 32px;
    }

    /* Collapse the tutorial button to just the "?" glyph */
    .tutorial-restart-btn {
        font-size: 0;
        gap: 0;
        padding: 8px 10px;
    }

    .tutorial-restart-btn span {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 12px;
        padding-bottom: 74px;
    }

    .column {
        padding: 14px 10px 10px;
    }

    .modal-content {
        padding: 18px;
    }

    .workflow-canvas {
        flex-direction: column;
        height: 100%;
        min-height: 0;
        flex: 1;
    }

    .workflow-toolbar {
        padding: 10px;
        gap: 6px;
        flex-shrink: 0;
    }

    .workflow-btn {
        flex: 0 1 calc(50% - 3px);
        min-width: auto;
        padding: 10px 8px;
        font-size: 0.7rem;
    }

    .workflow-btn span {
        display: none;
    }

    .canvas-grid {
        flex: 1;
        overflow: auto;
        min-height: 0;
        width: 100%;
        position: relative;
    }

    .workflow-task {
        min-width: 120px;
        max-width: 180px;
        padding: 10px;
    }

    .workflow-task-title {
        font-size: 0.8rem;
        gap: 4px;
    }

    .workflow-task-emoji {
        font-size: 0.9rem;
    }

    .workflow-task-description {
        display: none;
    }

    .workflow-task-btn {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
}

/*

                              ::::::::::::::::::::
                        -::::::::::::::::::::::::::::::-
                     ::::::::::::::::::::::::::::::::::::::-
                  :::::-+%@@+::::::::::::::::::::::-%#+-::::::-
               :::::=%@@@@@@@-:::::::::::::::::::::%@@@@@%=:::::-
             :::::#@@@@@@@@#::::-*%@@@@@@@@@@@*-:::*@@@@@@@@@=::::-
           ::::-%@@@@@@@@=:::*@@@@@@@@@@@@@@@@@@@@*:::#@@@@@@@@+::::-
         :::::#@@@@@@@@+::-%@@@@@@@@@@@@@@@@@@@@@@@@%-:-#@@@@@@@@+::::=
        ::::+@@@@@@@@%-:-%@@@@@@@@@@@@@@@@@@@@@@@@@@@@%-:=%@@@@@@@%-:::-
       ::::*@@@@@@@@*::+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+::#@@@@@@@@+::::+
     ::::-%@@@@@@@@*::*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*::%@@@@@@@@#::::=
    :::::%@@@@@@@@#::+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+::#@@@@@@@@#::::=
    ::::%@@@@@@@@@-:=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=:=@@@@@@@@@#::::@
   ::::*@@@@@@@@@*::*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#::*@@@@@@@@@+::::+
  ::::+@@@@@@@@@@-::%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%::-@@@@@@@@@@=:::-
 :::::%@@@@@@@@@%-::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@-::%@@@@@@@@@#::::+
 ::::+@@@@@@@@@@%-::@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:::%@@@@@@@@@@=::::
:::::@@@@@@@@@@@%-::%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%:::%@@@@@@@@@@%::::-
::::=@@@@@@@@@@@@-::*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#::-%@@@@@@@@@@@=:::=
::::+@@@@@@@@@@@@*::=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=::+@@@@@@@@@@@@*:::=
::::*@@@@@@@@@@@@@-::+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+:::%@@@@@@@@@@@@#:::-
::::#@@@@@@@@@@@@@*:::*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*:::+@@@@@@@@@@@@@#::::
::::#@@@@@@@@@@@@@@=:::=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+::::%@@@@@@@@@@@@@#::::
::::*@@@@@@@@@@@@@@@-::::#@@@@@@@@@@@@@@@@@@@@@@@@@@@@%:::::%@@@@@@@@@@@@@@#:::-
::::+@@@@@@@@@@@@%-:::::::-%@@@@@@@@@@@@@@@@@@@@@@@@%-:::::::*@@@@@@@@@@@@@*:::-
::::=@@@@@@@@@%=:::::::::::::+@@@@@@@@@@@@@@@@@@@@@@@%-::::::::-#@@@@@@@@@@+:::=
:::::%@@@@@@+:::::::::::::::::::-+%@@@@@@@@@@%+-:=%@@@@%-:::::::::=%@@@@@@@::::=
 ::::-%@@#-::::::::::::::::::::::::::::::::::::::::=%@@@@%+:::::::::-+%@@@+::::#
 -::::==::::::::::::-#-::::::::::::::::::::::::::::::-#@@@@@*::::::::::-##::::+
  ::::::::::::::::=@@@@@#-::::::::::::::::::::::::::::::*@@@@@#-:::::::::::::-
   :::::::::::::*@@@@@@@@@@@*-:::::::::::::::::::=*:::::::+%@@@@%-:::::::::::*
    :::::::::-%@@@@@*::+%@@@@@@@@%#+-:::::-=*%%@@@@@#:::::::-%@@@@%=::::::::%
    -::::::+%@@@@%=:::::::-+%@@@@@@@@@@@@@@@@@@@@@%=::::::::::-#@@@@@*:::::=
     -:::*@@@@@#-::::::::::::::-=+#%@@@@@@@%#*=-:::::::::::::::#@@@@*:::::+
      -*@@@@@*::::::::::::::::::::::::::::::::::::::::::::::-#@@@@%-::::-*
        #@%=:::::::::--:::::::::::::::::::::::::::::::::::=%@@@@%=:::::-
         :::::::::::#@@@#-:::::::::::::::::::::::::::::=%@@@@@%=::::::+
           -:::::::=@@@@@@@@%+:::::::::::::::::::::+%@@@@@@@%-::::::=
             :::::::::=%@@@@@@@@@%%%#**+++**#%%%@@@@@@@@@%=:::::::=
               -::::::::::=*%@@@@@@@@@@@@@@@@@@@@@@@@%+-::::::::=
                 =:::::::::::::-=+*#%%@@@@@@%%#*+=-::::::::::-+
                    =-::::::::::::::::::::::::::::::::::::-+
                        =-::::::::::::::::::::::::::::-*
                              +-::::::::::::::::-+

*/
