﻿/* Tierdo Styles - Minimal & Notepad-inspired */

:root {
    --bg-primary: #fefefe;
    --bg-secondary: #f9f9f9;
    --text-primary: #2c2c2c;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e0e0e0;
    --accent-color: #4a90e2;
    --accent-color-rgb: 74, 144, 226;
    --success-color: #5cb85c;
    --danger-color: #d9534f;
    --locked-color: #ccc;
    --hover-bg: #f5f5f5;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
}

/* Animations */
@keyframes taskSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.task.task-new {
    animation: taskSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    overscroll-behavior-y: none;
    overflow-x: hidden;
}

/* App Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    margin-left: 60px;
    transition: margin-left 0.3s ease;
}

.sidebar {
    width: 320px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 0;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-header h2 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.sidebar-logo {
    height: 26px;
    width: auto;
    image-rendering: auto;
    shape-rendering: geometricPrecision;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Close sidebar button - hidden on desktop, visible on mobile */
.btn-close-sidebar {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 20px;
}

.btn-close-sidebar:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.sidebar-footer {
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: sticky;
    bottom: 0;
}

.btn-add-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
    width: 100%;
}

.btn-add-group:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.btn-add-group i {
    font-size: 14px;
}

.sidebar-header .btn-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-header .btn-icon:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
}

.sidebar-groups {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: visible;
}

.tier-section {
    margin-bottom: 24px;
}

.tier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.tier-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tier-header i {
    font-size: 16px;
}

.btn-tier-add {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    opacity: 0;
}

.tier-header:hover .btn-tier-add {
    opacity: 1;
}

.btn-tier-add:hover {
    background: var(--hover-bg);
    color: var(--accent-color);
}

.tier-section[data-tier="0"] .tier-header {
    color: #e74c3c;
}

.tier-section[data-tier="1"] .tier-header {
    color: #f39c12;
}

.tier-section[data-tier="2"] .tier-header {
    color: #9b59b6;
}

.tier-groups {
    min-height: 40px;
}

.sidebar-group {
    padding: 14px 28px;
    margin: 3px 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    user-select: none;
}

.sidebar-group:hover {
    background: var(--hover-bg);
}

.sidebar-group.active {
    background: white;
    border-left: 4px solid var(--accent-color);
    padding-left: 24px;
}

.sidebar-group.drop-target {
    background: rgba(74, 144, 226, 0.15);
    border-left: 3px solid var(--accent-color);
    padding-left: 21px;
    transform: scale(1.02);
}

.sidebar-group.inactive {
    opacity: 0.5;
}

.sidebar-group-content {
    flex: 1;
    min-width: 0;
}

.sidebar-group-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.sidebar-group-count {
    font-size: 13px;
    color: var(--text-muted);
}

.sidebar-group-actions {
    display: none;
    gap: 4px;
}

.sidebar-group:hover .sidebar-group-actions {
    display: flex;
}

.sidebar-group-actions button {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
}

.sidebar-group-actions button:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.sidebar-group.is-dragging {
    opacity: 0.5;
}

.sidebar-group.uncategorized-group {
    border: 1px dashed var(--border-color);
    margin-top: 12px;
    opacity: 0.8;
}

.sidebar-group.uncategorized-group .sidebar-group-title {
    font-style: italic;
    color: var(--text-muted);
}

.sidebar-group.uncategorized-group:hover,
.sidebar-group.uncategorized-group.active {
    opacity: 1;
}

.group-drop-line {
    height: 2px;
    background: var(--accent-color);
    margin: 3px 28px;
    border-radius: 1px;
    pointer-events: none;
}

.tier-groups.drop-target {
    background: rgba(74, 144, 226, 0.1);
    border: 2px dashed var(--accent-color);
    border-radius: 6px;
}

.main-content {
    flex: 1;
    margin-left: 320px;
    transition: margin-left 0.3s ease;
}

.main-content.full-width {
    margin-left: 0;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.sidebar.hidden ~ .sidebar-overlay {
    opacity: 0;
    visibility: hidden;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 11px;
    border-bottom: 1px dashed var(--border-color);
    margin-bottom: 56px;
}

.logo {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.logo-default {
    height: 25px;
    width: auto;
    image-rendering: auto;
    shape-rendering: geometricPrecision;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.logo-edit-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.logo-editing-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-color);
    opacity: 0.8;
}

.logo-group-name {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

/* Breadcrumb navigation when browsing inside tasks */
.logo-breadcrumb-wrapper {
    display: flex;
    align-items: center;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb-link {
    background: none;
    border: none;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
}

.breadcrumb-link:hover {
    background: rgba(155, 89, 182, 0.08);
    color: var(--accent-color);
}

.breadcrumb-separator {
    font-size: 9px;
    color: rgba(0, 0, 0, 0.3);
    margin: 0 2px;
}

.breadcrumb-current {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 6px 10px;
}

/* Hide tab buttons when browsing inside a task */
.header:has(.logo-breadcrumb-wrapper:not([style*="display: none"])) .tab-buttons {
    display: none;
}

.header-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.tab-buttons {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    user-select: none;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

.tab-btn.active {
    background: white;
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: var(--shadow);
}

.toggle-completed-label {
    display: none !important;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

#completedCount {
    font-weight: 700;
}


/* Edit Mode Bar - Full height vertical bar */
.edit-mode-bar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 70px;
    background: white;
    border-right: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 200;
    box-shadow: 2px 0 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-mode-bar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    user-select: none;
}

/* Move bar to right edge of sidebar when sidebar is open */
.sidebar:not(.hidden) ~ .app-wrapper .edit-mode-bar,
body:has(.sidebar:not(.hidden)) .edit-mode-bar {
    left: 320px;
    background: rgb(249 249 249);
    border-color: rgba(0, 0, 0, 0.06);
    box-shadow: none;
}

/* Change content to show collapse when sidebar is open */
body:has(.sidebar:not(.hidden)) .edit-mode-bar-content {
    color: rgba(0, 0, 0, 0.4);
}

body:has(.sidebar:not(.hidden)) .edit-mode-bar-content i {
    display: none;
}

body:has(.sidebar:not(.hidden)) .edit-mode-bar-content .edit-word,
body:has(.sidebar:not(.hidden)) .edit-mode-bar-content .tasks-word {
    display: none;
}

body:has(.sidebar:not(.hidden)) .edit-mode-bar-content::after {
    content: '\f053';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 16px;
}

/* Hover effects only on desktop */
@media (min-width: 769px) {
    body:has(.sidebar:not(.hidden)) .edit-mode-bar:hover {
        background: var(--hover-bg);
        border-color: rgba(0, 0, 0, 0.1);
    }

    body:has(.sidebar:not(.hidden)) .edit-mode-bar:hover .edit-mode-bar-content {
        color: var(--accent-color);
    }

    .edit-mode-bar:hover {
        width: 80px;
        background: var(--hover-bg);
        border-color: var(--accent-color);
    }

    .edit-mode-bar:hover .edit-mode-bar-content {
        color: var(--accent-color);
    }
}

.edit-mode-bar-content i {
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-mode-bar-content .edit-word,
.edit-mode-bar-content .tasks-word {
    letter-spacing: 1.2px;
    text-transform: uppercase;
    line-height: 1;
}

/* User Menu */
.user-menu {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 300;
}

.user-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white;
    border: 2px solid transparent;
    transition: border-color 0.2s;
    box-shadow: var(--shadow);
}

/* Hide group headers when sidebar is visible (edit mode) */
.main-content:not(.full-width) .group-header {
    display: none;
}

.group-header:hover .group-title {
    color: var(--accent-color);
}

.group-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
    transition: color 0.2s;
    flex: 1;
}

.group-title.editable-group-title {
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
}

.group-title.editable-group-title:hover {
    color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.05);
}

.group-title-input {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-primary);
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    padding: 4px 8px;
    background: var(--bg-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
}

.group-title-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.1);
}

.group-actions {
    display: flex;
    align-items: center;
    position: relative;
}

.group-header:hover .group-actions {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--text-primary);
}

.btn-icon-small {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon-small:hover {
    color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.group-tasks {
    padding: 0;
}

/* Add spacing between groups in overview mode only */
.group {
    margin-bottom: 16px;
}

/* Group color variations applied to tasks */
.group[data-color="red"] .task { border-left-color: #e74c3c; }
.group[data-color="orange"] .task { border-left-color: #e67e22; }
.group[data-color="yellow"] .task { border-left-color: #f39c12; }
.group[data-color="green"] .task { border-left-color: #27ae60; }
.group[data-color="blue"] .task { border-left-color: #3498db; }
.group[data-color="purple"] .task { border-left-color: #9b59b6; }
.group[data-color="pink"] .task { border-left-color: #e91e63; }

/* Task */
.task {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
    border-left: 4px solid var(--task-color, var(--accent-color));
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

.task.hidden-in-view-mode {
    display: none;
}

.task-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 3px 16px;
    padding-left: 20px;
    transition: background 0.2s;
    cursor: pointer;
}

/* Parent tasks - more prominent */
.task.has-children > .task-header {
    padding: 5px 16px;
    padding-left: 20px;
}

.task.has-children > .task-header .task-title {
    font-weight: 500;
}

.task-children {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding-left: 28px;
    padding-top: 2px;
    padding-bottom: 2px;
    margin-left: 20px;
}

.task-children > .task {
    width: 100%;
    display: flex;
}

/* Only hide empty task-children when not editing */
.task:not(.editing) .task-children:empty {
    display: none;
}

/* Subtask input wrapper in task-children */
.task-children .subtask-input-wrapper {
    padding: 8px 0;
    margin-left: 20px;
}

.task-children .subtask-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.task-children .subtask-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.task-delete-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    flex-shrink: 0;
    margin-left: auto;
    transition: opacity 0.15s, color 0.15s;
}

/* Show delete button only on direct task hover in edit mode */
.task:hover > .task-header .task-delete-btn {
    opacity: 1;
}

/* Hide parent's delete button when hovering over a child task */
.task:has(.task:hover) > .task-header .task-delete-btn {
    opacity: 0;
}

.task-delete-btn:hover {
    color: #dc3545;
}

.task-delete-btn i {
    font-size: 14px;
}

/* Help button - only visible in overview mode on hover */
.task-help-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--accent-color);
    cursor: pointer;
    opacity: 0;
    flex-shrink: 0;
    margin-left: 8px;
    transition: opacity 0.15s, color 0.15s, transform 0.15s;
}

/* Show help button only in overview mode (full-width) on hover */
.main-content.full-width .task:hover > .task-header .task-help-btn {
    opacity: 1;
}

/* Hide parent's help button when hovering over a child task */
.main-content.full-width .task:has(.task:hover) > .task-header .task-help-btn {
    opacity: 0;
}

.task-help-btn:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.task-help-btn img {
    width: 20px;
    height: 20px;
    transition: transform 0.15s;
    filter: brightness(0) saturate(100%);
    opacity: 0.6;
}

.task-help-btn:hover img {
    transform: scale(1.1);
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(40%) sepia(100%) saturate(1500%) hue-rotate(190deg);
}

/* Hide help button in edit mode */
.main-content:not(.full-width) .task-help-btn {
    display: none;
}

.task:last-child {
    border-bottom: none;
}

/* Child tasks - hide left border color strip */
.task.is-child {
    border-left: none;
    border-bottom: none;
}

.task.is-child .task-title {
    font-size: 14px;
    color: #333;
}

.task.is-child:last-child {
    margin-bottom: 0;
}

/* Hover behavior:
   - Child hover: ONLY that child highlights
   - Parent hover: ONLY that parent highlights (not children) */

/* Only enable hover effects in edit mode (when sidebar is visible) */
.main-content:not(.full-width) .task:hover > .task-header {
    background: var(--hover-bg);
}

/* When a child task is hovered, reset the parent's background */
.main-content:not(.full-width) .task:not(.editing):has(.task:hover) > .task-header {
    background: white;
}

.task.completed {
    opacity: 0.5;
}

.task.locked {
    opacity: 0.4;
}

.task-checkbox {
    margin-top: 2px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    border: 2px solid #d0d0d0;
    background: white;
    transition: all 0.2s;
}

/* Hide checkbox for parent tasks */
.task.has-children > .task-header > .task-checkbox {
    display: none;
}

.task-checkbox:checked {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.task-checkbox:checked::after {
    content: 'âœ“';
    display: block;
    text-align: center;
    color: white;
    font-size: 16px;
    line-height: 20px;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-size: 16px;
    word-wrap: break-word;
}

.task-title-input {
    font-size: 16px;
    font-family: inherit;
    font-weight: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    padding: 6px 8px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

.task-title-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.task-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
    word-break: break-word;
}

.task-description a {
    color: var(--accent-color);
    text-decoration: underline;
}

.task-description a:hover {
    text-decoration: none;
}

.task.completed .task-title {
    text-decoration: line-through;
}

.task-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-due-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.task-link-icon {
    color: var(--text-muted);
    font-size: 14px;
}

.task-drag-handle:active {
    cursor: grabbing;
}

/* Add Task Section */
.add-task-section {
    position: sticky;
    bottom: 0;
    background: var(--bg-primary);
    padding: 20px 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.add-task-section.hidden {
    display: none;
}

.add-task-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    opacity: 0.9;
}

.add-task-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.add-task-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.2s;
    z-index: 2;
}

.input-prefix-wrapper {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    pointer-events: none;
}

/* Enable pointer events when input is focused */
#addTaskForm:has(#newTaskInput:focus) .input-prefix-wrapper {
    pointer-events: auto;
}

.input-prefix {
    font-size: 16px;
    font-weight: 600;
    color: var(--accent-color);
    cursor: default;
    user-select: none;
    display: inline-flex;
    align-items: center;
    padding: 4px 8px 4px 0;
    border-radius: 4px;
    transition: background-color 0.2s, cursor 0.2s;
}

.input-prefix i {
    margin-right: 6px;
    font-size: 18px;
}

/* Only show pointer cursor when input is focused */
#addTaskForm:has(#newTaskInput:focus) .input-prefix {
    cursor: pointer;
}

#addTaskForm:has(#newTaskInput:focus) .input-prefix:hover {
    background-color: rgba(var(--accent-color-rgb), 0.1);
}

.prefix-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-primary);
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 160px;
    z-index: 1000;
    pointer-events: auto;
}

.prefix-dropdown.active {
    display: block;
}

.prefix-group-header {
    padding: 8px 16px 4px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    cursor: default;
    user-select: none;
}

.prefix-group-header:first-child {
    border-top: none;
    border-radius: 4px 4px 0 0;
}

.prefix-option {
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.prefix-option i {
    margin-right: 8px;
    font-size: 18px;
}

.prefix-option:hover {
    background-color: rgba(var(--accent-color-rgb), 0.1);
    color: var(--accent-color);
}

.prefix-option:last-child {
    border-radius: 0 0 4px 4px;
}

#newTaskInput {
    width: 100%;
    padding: 18px 52px 18px 44px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    transition: all 0.2s;
}

.add-task-toolkit-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
    z-index: 2;
    line-height: 1;
}

.add-task-toolkit-btn:hover {
    color: var(--accent-color);
    background-color: var(--bg-secondary);
}

#newTaskInput:focus {
    border-color: var(--accent-color);
    /* padding-left will be set dynamically by JavaScript */
}

#addTaskForm:has(#newTaskInput:focus) .input-prefix-wrapper {
    opacity: 1;
}

#newTaskInput:focus ~ .add-task-icon {
    color: var(--accent-color);
}

#addTaskForm:has(#newTaskInput:focus) .add-task-icon {
    color: var(--accent-color);
}

#newTaskInput:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-secondary);
}

#addTaskForm.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #3a7bc8;
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c9302c;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s;
}

.modal-wide {
    max-width: 800px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content h2 {
    margin-bottom: 24px;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 60px;
}

.btn-advanced-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s;
    text-decoration: none;
}

.btn-advanced-toggle:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.btn-advanced-toggle i {
    font-size: 12px;
    transition: transform 0.2s;
}

.btn-advanced-toggle.active i {
    transform: rotate(180deg);
}

.advanced-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.advanced-options.show {
    max-height: 500px;
}

.form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-color);
}

.subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 14px;
}

.subtask-item input[type="checkbox"] {
    cursor: pointer;
}

.subtask-item .subtask-title {
    flex: 1;
}

.subtask-item .delete-subtask {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    font-size: 16px;
}

.subtask-item .delete-subtask:hover {
    color: #e74c3c;
}

.subtask-input-group {
    display: flex;
    gap: 8px;
}

.subtask-input-group input {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.form-actions-right {
    display: flex;
    gap: 12px;
}

.form-actions-primary {
    padding-bottom: 20px;
    margin-top: 16px;
}

.form-separator {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

.subtasks-section {
    padding-top: 8px;
}

.subtasks-section label {
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
    min-height: 200px;
}

.group-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid var(--accent-color);
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.group-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.group-card[data-color="red"] { border-left-color: #e74c3c; }
.group-card[data-color="orange"] { border-left-color: #e67e22; }
.group-card[data-color="yellow"] { border-left-color: #f39c12; }
.group-card[data-color="green"] { border-left-color: #27ae60; }
.group-card[data-color="blue"] { border-left-color: #3498db; }
.group-card[data-color="purple"] { border-left-color: #9b59b6; }
.group-card[data-color="pink"] { border-left-color: #e91e63; }

.group-card.inactive {
    opacity: 0.5;
    background: var(--bg-secondary);
}

.group-card.inactive .group-card-title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.group-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    word-break: break-word;
}

.group-card-count {
    font-size: 13px;
    color: var(--text-muted);
}

.group-card-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.group-card:hover .group-card-actions {
    opacity: 1;
}

.group-card-actions button {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    border-radius: 4px;
    transition: background 0.2s;
}

.group-card-actions button:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.group-card-actions .delete-btn:hover {
    background: var(--danger-color);
    color: white;
}


/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state small {
    font-size: 14px;
}

/* Drag and Drop - Vanilla nested support */

/* Blue line indicator showing where task will drop */
.drop-line {
    height: 2px;
    border-radius: 999px;
    background: var(--accent-color);
    margin: 2px 0;
    pointer-events: none;
}

/* Nest highlight when hovering over a task to nest */
.drop-nest {
    outline: 2px solid var(--accent-color);
    background: rgba(74, 144, 226, 0.06);
}

/* Goal cards when being nested */
.goal-card.drop-nest {
    outline: 2px solid var(--accent-color);
    background: rgba(74, 144, 226, 0.08);
    transform: scale(1.02);
}

/* Ghost element that follows cursor */
.drag-ghost {
    position: fixed !important;
    left: 0;
    top: 0;
    z-index: 99999;
    pointer-events: none;
    opacity: 0.8;
    touch-action: none;
    transform: translate3d(0, 0, 0);
    transition: none !important;
    will-change: transform;
}

.drag-ghost-active {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15));
}

/* Original element being dragged */
.is-dragging {
    opacity: 0.25;
    -webkit-user-select: none;
    user-select: none;
}

/* Responsive */
@media (max-width: 768px) {
    /* App wrapper - remove left margin on mobile */
    .app-wrapper {
        margin-left: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Container and layout */
    .container {
        padding: 12px;
    }
    
    .header {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    /* Edit mode bar - full width toggle at bottom on mobile */
    .edit-mode-bar {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        height: 56px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 1000;
    }
    
    .edit-mode-bar-content {
        flex-direction: row;
        gap: 12px;
        font-size: 13px;
    }
    
    .edit-mode-bar-content i {
        font-size: 18px;
    }
    
    /* Show mobile close button on sidebar */
    .btn-close-sidebar {
        display: flex;
    }
    
    /* When sidebar is open, hide the edit mode bar on mobile */
    body:has(.sidebar:not(.hidden)) .edit-mode-bar {
        display: none;
    }
    
    /* Sidebar - full screen overlay on mobile, appears instantly */
    .sidebar {
        width: 100vw;
        max-width: 100vw;
        box-shadow: none;
        z-index: 10000;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        transform: none;
    }
    
    .sidebar.hidden {
        transform: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    
    /* Backdrop overlay when sidebar is open */
    body:has(.sidebar:not(.hidden))::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        pointer-events: auto;
        animation: fadeIn 0.2s ease;
    }
    
    /* Main content - full width on mobile */
    .main-content {
        margin-left: 0;
        padding-bottom: 72px;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .main-content.full-width {
        margin-left: 0;
        padding-bottom: 72px;
        max-width: 100vw;
    }
    
    body:has(.sidebar:not(.hidden)) .main-content {
        padding-bottom: 20px;
        padding-right: 0;
        max-width: 100vw;
    }
    
    /* Container - ensure it doesn't overflow */
    .container {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Touch-friendly buttons and inputs */
    button, .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
    }
    
    input, textarea, select {
        min-height: 44px;
        font-size: 16px;
        padding: 12px;
    }
    
    .task-checkbox {
        width: 24px;
        height: 24px;
        min-width: 24px;
    }
    
    /* Group headers more touch-friendly */
    .group-header {
        padding: 16px;
        min-height: 56px;
    }
    
    .group-title {
        font-size: 20px;
    }
    
    .btn-edit-tasks {
        min-height: 44px;
        padding: 8px 16px;
        font-size: 13px;
    }
    
    /* Task items - reduce vertical spacing */
    .task-header {
        padding: 6px 12px;
        padding-left: 14px;
        gap: 10px;
    }
    
    .task.has-children > .task-header {
        padding: 6px 12px;
        padding-left: 14px;
    }
    
    /* Reduce nesting indentation to prevent squashing */
    .task-children {
        padding-left: 12px;
        margin-left: 12px;
        padding-top: 0;
        padding-bottom: 0;
    }
    
    .task-title {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Modals full screen on mobile */
    .modal-content {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .modal-header {
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-radius: 0;
    }
    
    .modal-footer {
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 10;
        border-radius: 0;
    }
    
    /* Add task form */
    .add-task-section {
        padding: 12px;
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid var(--border-color);
        z-index: 100;
    }
    
    body:has(.sidebar:not(.hidden)) .add-task-section {
        bottom: auto;
    }
    
    /* Hide drag handles completely on mobile (dragging disabled) */
    .drag-handle {
        display: none;
    }
    
    /* User dropdown */
    .user-dropdown {
        right: 12px;
        left: 12px;
        min-width: auto;
    }
    
    /* Sidebar groups */
    .sidebar-group {
        padding: 14px 16px;
        min-height: 52px;
    }
    
    /* More tasks indicator */
    .more-tasks-count {
        font-size: 13px;
        padding: 6px 12px;
    }
    
    /* Delete and edit buttons in tasks */
    .task-actions {
        gap: 12px;
    }
    
    .task-delete-btn,
    .task-edit-btn {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Prevent zoom on input focus */
    input:focus,
    textarea:focus,
    select:focus {
        font-size: 16px;
    }
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.user-initial {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    border: 2px solid var(--border-color);
}

.user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-info {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.user-info small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: var(--hover-bg);
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Mobile-specific enhancements */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .task:hover,
    .btn:hover,
    .dropdown-item:hover {
        background: inherit;
        transform: none;
    }
    
    /* Add active/pressed states for touch feedback */
    .task:active {
        background: var(--hover-bg);
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.95);
    }
    
    /* Larger touch targets */
    .task-checkbox {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }
    
    /* Better tap highlighting */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Improve scrolling on iOS */
    .sidebar,
    .main-content,
    .modal-content {
        -webkit-overflow-scrolling: touch;
    }
}

/* Landscape mode optimizations for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .edit-mode-bar {
        height: 48px;
    }
    
    .modal-content {
        max-height: 100vh;
        overflow-y: auto;
    }
    
    .header {
        padding: 8px 12px;
    }
}

/* Small screens (phones) */
@media (max-width: 480px) {
    .logo {
        font-size: 20px;
    }
    
    .group-title {
        font-size: 18px;
    }
    
    .browsing-parent-title {
        font-size: 22px;
    }
    
    .browsing-parent-description {
        font-size: 14px;
    }
    
    .header-description-input {
        font-size: 14px;
    }
    
    .browsing-parent-breadcrumbs .breadcrumb-link {
        font-size: 12px;
    }
    
    .browsing-parent-breadcrumbs .breadcrumb-separator {
        font-size: 9px;
    }
    
    .browsing-parent-header {
        padding: 0;
    }
    
    .btn-back-browsing {
        width: 44px;
        font-size: 18px;
    }
    
    .browsing-parent-content {
        padding: 20px 16px;
    }
    
    .input-prefix-wrapper {
        left: 40px;
    }
    
    .input-prefix {
        font-size: 14px;
    }
    
    .task-title {
        font-size: 15px;
    }
    
    .btn-edit-tasks span {
        display: none;
    }
    
    .btn-edit-tasks::after {
        content: 'EDIT';
    }
}
/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    .edit-mode-bar {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
    
    .add-task-section {
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
}

/* Breakdown Modal Styling */
.breakdown-modal {
    max-width: 720px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 0 !important;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.breakdown-header {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-radius: 20px 20px 0 0;
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-title-section {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.breakdown-icon {
    font-size: 48px;
    line-height: 1;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.breakdown-header h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    display: flex;
    align-items: center;
}

.breakdown-subtitle {
    margin: 8px 0 0 0;
    font-size: 16px;
    opacity: 1;
    color: var(--text-secondary);
}

.breakdown-header .btn-close {
    color: var(--text-secondary);
    opacity: 0.8;
    font-size: 28px;
    width: 40px;
    height: 40px;
}

.breakdown-header .btn-close:hover {
    opacity: 1;
    color: var(--text-primary);
}

.breakdown-header .modal-close {
    color: var(--text-secondary);
    opacity: 0.8;
}

.breakdown-header .modal-close:hover {
    opacity: 1;
    color: var(--text-primary);
}

.breakdown-body {
    padding: 48px;
}

.breakdown-task-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    padding: 28px 32px;
    border-radius: 16px;
    margin-bottom: 40px;
    border-left: 4px solid #667eea;
}

.breakdown-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 10px;
}

.breakdown-task-name {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.breakdown-list-section {
    margin-bottom: 40px;
    min-height: 200px;
}

.breakdown-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.breakdown-steps-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.breakdown-progress {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.breakdown-subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-subtasks-list:empty::before {
    content: 'âœ¨ No steps yet - add your first one below!';
    display: block;
    padding: 60px 32px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.breakdown-subtask-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.breakdown-subtask-item:hover {
    border-color: #667eea;
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.breakdown-subtask-item input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.breakdown-subtask-item span {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
    transition: all 0.2s;
}

.breakdown-subtask-item input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.add-subtask-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 2px solid var(--border-color);
}

.add-subtask-input-group {
    display: flex;
    gap: 16px;
    align-items: stretch;
}

.breakdown-input {
    flex: 1;
    font-size: 16px;
    padding: 18px 24px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.breakdown-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.breakdown-input::placeholder {
    color: var(--text-muted);
    font-size: 16px;
}

.breakdown-add-btn {
    width: 60px;
    padding: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    transition: all 0.2s;
}

.breakdown-add-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.breakdown-add-btn i {
    font-size: 20px;
}

.breakdown-footer {
    padding: 24px 48px;
    background: var(--bg-secondary);
    border-radius: 0 0 20px 20px;
    display: flex;
    justify-content: flex-end;
}

.breakdown-footer .btn {
    min-width: 120px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
}

/* Breakdown Choice Options */
.breakdown-options {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px dashed var(--border-color);
}

.breakdown-option-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    flex: 1;
    min-width: calc(50% - 8px);
}

.breakdown-option-btn:hover {
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.breakdown-option-btn i {
    font-size: 32px;
    color: #667eea;
    flex-shrink: 0;
}

.breakdown-option-content {
    flex: 1;
    text-align: left;
}

.breakdown-option-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.breakdown-option-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Back Button */
.btn-back {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    font-size: 24px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    margin-right: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateX(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.btn-back:active {
    transform: translateX(-1px) scale(0.97);
}

/* Browsing Parent Header (Goals Tab) */
.browsing-parent-header {
    display: flex;
    align-items: stretch;
    padding: 0;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    margin-top: 20px;
    overflow: hidden;
}

.btn-back-browsing {
    background: var(--accent-color);
    border: none;
    color: white;
    font-size: 20px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: none;
    border-right: 2px solid var(--border-color);
}

.btn-back-browsing:hover {
    background: #5568d3;
    transform: none;
    box-shadow: none;
}

.btn-back-browsing:active {
    transform: none;
    background: #4a5bbf;
}

.browsing-parent-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 20px;
}

.browsing-parent-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.browsing-parent-breadcrumbs .breadcrumb-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.browsing-parent-breadcrumbs .breadcrumb-link:hover {
    color: var(--accent-color);
}

.browsing-parent-breadcrumbs .breadcrumb-separator {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.5;
}

.browsing-parent-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.browsing-parent-title.editable-title {
    cursor: pointer;
    transition: color 0.2s;
    border-radius: 4px;
    padding: 4px 8px;
    margin: -4px -8px;
}

.browsing-parent-title.editable-title:hover {
    color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.05);
}

.header-title-input {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    padding: 4px 8px;
    background: var(--bg-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
}

.header-title-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.1);
}

.browsing-parent-description {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
    white-space: pre-wrap;
}

.browsing-parent-description.editable-description {
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border-radius: 4px;
    padding: 6px 8px;
    margin: 8px -8px 0 -8px;
    min-height: 32px;
}

.browsing-parent-description.editable-description:hover {
    background: rgba(var(--accent-color-rgb), 0.05);
}

.description-placeholder {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.6;
}

.header-description-input {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-primary);
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    padding: 6px 8px;
    background: var(--bg-primary);
    width: 100%;
    outline: none;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 60px;
}

.header-description-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-color-rgb), 0.1);
}

/* Context Input Section */
.context-input-section {
    margin-top: 32px;
}

.context-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.context-input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.context-prefix {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    padding: 0 4px;
    line-height: 1.5;
}

.context-textarea {
    width: 100%;
    font-size: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    resize: vertical;
    min-height: 100px;
    max-height: 300px;
    font-family: inherit;
    line-height: 1.5;
    transition: all 0.2s;
}

.context-textarea:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.context-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
    font-style: italic;
}

.context-help {
    display: block;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* Hierarchy Sections */
.breakdown-hierarchy-section {
    margin: 20px 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f2ff 100%);
    border-radius: 12px;
    border: 1px solid #e0e4ff;
}

.breakdown-hierarchy-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #667eea;
    margin-bottom: 12px;
}

.breakdown-hierarchy-header i {
    font-size: 14px;
}

.breakdown-hierarchy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.breakdown-hierarchy-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e4ff;
    font-size: 14px;
    color: var(--text-primary);
    transition: all 0.2s;
    line-height: 1.5;
}

.breakdown-hierarchy-item:hover {
    border-color: #667eea;
    background: #fafbff;
    transform: translateX(4px);
}

.breakdown-hierarchy-item i {
    font-size: 12px;
    color: #667eea;
    flex-shrink: 0;
}

.breakdown-hierarchy-item.completed {
    opacity: 0.5;
}

.breakdown-hierarchy-item.completed span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.breakdown-hierarchy-item.completed i {
    color: var(--success-color);
}

/* Vertical Flow Layout (WHY â†’ TASK â†’ HOW) */
.breakdown-vertical-flow {
    max-width: 520px;
    margin: 0 auto;
    padding: 40px 32px !important;
}

/* WHY Section (Parent Goal - subtle, contextual) */
.breakdown-why-section {
    margin-bottom: 24px;
    text-align: center;
}

.breakdown-parent-chain {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.breakdown-context-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    opacity: 1;
}

.breakdown-parent-item {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

.breakdown-parent-item:hover {
    color: var(--text-primary);
    opacity: 1;
}

.breakdown-parent-item i {
    font-size: 10px;
    opacity: 0.85;
}

.breakdown-parent-item-category {
    background: rgba(var(--accent-color-rgb), 0.08);
    color: var(--text-primary);
    opacity: 1;
    font-weight: 600;
    margin-bottom: 6px;
    cursor: default;
}

.breakdown-parent-item-category:hover {
    background: rgba(var(--accent-color-rgb), 0.08);
    color: var(--text-primary);
    opacity: 1;
}

.breakdown-parent-chain:empty {
    display: none;
}

.breakdown-why-section:empty + .breakdown-separator {
    display: none;
}

/* Separator Line */
.breakdown-separator {
    height: 1px;
    background: linear-gradient(to right, transparent 20%, rgba(0,0,0,0.06) 50%, transparent 80%);
    margin: 28px 0;
}

/* TASK Section (Center - main focus) */
.breakdown-task-section {
    text-align: center;
    margin-bottom: 32px;
}

.breakdown-task-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px 12px;
    border-radius: 6px;
}

.breakdown-task-title:hover {
    color: var(--accent-color);
    background: rgba(var(--accent-color-rgb), 0.03);
}

.breakdown-task-description {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.55;
    cursor: pointer;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 4px;
    min-height: 22px;
    opacity: 1;
}

.breakdown-task-description:hover {
    opacity: 0.8;
    background: rgba(var(--accent-color-rgb), 0.03);
}

.breakdown-task-description:empty::before {
    content: 'Add description...';
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.7;
}

/* HOW Section (Steps - below the task) */
.breakdown-how-section {
    margin-bottom: 24px;
}

.breakdown-children-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.breakdown-child-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.breakdown-child-item:hover {
    background: #ffffff;
    border-color: rgba(var(--accent-color-rgb), 0.45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.breakdown-child-item.has-children::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 9px;
    color: var(--text-muted);
    margin-left: auto;
    opacity: 0.3;
    transition: all 0.2s;
}

.breakdown-child-item.has-children:hover::after {
    opacity: 0.6;
    transform: translateX(2px);
}

.breakdown-child-item i {
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.breakdown-child-item.completed {
    opacity: 0.5;
}

.breakdown-child-item.completed span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.breakdown-child-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

.breakdown-child-item-text {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.breakdown-child-item-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 2px;
}

.breakdown-child-item-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.35;
    opacity: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breakdown-children-empty {
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 1;
    padding: 10px 12px;
    font-style: italic;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

.breakdown-add-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto;
}

.breakdown-add-inline-btn:hover {
    color: var(--accent-color);
}

.breakdown-add-inline-btn i {
    font-size: 11px;
}

/* Quick Actions (Minimal links at bottom) */
.breakdown-quick-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.04);
    flex-wrap: wrap;
    opacity: 1;
}

.breakdown-action-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
}

.breakdown-action-link:hover {
    color: var(--accent-color);
}

.breakdown-action-link i {
    font-size: 10px;
}

.breakdown-action-link-danger {
    color: #b42318;
}

.breakdown-action-link-danger:hover {
    color: #912018;
}

/* Idea Pros/Cons Exploration Styles */
.idea-procon-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.idea-procon-item:hover {
    background: rgba(0, 0, 0, 0.02);
}

.idea-pro-item {
    background: rgba(76, 175, 80, 0.04);
    border-left: 3px solid rgba(76, 175, 80, 0.4);
}

.idea-pro-item:hover {
    background: rgba(76, 175, 80, 0.08);
}

.idea-con-item {
    background: rgba(244, 67, 54, 0.04);
    border-left: 3px solid rgba(244, 67, 54, 0.4);
}

.idea-con-item:hover {
    background: rgba(244, 67, 54, 0.08);
}

.idea-procon-icon {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.5;
    flex-shrink: 0;
    width: auto;
    min-width: 38px;
    text-align: left;
    margin-top: 0;
}

.idea-pro-item .idea-procon-icon {
    color: rgba(76, 175, 80, 0.9);
}

.idea-con-item .idea-procon-icon {
    color: rgba(244, 67, 54, 0.9);
}

.idea-procon-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.idea-procon-text {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
    cursor: pointer;
}

.idea-procon-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.idea-procon-item:hover .idea-procon-actions {
    opacity: 1;
}

/* Nested container for rebuttals in breakdown view */
.idea-procon-nested {
    display: block;
    flex-basis: 100%;
    margin-top: 8px;
    margin-left: 0;
    padding-left: 24px;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
}

.idea-procon-add-btn {
    background: rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.3);
    color: var(--accent-color);
    padding: 4px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.idea-procon-however-btn {
    background: rgba(156, 39, 176, 0.1);
    border: 1px solid rgba(156, 39, 176, 0.3);
    color: rgba(156, 39, 176, 0.9);
    padding: 4px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-style: italic;
    transition: all 0.2s;
}

.idea-procon-add-btn:hover {
    background: rgba(74, 144, 226, 0.2);
    border-color: rgba(74, 144, 226, 0.5);
    transform: scale(1.05);
}

.idea-procon-however-btn:hover {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.5);
    transform: scale(1.05);
}

.idea-procon-delete-btn {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: rgba(244, 67, 54, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.idea-procon-delete-btn:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.5);
    transform: scale(1.05);
}

.idea-add-procon-section {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.idea-add-pro-btn,
.idea-add-con-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1.5px dashed rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.idea-add-pro-btn {
    color: rgba(76, 175, 80, 0.9);
    border-color: rgba(76, 175, 80, 0.3);
}

.idea-add-pro-btn:hover {
    background: rgba(76, 175, 80, 0.08);
    border-color: rgba(76, 175, 80, 0.5);
    border-style: solid;
}

.idea-add-con-btn {
    color: rgba(244, 67, 54, 0.9);
    border-color: rgba(244, 67, 54, 0.3);
}

.idea-add-con-btn:hover {
    background: rgba(244, 67, 54, 0.08);
    border-color: rgba(244, 67, 54, 0.5);
    border-style: solid;
}

.idea-procon-input-wrapper {
    margin-bottom: 6px;
}

.idea-procon-input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
}

.idea-procon-input-container.pro {
    background: rgba(76, 175, 80, 0.08);
    border-left: 3px solid rgba(76, 175, 80, 0.6);
}

.idea-procon-input-container.con {
    background: rgba(244, 67, 54, 0.08);
    border-left: 3px solid rgba(244, 67, 54, 0.6);
}

.idea-procon-input-container .idea-procon-icon {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: auto;
    min-width: 38px;
    text-align: left;
    flex-shrink: 0;
}

.idea-procon-input-container.pro .idea-procon-icon {
    color: rgba(76, 175, 80, 0.9);
}

.idea-procon-input-container.con .idea-procon-icon {
    color: rgba(244, 67, 54, 0.9);
}

.idea-procon-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    padding: 4px 0;
}

.idea-procon-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.idea-procon-input-cancel {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
}

.idea-procon-input-cancel:hover {
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

/* Inline Edit Form Styles */
.task-inline-edit {
    background: transparent;
    padding: 0 16px 12px 58px;
    margin: 0;
    animation: slideDown 0.2s ease-out;
    display: none !important
}

/* Adjust padding for parent tasks without checkboxes */
.task.has-children .task-inline-edit {
    padding-left: 20px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 1000px;
    }
}

.task.editing {
    background: #F5F5F5 !important;
}

.task.editing > .task-header {
    padding-bottom: 4px;
}

.task.editing .task-description {
    display: none;
}

/* Hide the main "Add a task..." box when editing */
body:has(.task.editing) .add-task-section {
    display: none;
}

.inline-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.inline-edit-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-close-inline {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close-inline:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.inline-edit-form .form-group {
    margin-bottom: 8px;
}

.inline-edit-form .form-group:first-of-type {
    margin-top: 8px;
}

.inline-edit-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

.inline-edit-form input[type="text"],
.inline-edit-form select,
.inline-edit-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.inline-edit-form input[type="text"]:focus,
.inline-edit-form select:focus,
.inline-edit-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.inline-edit-form textarea {
    resize: vertical;
    min-height: 60px;
}

/* Goal Cards - for Goals tab */
.goals-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0;
}

.goal-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 32px 24px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    grid-column: span 1; /* Goals span half width */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.goal-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    border-color: rgba(74, 144, 226, 0.4);
}

.goal-card-content {
    flex: 1;
    min-width: 0;
}

.goal-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.goal-card:hover .goal-card-actions {
    opacity: 1;
}

.goal-card-help-btn {
    background: rgba(74, 144, 226, 0.15);
    border: 1.5px solid rgba(74, 144, 226, 0.4);
    padding: 6px 10px;
    cursor: pointer;
    color: var(--accent-color);
    transition: all 0.2s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   horizontal VIEW (MAP TAB)
   ============================================ */

.horizontal-board {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 20px;
    overflow-x: auto;
    height: calc(100vh - 200px);
    align-items: flex-start;
    /* Fill width from main-content edge (after sidebar) to viewport right edge */
    width: calc(100vw - 320px);
    margin-left: calc(-1 * ((100vw - 320px - 720px) / 2 + 20px));
    box-sizing: border-box;
    user-select: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.horizontal-board::-webkit-scrollbar {
    height: 4px;
}

.horizontal-board::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-board::-webkit-scrollbar-button {
    display: none;
    width: 0;
}

.horizontal-board::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 99px;
}

.horizontal-board::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.horizontal-column {
    min-width: 260px;
    max-width: 440px;
    width: auto;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    max-height: 100%;
    flex-shrink: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.horizontal-column::-webkit-scrollbar {
    width: 4px;
}

.horizontal-column::-webkit-scrollbar-track {
    background: transparent;
}

.horizontal-column::-webkit-scrollbar-button {
    display: none;
    height: 0;
}

.horizontal-column::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 99px;
}

.horizontal-column::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.horizontal-column-header {
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px 8px 0 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    white-space: normal;
    user-select: none;
}

.horizontal-column-content {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.horizontal-card {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 9px;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    user-select: none;
}

.horizontal-card:last-child {
    border-bottom: none;
}

/* Single task columns: add gaps between cards and borders around them */
.horizontal-single-task {
    border: none;
    background: transparent;
}

.horizontal-single-task .horizontal-column-content {
    gap: 12px;
    padding: 0;
}

.horizontal-single-task .horizontal-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.horizontal-single-task .horizontal-card:last-child {
    border-bottom: 1px solid #e5e7eb;
}

.horizontal-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.horizontal-card-label {
    flex: 1;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
    cursor: default;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    white-space: normal;
    user-select: none;
}

/* Label without checkbox should have same visual weight */
.horizontal-card:not(:has(.horizontal-checkbox)) .horizontal-card-label {
    font-weight: 500;
}

.horizontal-nested {
    padding-left: 0;
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    user-select: none;
}

/* Nested items within nested items also follow same pattern */
.horizontal-card-nested .horizontal-nested {
    padding-left: 0;
}

.horizontal-card-nested {
    padding: 4px 31px;
    font-size: 13px;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    border-bottom: none !important;
    display: flex;
    align-items: center;
    user-select: none;
}

/* Ensure no borders on any nested cards at any level */
.horizontal-nested .horizontal-card {
    border-bottom: none !important;
}

.horizontal-card-nested .horizontal-card-label {
    font-size: 13px;
    color: #6b7280;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
    white-space: normal;
    padding: 2px 0;
}

.horizontal-empty-column {
    text-align: center;
    padding: 40px 16px;
    color: #9ca3af;
    font-size: 13px;
    font-style: italic;
}

.horizontal-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 15px;
}

/* Map View Drag and Drop Styles */
.map-drop-line {
    height: 2px;
    border-radius: 999px;
    background: var(--accent-color);
    margin: 2px 0;
    pointer-events: none;
}

.map-column-drop-line {
    width: 2px;
    background: var(--accent-color);
    border-radius: 999px;
    align-self: stretch;
    margin: 6px 2px;
    pointer-events: none;
    flex-shrink: 0;
    opacity: 0.95;
}

/* Align drop line with nested card content (not the container edge) */
.horizontal-nested > .map-drop-line {
    margin-left: 31px;
    width: calc(100% - 31px);
    box-sizing: border-box;
}

.map-drop-nest {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent-color);
    background: rgba(74, 144, 226, 0.06);
    position: relative;
    z-index: 1;
}

.map-drag-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 99999;
    pointer-events: none;
    opacity: 0.92;
    transform: translate3d(0, 0, 0);
    background: none !important;
    will-change: transform;
}

.map-drag-ghost .horizontal-card {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.map-is-dragging {
    opacity: 0.25;
}

.map-column-is-dragging {
    opacity: 0.35;
}

/* =============================================
   Toolkit / Breakdown Choice Screen (Redesigned)
   ============================================= */

.breakdown-choice-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 40px 24px;
    border-radius: 20px 20px 0 0;
}

.breakdown-choice-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.breakdown-toolkit-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
}

.breakdown-close-btn {
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.breakdown-close-btn:hover {
    background: rgba(255,255,255,0.3);
}

.breakdown-choice-header h2 {
    margin: 0;
    color: #ffffff;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

.breakdown-choice-body {
    padding: 32px 40px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.breakdown-what-section {
    padding: 4px 0 8px;
}

.breakdown-why-section {
    padding: 0;
    margin: 0;
    background: none;
    border-radius: 0;
}

.breakdown-why-chain {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.breakdown-why-ancestor {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
}

.breakdown-why-ancestor-direct {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.breakdown-why-chevron {
    font-size: 8px;
    color: var(--text-muted);
    opacity: 0.45;
}

.breakdown-choice-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.breakdown-what-card {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.breakdown-what-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    cursor: pointer;
    border-radius: 6px;
    padding: 2px 4px;
    margin: 0 -4px;
    transition: background 0.15s;
}

.breakdown-what-title:hover {
    background: rgba(102, 126, 234, 0.07);
}

.breakdown-what-title-input {
    display: block;
    width: 100%;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    padding: 2px 6px;
    outline: none;
    font-family: inherit;
    line-height: 1.3;
    box-sizing: border-box;
}

.breakdown-what-desc {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.55;
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
    margin-left: -4px;
    min-height: 20px;
    transition: background 0.15s;
}

.breakdown-what-desc:empty::before {
    content: 'Add a description...';
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.6;
}

.breakdown-what-desc:hover {
    background: rgba(102, 126, 234, 0.07);
}

.breakdown-what-desc-input {
    display: block;
    width: 100%;
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    padding: 4px 6px;
    outline: none;
    font-family: inherit;
    line-height: 1.55;
    resize: vertical;
    box-sizing: border-box;
}

.breakdown-why-content {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

.breakdown-why-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.breakdown-why-item i {
    font-size: 12px;
    color: #667eea;
    flex-shrink: 0;
}

.breakdown-dashed-hr {
    border: none;
    border-top: 2px dashed var(--border-color);
    margin: 2px 0;
}

.breakdown-feeling-prompt {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}

.breakdown-choice-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-choice-half-row {
    display: flex;
    gap: 12px;
}

.breakdown-choice-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.breakdown-choice-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.breakdown-choice-card-full {
    flex: none;
}

.breakdown-choice-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.breakdown-icon-blue {
    background: rgba(102, 126, 234, 0.12);
    color: #667eea;
}

.breakdown-icon-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.breakdown-choice-card-icon i {
    font-size: 20px;
}

.breakdown-choice-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.breakdown-choice-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.breakdown-choice-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.breakdown-choice-card-arrow {
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.5;
    flex-shrink: 0;
}

.breakdown-choice-footer {
    padding: 14px 40px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 0 0 20px 20px;
}

/* Override legacy ID rule so breakItDownBtn sizes correctly in the new layout */
#breakItDownBtn {
    flex: none;
    min-width: unset;
    width: 100%;
}

/* Worries screen styles */
.breakdown-task-card-worries {
    border-left-color: #667eea;
}

.worries-intro {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
    font-style: italic;
}

.worry-item {
    cursor: default;
}

.worry-item-icon {
    font-size: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.worry-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.15s;
    margin-left: auto;
    flex-shrink: 0;
}

.worry-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.breakdown-add-btn-worries {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none;
}



.goal-card-help-btn:hover {
    background: rgba(74, 144, 226, 0.25);
    border-color: rgba(74, 144, 226, 0.6);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

.goal-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-color);
    opacity: 0.8;
}

/* Task cards (without children) - lighter styling */
.goal-card-task {
    background: rgba(250, 251, 255, 0.5);
    border-color: rgba(0, 0, 0, 0.06);
    grid-column: span 1; /* Tasks span half width */
}

.goal-card-task:hover {
    background: rgba(250, 251, 255, 0.8);
}

.goal-card-task::before {
    width: 2px;
    opacity: 0.5;
}

.goal-card-task .goal-card-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.goal-card-task .goal-card-subtasks {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

.goal-card-task .goal-card-subtasks i {
    font-size: 9px;
    opacity: 0.7;
}

.group[data-color="red"] .goal-card::before { background: #e74c3c; }
.group[data-color="orange"] .goal-card::before { background: #e67e22; }
.group[data-color="yellow"] .goal-card::before { background: #f39c12; }
.group[data-color="green"] .goal-card::before { background: #27ae60; }
.group[data-color="blue"] .goal-card::before { background: #3498db; }
.group[data-color="purple"] .goal-card::before { background: #9b59b6; }
.group[data-color="pink"] .goal-card::before { background: #e91e63; }

.goal-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    line-height: 1.4;
}

/* Tasks section below goals */
.goals-tasks-separator {
    grid-column: 1 / -1;
    margin-top: 12px;
    margin-bottom: 12px;
    width: 100%;
}

.goals-tasks-separator span {
    font-size: 11px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.35);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.goals-tasks-list {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.goals-task-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: grab;
    transition: all 0.2s;
    gap: 12px;
}

.goals-task-item:hover {
    background: rgba(250, 251, 255, 0.8);
    border-color: rgba(74, 144, 226, 0.3);
}

.goals-task-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.goals-task-item-content {
    flex: 1;
    min-width: 0;
}

.goals-task-item-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.goals-task-item-title.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

.goals-task-item-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.goals-task-item-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.goals-task-item:hover .goals-task-item-actions {
    opacity: 1;
}

.goals-task-help-btn {
    background: rgba(74, 144, 226, 0.15);
    border: 1.5px solid rgba(74, 144, 226, 0.4);
    padding: 4px 8px;
    cursor: pointer;
    color: var(--accent-color);
    transition: all 0.2s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.goals-task-help-btn:hover {
    background: rgba(74, 144, 226, 0.25);
    border-color: rgba(74, 144, 226, 0.6);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
}

/* Pro/Con Add Buttons in Goals View */
.goals-procon-add-btn {
    background: #ffffff;
    border: 1px solid rgba(74, 144, 226, 0.25);
    padding: 6px 12px;
    cursor: pointer;
    color: #4a90e2;
    transition: all 0.2s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.goals-procon-however-btn {
    background: #ffffff;
    border: 1px solid rgba(156, 39, 176, 0.25);
    padding: 5px 10px;
    cursor: pointer;
    color: #9c27b0;
    transition: all 0.2s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    font-style: italic;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.goals-procon-add-btn:hover {
    background: rgba(74, 144, 226, 0.08);
    border-color: rgba(74, 144, 226, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.15);
}

.goals-procon-however-btn:hover {
    background: rgba(156, 39, 176, 0.08);
    border-color: rgba(156, 39, 176, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(156, 39, 176, 0.15);
}

.goals-procon-delete-btn,
.goals-idea-delete-btn {
    background: #ffffff;
    border: 1px solid rgba(244, 67, 54, 0.25);
    padding: 5px 8px;
    cursor: pointer;
    color: #f44336;
    transition: all 0.2s;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.goals-procon-delete-btn:hover,
.goals-idea-delete-btn:hover {
    background: rgba(244, 67, 54, 0.08);
    border-color: rgba(244, 67, 54, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.15);
}

.goals-procon-input-wrapper {
    margin-bottom: 8px;
}

.goals-procon-input-wrapper.goals-pro-item {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

.goals-procon-input-wrapper.goals-con-item {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.3);
}

.goals-procon-input-wrapper .goals-procon-content {
    flex: 1;
}

.goals-procon-input-wrapper .goals-procon-actions {
    opacity: 1; /* Always show cancel button */
}

.goals-procon-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    outline: none;
    padding: 0;
}

.goals-procon-input::placeholder {
    color: #95a5a6;
    opacity: 0.7;
}

.goals-procon-input-cancel {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: #7f8c8d;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
    flex-shrink: 0;
}

.goals-procon-input-cancel:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #2c3e50;
}

/* Worries Styling */
.goals-worries-list {
    width: 100%;
}

.goals-worry-item {
    background: #ffffff;
    border: 1px solid rgba(156, 39, 176, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.goals-worry-item:hover {
    border-color: rgba(156, 39, 176, 0.4);
    box-shadow: 0 2px 8px rgba(156, 39, 176, 0.1);
    background: rgba(156, 39, 176, 0.02);
}

.goals-worry-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.goals-worry-content {
    flex: 1;
    min-width: 0;
}

.goals-worry-title {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.5;
}

.goals-worry-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.goals-worry-item:hover .goals-worry-actions {
    opacity: 1;
}

.goals-worry-delete-btn {
    background: #ffffff;
    border: 1px solid rgba(244, 67, 54, 0.25);
    padding: 5px 8px;
    cursor: pointer;
    color: #f44336;
    transition: all 0.2s;
    border-radius: 6px;
    font-size: 11px;
}

.goals-worry-delete-btn:hover {
    background: rgba(244, 67, 54, 0.08);
    border-color: rgba(244, 67, 54, 0.4);
}

.goals-worry-steps {
    flex-basis: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(156, 39, 176, 0.1);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.goals-worry-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
}

.goals-worry-step span.completed {
    text-decoration: line-through;
    opacity: 0.5;
}

/* Ideas Box Styling */
.goals-idea-box {
    background: #ffffff;
    border: 1px solid rgba(255, 193, 7, 0.25);
    border-radius: 12px;
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
}

.goals-idea-box:hover {
    border-color: rgba(255, 193, 7, 0.4);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.12);
}

.goals-idea-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.05) 0%, rgba(255, 193, 7, 0.02) 100%);
    border-bottom: 1px solid rgba(255, 193, 7, 0.15);
}

.goals-idea-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.4;
}

.goals-idea-title::before {
    content: 'ðŸ’¡';
    margin-right: 8px;
    font-size: 18px;
}

.goals-idea-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}

.goals-idea-box:hover .goals-idea-actions {
    opacity: 1;
}

.goals-idea-proscons {
    padding: 12px 16px 16px 16px;
}

.goals-idea-proscons:empty {
    padding: 0;
}

/* Pros/Cons inside idea boxes */
.goals-procon-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    gap: 12px;
    transition: all 0.2s;
    border: 1px solid transparent;
    position: relative;
}

.goals-procon-item:last-child {
    margin-bottom: 0;
}

/* Nested container for rebuttals */
.goals-procon-nested {
    display: block;
    flex-basis: 100%;
    margin-top: 8px;
    margin-left: 0;
    padding-left: 20px;
    border-left: 2px solid rgba(0, 0, 0, 0.08);
}

.goals-pro-item {
    background: rgba(76, 175, 80, 0.06);
    border-color: rgba(76, 175, 80, 0.15);
}

.goals-pro-item::before {
    content: 'Pro';
    color: #2e7d32;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(76, 175, 80, 0.2);
    padding: 4px 9px;
    border-radius: 5px;
    line-height: 1;
    flex-shrink: 0;
}

.goals-pro-item:hover {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.25);
}

.goals-con-item {
    background: rgba(244, 67, 54, 0.06);
    border-color: rgba(244, 67, 54, 0.15);
}

.goals-con-item::before {
    content: 'Con';
    color: #c62828;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: rgba(244, 67, 54, 0.2);
    padding: 4px 9px;
    border-radius: 5px;
    line-height: 1;
    flex-shrink: 0;
}

.goals-con-item:hover {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.25);
}

.goals-procon-content {
    flex: 1;
    min-width: 0;
}

.goals-procon-title {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.6;
}

.goals-procon-actions {
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.goals-procon-item:hover .goals-procon-actions {
    opacity: 1;
}

/* Empty state for goals */
.goals-card-grid:empty::after {
    content: 'No goals yet';
    display: block;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
    grid-column: 1 / -1;
}

/* Breakdown Modal Responsive */
@media (max-width: 768px) {
    .breakdown-modal {
        max-width: 100%;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .breakdown-header {
        padding: 16px;
        border-radius: 0;
    }
    
    .breakdown-body {
        padding: 24px 20px;
    }
    
    .breakdown-vertical-flow {
        padding: 24px 20px !important;
    }
    
    .breakdown-task-title {
        font-size: 28px;
        padding: 6px 8px;
    }
    
    .breakdown-task-description {
        font-size: 13px;
        padding: 4px 8px;
    }
    
    .breakdown-parent-item {
        font-size: 12px;
    }
    
    .breakdown-child-item-text {
        font-size: 15px;
    }
    
    .breakdown-child-item input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
    
    .breakdown-quick-actions {
        gap: 16px;
    }
    
    .breakdown-action-link {
        font-size: 12px;
    }
    
    .btn-back {
        margin-right: 12px;
    }
    
    .breakdown-hierarchy-section {
        padding: 12px 16px;
        margin: 16px 0;
    }
    
    .breakdown-hierarchy-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .context-prefix {
        font-size: 16px;
    }
    
    .context-textarea {
        min-height: 80px;
        font-size: 15px;
    }
}



/* ========================================
   OVERVIEW TAB
   ======================================== */

.overview-container {
    padding: 24px 0 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.overview-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overview-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
    padding: 0 2px;
}

.overview-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.overview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.07));
    transition: box-shadow 0.12s, transform 0.12s;
}

.overview-row.is-want {
    cursor: pointer;
}

/* When a joined row follows, square off the bottom of the preceding row */
.overview-row:has(+ .overview-row-joined) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.overview-row.is-want:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}

/* Project cards */
.overview-project-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overview-project-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, rgba(0,0,0,0.07));
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.12s, transform 0.12s;
}

.overview-project-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.overview-project-card.done .overview-row-title {
    text-decoration: line-through;
    color: var(--text-muted, #9ca3af);
}

.overview-project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
}

.overview-sub-projects {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border-color, rgba(0,0,0,0.06));
}

.overview-sub-project {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px 8px 42px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.04));
}

.overview-sub-project:last-child {
    border-bottom: none;
}

.overview-sub-project:hover {
    background: rgba(0,0,0,0.02);
}

.overview-sub-project-title {
    font-size: 13px;
    color: var(--text-secondary, #4b5563);
    flex: 1;
    min-width: 0;
}

.overview-row-chevron {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    flex-shrink: 0;
}

.overview-row.done .overview-row-title {
    text-decoration: line-through;
    color: var(--text-muted, #9ca3af);
}

/* Joined sibling row (same breadcrumb group as the row above) */
.overview-row.overview-row-joined {
    margin-top: -1px;
    border-top: 1px solid var(--border-color, rgba(0,0,0,0.04));
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding-left: 28px;
}

.overview-row-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.overview-row-ancestors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.overview-row-ancestor {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.overview-row-ancestor-sep {
    font-size: 8px;
    color: var(--text-muted, #9ca3af);
    opacity: 0.6;
}

.overview-row-title {
    font-size: 16px;
    color: var(--text-primary, #1a1a2e);
    line-height: 1.4;
    font-weight: 600;
}

.overview-project-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.overview-progress-bar {
    width: 80px;
    height: 5px;
    background: var(--border-color, rgba(0,0,0,0.08));
    border-radius: 999px;
    overflow: hidden;
}

.overview-progress-fill {
    height: 100%;
    background: #7c3aed;
    border-radius: 999px;
    transition: width 0.3s;
}

.overview-progress-label {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    white-space: nowrap;
}

.overview-empty {
    font-size: 13px;
    color: var(--text-muted, #9ca3af);
    margin: 0;
    font-style: italic;
    padding: 4px 2px;
}


