/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8fafc;
    color: #2d3748;
    line-height: 1.5;
}

/* Server signals non-production via window.__TODO_RUNTIME_ENV__ (see app.py index route) */
body.non-production-banner-visible {
    padding-top: 42px;
}

.non-production-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100100;
    background: linear-gradient(90deg, #ea580c, #f97316);
    color: #fffbeb;
    border-bottom: 3px solid #9a3412;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.non-production-banner__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.non-production-banner__icon {
    color: #fef3c7;
}

.non-production-banner__env {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
}

.header-top-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem 0.75rem;
    min-width: 0;
    flex: 0 1 auto;
}

.header-top-bar .app-title {
    min-width: 0;
}

/* Edit, options, sign out — keep cluster at the end of the header bar */
.header-toolbar-end {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.app-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-primary-slot {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    align-items: center;
}

.header-primary-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* Shown only on small viewports; opens modal with quick add + add task + new list.
   Must beat later `.btn { display: inline-flex }` (same class specificity, later source). */
.app-header .header-toolbar-end .header-edit-btn {
    display: none;
    align-items: center;
    gap: 0.35rem;
}

/* NLP Quick Add Styles */
.quick-add-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quick-add-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-add-input-group .quick-add-token-hint {
    position: relative;
    z-index: 25;
    align-self: center;
    cursor: help;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    padding: 0.2rem 0.25rem;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 0.25rem;
    outline: none;
}

.quick-add-input-group .quick-add-token-hint:hover,
.quick-add-input-group .quick-add-token-hint:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Native title="" is unusable in many UIs; use the shared .tooltip panel below the (?) icon. */
.quick-add-container .quick-add-token-hint .tooltiptext.quick-add-token-tooltiptext {
    width: min(18.5rem, 92vw);
    min-width: 12.5rem;
    left: 50%;
    right: auto;
    margin-left: 0;
    transform: translateX(-50%);
    bottom: auto;
    top: calc(100% + 0.2rem);
    z-index: 2000;
}

.quick-add-container .quick-add-token-hint .tooltiptext.quick-add-token-tooltiptext::after {
    top: -0.3rem;
    bottom: auto;
    left: 50%;
    margin-left: -5px;
    border-width: 0 5px 5px 5px;
    border-color: transparent transparent #2d3748 transparent;
}

.header-edit-modal .quick-add-input-group .quick-add-token-hint {
    color: rgba(74, 85, 104, 0.9);
}

.header-edit-modal .quick-add-input-group .quick-add-token-hint:hover,
.header-edit-modal .quick-add-input-group .quick-add-token-hint:focus {
    color: #2d3748;
    background: rgba(0, 0, 0, 0.05);
}

.quick-add-help-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.quick-add-help-line {
    display: block;
    margin-top: 0.3rem;
}

.quick-add-help-line kbd {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.08rem 0.3rem;
    border-radius: 0.2rem;
    font-size: 0.7rem;
    font-family: inherit;
}

.quick-add-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.875rem;
    width: 400px;
    transition: all 0.2s ease;
}

.quick-add-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.quick-add-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.nlp-feedback {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    max-width: 400px;
}

.nlp-feedback.success {
    background: rgba(72, 187, 120, 0.2);
    color: #c6f6d5;
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.nlp-feedback.error {
    background: rgba(245, 101, 101, 0.2);
    color: #fed7d7;
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.nlp-feedback.parsing {
    background: rgba(66, 153, 225, 0.2);
    color: #bee3f8;
    border: 1px solid rgba(66, 153, 225, 0.3);
}

.header-divider {
    width: 1px;
    height: 2rem;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.5rem;
}

/* Mobile: add/list/quick-add live in this modal (see placeHeaderPrimaryTools) */
#header-edit-modal-overlay {
    z-index: 3000;
}

.header-edit-modal {
    max-width: 24rem;
    width: 90vw;
}

.header-edit-modal-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.header-edit-modal .header-primary-tools {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.75rem;
}

.header-edit-modal .header-divider {
    display: block;
    width: 100%;
    height: 1px;
    margin: 0;
    background: #e2e8f0;
}

.header-edit-modal .quick-add-container,
.header-edit-modal .quick-add-input-group {
    width: 100%;
}

.header-edit-modal .quick-add-input {
    width: 100% !important;
    max-width: none;
    min-width: 0;
    background: #fff;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    font-size: 1rem;
}

.header-edit-modal .quick-add-input::placeholder {
    color: #a0aec0;
}

.header-edit-modal .quick-add-input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.header-edit-modal .btn-success {
    width: 100%;
    justify-content: center;
}

.header-edit-modal .btn-primary,
.header-edit-modal .btn-secondary {
    width: 100%;
    justify-content: center;
}

.header-edit-modal .nlp-feedback {
    max-width: none;
}

.header-edit-modal .nlp-feedback.success {
    color: #22543d;
    background: #c6f6d5;
    border-color: #9ae6b4;
}

.header-edit-modal .nlp-feedback.error {
    color: #742a2a;
    background: #fed7d7;
    border-color: #fc8181;
}

.header-edit-modal .nlp-feedback.parsing {
    color: #2c5282;
    background: #bee3f8;
    border-color: #90cdf4;
}

/* Mobile hamburger — hidden on desktop */
.mobile-menu-btn,
.mobile-menu-close,
.mobile-nav-backdrop,
.sidebar-header-mobile {
    display: none;
}

.hidden {
    display: none !important;
}

#options-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#options-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 1.5rem;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.section-label {
    flex: 1;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.collapse-toggle {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
    font-size: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-toggle:hover {
    background-color: #e2e8f0;
    color: #4a5568;
}

.collapse-toggle i {
    transition: transform 0.2s ease;
}

.collapse-toggle.collapsed i {
    transform: rotate(-90deg);
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.25s ease-out, opacity 0.15s ease-out;
    max-height: 500px;
    /* Reduced from 1000px for smoother transition */
    opacity: 1;
}

.collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ID rules below must not override .collapsed (id beats .class.class). When expanded,
   use a generous ceiling so all Quick View links show on desktop; inner nav scrolls only if needed. */
#quick-views-content:not(.collapsed) {
    max-height: min(60rem, 85vh);
    overflow-y: auto;
}

#quick-views-content.collapsed {
    max-height: 0 !important;
    overflow: hidden !important;
}

/* Calendar quick view: hide on mobile; matches MOBILE_MAX_WIDTH in app.js */
@media (max-width: 768px) {
    .view-item--desktop-only {
        display: none !important;
    }
}

/* Lists: scroll inside the panel when many lists; collapse must still win over any max-height */
#lists-content:not(.collapsed) {
    max-height: min(70vh, 900px);
    overflow-y: auto;
}

#lists-content.collapsed {
    max-height: 0 !important;
    overflow: hidden !important;
}

/* Tighter vertical rhythm when a section body is collapsed (Lists sits under Quick Views heading) */
.sidebar-section:has(.collapsible-content.collapsed) {
    margin-bottom: 0.75rem;
}

.sidebar-section:has(.collapsible-content.collapsed) .section-title {
    margin-bottom: 0.25rem;
}

.quick-views {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.view-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}

.view-item:hover {
    background-color: #f7fafc;
    color: #2d3748;
}

.view-item.active {
    background-color: #ebf8ff;
    color: #3182ce;
    font-weight: 500;
}

.view-item i {
    width: 1.25rem;
    text-align: center;
}

.count {
    margin-left: auto;
    background-color: #e2e8f0;
    color: #4a5568;
    padding: 0.125rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.view-item.active .count {
    background-color: #3182ce;
    color: white;
}

.list-item.active .count {
    background-color: #3182ce;
    color: white;
}

/* Lists */
.lists-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.list-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: #4a5568;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

/* Sidebar list row: full name; avoid margin-left:auto on a sibling (see .list-actions) that ate flex space */
.list-item .list-name {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #718096;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
}

.task-meta .list-name {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #718096;
    max-width: 100%;
}

.list-item:hover {
    background-color: #f7fafc;
}

.list-item.active {
    background-color: #ebf8ff;
    color: #3182ce;
    font-weight: 500;
}

.list-item i {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.list-icon-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1;
}

.task-meta .list-icon-emoji {
    width: auto;
    min-width: 1rem;
}

.detail-value--with-list-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

/* List modal: emoji picker */
.label-hint {
    font-weight: 400;
    color: #718096;
    text-transform: none;
    letter-spacing: normal;
}

.list-icon-preview-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0 0.75rem;
}

.list-icon-preview-label {
    font-size: 0.8rem;
    color: #718096;
}

.list-icon-preview-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    min-height: 1.75rem;
    font-size: 1.25rem;
    color: #4a5568;
}

.list-icon-preview-slot .fas {
    font-size: 1.1rem;
    color: #718096;
}

.list-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.list-icon-option {
    font-size: 1.15rem;
    line-height: 1;
    padding: 0.35rem 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.35rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.list-icon-option:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.list-icon-option.is-selected {
    border-color: #3182ce;
    background: #ebf8ff;
    box-shadow: 0 0 0 1px rgba(49, 130, 206, 0.25);
}

.list-icon-option.list-icon-clear {
    font-size: 0.75rem;
    font-weight: 500;
    color: #4a5568;
}

.list-icon-custom-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.25rem;
}

.list-icon-custom-input {
    width: 100%;
    max-width: 12rem;
    padding: 0.4rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.35rem;
    font-size: 1.1rem;
    font-family: inherit;
}

/* List modal: emoji shortcut help (tooltip opens below so modal scroll doesn’t clip it) */
.list-icon-label-row {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.list-icon-label-row .list-icon-emoji-help {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1;
    margin-left: 0.1rem;
}

.list-icon-label-row .list-icon-emoji-help:hover,
.list-icon-label-row .list-icon-emoji-help:focus {
    color: #3182ce;
    outline: none;
}

#list-form .list-icon-emoji-help .tooltiptext.list-icon-emoji-tooltiptext {
    width: min(300px, 85vw);
    bottom: auto;
    top: 100%;
    left: 0;
    margin-left: 0;
    margin-top: 0.35rem;
}

#list-form .list-icon-emoji-help .tooltiptext.list-icon-emoji-tooltiptext::after {
    top: auto;
    bottom: 100%;
    left: 1rem;
    margin-left: 0;
    border-color: transparent transparent #2d3748 transparent;
}

.list-icon-emoji-tip-block {
    display: block;
    margin-top: 0.45rem;
}

.list-icon-emoji-tip-block:first-child {
    margin-top: 0;
}

.list-icon-emoji-tooltiptext kbd {
    display: inline-block;
    background: rgba(255, 255, 255, 0.18);
    padding: 0.08rem 0.35rem;
    border-radius: 0.2rem;
    font-size: 0.72rem;
    font-family: inherit;
    white-space: nowrap;
}

/* Toggle switch (native checkbox + styled track; used for Kanban controls) */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
}

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

.toggle-switch__input:focus-visible + .toggle-switch__track {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
}

.toggle-switch__track {
    position: relative;
    flex-shrink: 0;
    width: 2.875rem;
    height: 1.5rem;
    border-radius: 999px;
    background: #e2e8f0;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

.toggle-switch__thumb {
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease;
}

.toggle-switch__input:checked + .toggle-switch__track {
    background-color: #3182ce;
}

.toggle-switch__input:checked + .toggle-switch__track .toggle-switch__thumb {
    transform: translateX(1.375rem);
}

.toggle-switch__label-text {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* List modal: Kanban setting (only shown when editing the list you are currently viewing) */
.list-modal-kanban-group {
    overflow: visible;
}

.list-modal-kanban-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.4rem;
}

.list-modal-kanban-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
}

.list-modal-kanban-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #718096;
    font-size: 0.9rem;
    line-height: 1;
    cursor: help;
}

.list-modal-kanban-tooltip:focus {
    outline: none;
}

.list-modal-kanban-tooltip:focus-visible {
    outline: 2px solid #3182ce;
    outline-offset: 2px;
    border-radius: 2px;
}

.options-modal-setting-header {
    margin-bottom: 0;
    position: relative;
    width: 100%;
}

/* Toggle rows: title row + slider on separate lines (avoid overlap with long copy) */
.options-modal .form-group.options-modal-toggle-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

/* Match other Options tooltips: open below the row, full modal width (not centered above) */
.options-modal .options-modal-setting-header .list-modal-kanban-tooltip .tooltiptext {
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    top: 100%;
    bottom: auto;
    margin-top: 0.35rem;
    margin-left: 0;
    box-sizing: border-box;
}

.options-modal .options-modal-setting-header .list-modal-kanban-tooltip .tooltiptext::after {
    left: 0.75rem;
    right: auto;
    margin-left: 0;
    transform: none;
    top: auto;
    bottom: 100%;
    border-color: transparent transparent #2d3748 transparent;
}

.options-modal .form-group > .toggle-switch.options-modal-toggle-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 0.75rem;
    margin-top: 0;
}

.options-modal .form-group > .toggle-switch.options-modal-toggle-row .toggle-switch__track {
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.options-modal .form-group > .toggle-switch.options-modal-toggle-row .toggle-switch__label-text {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    line-height: 1.4;
}

.list-modal-kanban-tooltip .tooltiptext {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(100% + 0.35rem);
    top: auto;
    width: max-content;
    max-width: min(19rem, calc(100vw - 2rem));
    min-width: 12rem;
    margin: 0;
    padding: 0.55rem 0.7rem;
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: left;
    white-space: normal;
    z-index: 2100;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    background-color: #2d3748;
    color: #fff;
    border-radius: 0.375rem;
}

.list-modal-kanban-tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

.list-modal-kanban-tooltip:hover .tooltiptext,
.list-modal-kanban-tooltip:focus-within .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.list-modal-kanban-check {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
}

/* Pin count to the end; do not use margin-left:auto on .list-actions (it eats flex free space and shrinks the name) */
.list-item .count {
    margin-left: auto;
    flex-shrink: 0;
}

.list-actions {
    position: absolute;
    right: 2.25rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.25rem;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    /* subtle backing so icons stay readable over long names */
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #fff 0.4rem, #fff 100%);
    padding-left: 0.35rem;
    border-radius: 0.25rem;
    box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.8);
}

.list-item.active .list-actions {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #ebf8ff 0.4rem, #ebf8ff 100%);
    box-shadow: 0 0 0 1px rgba(199, 210, 235, 0.9);
}

.list-item:hover .list-actions {
    opacity: 1;
    pointer-events: auto;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Statistics (Quick View) */
.statistics-view {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0 2rem 2rem;
    overflow: auto;
    background: #f8fafc;
}

.statistics-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-top: 0.5rem;
}

.statistics-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.statistics-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.statistics-range-label {
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.statistics-range-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: #fff;
    min-width: 9.5rem;
    font-family: inherit;
}

.statistics-legend-hint {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.45;
    margin: 0 0 1rem 0;
    max-width: 42rem;
}

.statistics-chart-wrap {
    position: relative;
    flex: 1 1 0;
    min-height: 280px;
    max-height: min(55vh, 28rem);
    width: 100%;
    max-width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

@media (max-width: 768px) {
    .statistics-view {
        padding: 0 1rem 1.5rem;
    }

    .statistics-chart-wrap {
        min-height: 220px;
    }
}

.content-header {
    background: white;
    padding: 2rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.view-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
}

.view-info .view-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    flex: 1 1 0;
    min-width: 0;
}

.list-kanban-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

/* `hidden` must win over `display: flex` above (author rule beats attribute hiding otherwise). */
.list-kanban-toolbar[hidden] {
    display: none !important;
}

.list-kanban-view-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    white-space: nowrap;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
    padding: 0.5rem 0 1.5rem;
}

@media (max-width: 1100px) {
    .kanban-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

.kanban-column {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    min-height: 12rem;
    display: flex;
    flex-direction: column;
}

.kanban-column-title {
    margin: 0;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #4a5568;
    border-bottom: 1px solid #e2e8f0;
    background: #edf2f7;
    border-radius: 0.5rem 0.5rem 0 0;
}

.kanban-column-body {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: auto;
    max-height: min(70vh, 42rem);
}

.kanban-column-body--drag-over {
    background: #ebf8ff;
    box-shadow: inset 0 0 0 2px #3182ce;
    border-radius: 0.25rem;
}

.kanban-column-body--no-drop {
    /* Blocked column: not a drop target (logic also rejects in JS) */
    cursor: default;
}

.kanban-empty {
    margin: 0;
    font-size: 0.8125rem;
    color: #a0aec0;
    font-style: italic;
}

.kanban-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kanban-card--no-drag {
    cursor: pointer;
}

.kanban-drag-handle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    min-height: 2.25rem;
    align-self: stretch;
    cursor: grab;
    color: #a0aec0;
    background: #fafafa;
    border-right: 1px solid #edf2f7;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.kanban-drag-handle:hover {
    color: #4a5568;
    background: #edf2f7;
}

.kanban-drag-handle:active {
    cursor: grabbing;
}

.kanban-card-priority-bar {
    width: 0.28rem;
    flex-shrink: 0;
    align-self: stretch;
    background: #d69e2e;
}

.kanban-card--priority-high .kanban-card-priority-bar {
    background: #e53e3e;
}

.kanban-card--priority-medium .kanban-card-priority-bar {
    background: #ecc94b;
}

.kanban-card--priority-low .kanban-card-priority-bar {
    background: #38a169;
}

.kanban-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.625rem 0.75rem;
}

.kanban-card:hover {
    border-color: #cbd5e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.kanban-card-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #2d3748;
    line-height: 1.35;
    margin: 0;
}

.kanban-card .task-tags {
    margin-top: 0;
}

.kanban-loading {
    padding: 3rem 1rem;
    text-align: center;
    color: #718096;
    font-size: 0.9375rem;
}

.view-description {
    color: #718096;
    font-size: 0.875rem;
}

/* Wraps the task-list toolbar; mobile adds a show/hide toggle. */
.view-actions-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    flex: 0 0 auto;
}

/* Chevron next to view title on mobile only; toggles list filters below. */
.view-options-toggle {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #f7fafc;
    color: #4a5568;
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.view-options-toggle:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.view-options-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

/* Chevron is in .view-info; panel is the following sibling — use :has() */
.content-header:has(.view-actions-panel--open) .view-options-chevron {
    transform: rotate(180deg);
}

.view-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.view-mode-toggle {
    display: flex;
    align-items: center;
}

.view-toggle {
    background: white;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.view-toggle:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

.view-toggle.active {
    background: #3182ce;
    border-color: #3182ce;
    color: white;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    color: #a0aec0;
    pointer-events: none;
}

.search-box input {
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    width: 250px;
    transition: border-color 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.filter-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
    cursor: pointer;
}

/* Tasks Container */
.tasks-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem;
}

/* 4-week calendar (desktop quick view) */
.calendar-container {
    flex: 1;
    overflow: auto;
    padding: 1rem 1.5rem 1.5rem;
}

.calendar-container .calendar-empty-hint {
    color: #718096;
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: min(100%, 58rem);
}

.calendar-dow-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #718096;
    padding: 0 0.15rem;
}

.calendar-dow {
    text-align: center;
}

.calendar-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.calendar-day {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fcfcfd;
    min-height: 5.5rem;
    padding: 0.35rem 0.4rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* Allow multiple due tasks to extend the cell; row height follows the tallest day in that week. */
    overflow: visible;
}

.calendar-day--today {
    border-color: #3182ce;
    background: #ebf8ff;
    box-shadow: 0 0 0 1px rgba(49, 130, 206, 0.2);
}

/* Any 1st of a month in the grid: light separator from previous month */
.calendar-day--month-start {
    box-shadow: inset 0 3px 0 0 #e2e8f0;
    background: #fafbfc;
}

/* The 1st of the *next* calendar month (when it falls in this 4-week window) */
.calendar-day--first-of-next-month {
    box-shadow: inset 0 3px 0 0 #c4b5fd, 0 0 0 1px rgba(109, 40, 217, 0.2);
    background: linear-gradient(180deg, #f5f3ff 0%, #fafbfc 100%);
}

.calendar-day--first-of-next-month .calendar-day-header {
    color: #5b21b6;
}

.calendar-day-header {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    font-size: 0.7rem;
    color: #4a5568;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}

.calendar-day--today .calendar-day-header {
    color: #2b6cb0;
    font-weight: 600;
}

.calendar-day-date {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
}

.calendar-day-month {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.85;
}

.calendar-day-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex-shrink: 0;
    overflow-x: hidden;
    overflow-y: visible;
}

a.calendar-task-link,
.calendar-task-ghost {
    display: block;
    font-size: 0.72rem;
    line-height: 1.25;
    text-decoration: none;
    color: #2b6cb0;
    padding: 0.1rem 0;
    border-radius: 0.2rem;
    word-break: break-word;
    cursor: pointer;
}

a.calendar-task-link:hover {
    text-decoration: underline;
    color: #2c5282;
}

.calendar-task-ghost {
    color: #94a3b8;
    font-weight: 400;
    cursor: default;
    user-select: none;
}

/* Task Card */
.task-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.task-card:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-width: 0;
}

.task-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1rem;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    align-self: flex-start;
    /* Always show — hover-only was easy to lose (touch, hybrid pointers, long titles clipping). */
    opacity: 1;
    transition: opacity 0.2s;
}

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

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.priority-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.priority-high {
    background-color: #fed7d7;
    color: #c53030;
}

.priority-medium {
    background-color: #fefcbf;
    color: #d69e2e;
}

.priority-low {
    background-color: #c6f6d5;
    color: #38a169;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-todo {
    background-color: #e2e8f0;
    color: #4a5568;
}

.status-progress {
    background-color: #bee3f8;
    color: #3182ce;
}

.status-done {
    background-color: #c6f6d5;
    color: #38a169;
}

.due-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #718096;
}

.due-date.overdue {
    color: #e53e3e;
    font-weight: 500;
}

.due-date.today {
    color: #d69e2e;
    font-weight: 500;
}

.due-date--placeholder {
    display: none;
}


.ready-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.ready-indicator.ready {
    background-color: #c6f6d5;
    color: #38a169;
}

.ready-indicator.blocked {
    background-color: #fed7d7;
    color: #c53030;
}

.task-dependencies {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 0.5rem;
}

.dependency-link {
    color: #3182ce;
    text-decoration: none;
}

.dependency-link:hover {
    text-decoration: underline;
}

.dependency-link.completed {
    text-decoration: line-through;
    color: #718096;
    opacity: 0.7;
}

.dependency-link.completed:hover {
    text-decoration: line-through underline;
}

/* Task Tags */
.task-tags {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.task-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background-color: var(--tag-color, #3182ce);
    color: white;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1.2;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.task-tag:hover {
    opacity: 1;
}

.task-tag-more {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background-color: #718096;
    color: white;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 500;
    line-height: 1.2;
    opacity: 0.8;
    cursor: default;
}

/* Compact Task View */
.compact-view .task-card {
    padding: 0.5rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.compact-view .task-header {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.compact-view .task-title {
    margin-bottom: 0;
    font-size: 0.875rem;
    flex: 1;
    margin-right: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.compact-view .task-meta {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0.4rem;
    margin-bottom: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Due (right-aligned) then priority — order keeps rows aligned when some tasks have no date */
.compact-view .task-meta .due-date {
    order: 1;
    min-width: 9.5rem;
    max-width: 11.5rem;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.75rem;
    color: #718096;
    white-space: nowrap;
    flex-shrink: 0;
}

.compact-view .task-meta .due-date--placeholder {
    display: inline-flex;
    order: 1;
    min-width: 9.5rem;
    max-width: 11.5rem;
    font-size: 0.75rem;
    line-height: 1;
    visibility: hidden;
    flex-shrink: 0;
    padding: 0;
    pointer-events: none;
    justify-content: flex-end;
}

.compact-view .priority-badge {
    order: 2;
    font-size: 0.625rem;
    padding: 0.15rem 0.45rem;
    min-width: 3.4rem;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

.compact-view .task-meta .due-date.overdue {
    color: #e53e3e;
    font-weight: 500;
}

.compact-view .task-meta .due-date.today {
    color: #dd6b20;
    font-weight: 500;
}

.compact-view .status-badge,
.compact-view .recurring-indicator,
.compact-view .list-name,
.compact-view .ready-indicator {
    display: none;
}

.compact-view .task-dependencies,
.compact-view .task-tags,
.compact-view .task-description {
    display: none;
}

.compact-view .kanban-board .task-tags {
    display: flex;
}

.compact-view .task-actions {
    opacity: 1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.compact-view .task-card:hover .task-actions {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
}

/* Ensure FontAwesome icons in buttons are properly aligned */
.btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: baseline;
    transform: translateY(0.1em);
}

.btn-primary {
    background-color: #3182ce;
    color: white;
}

.btn-primary:hover {
    background-color: #2c5aa0;
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background-color: #cbd5e0;
}

.btn-danger {
    background-color: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background-color: #c53030;
}

.btn-warning {
    background-color: #ed8936;
    color: white;
}

.btn-warning:hover {
    background-color: #dd6b20;
}

.btn-success {
    background-color: #38a169;
    color: white;
}

.btn-success:hover {
    background-color: #2f855a;
}

.btn-small {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #a0aec0;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: #f7fafc;
    color: #4a5568;
}

.btn-icon.complete-task-btn {
    color: #38a169;
}

.btn-icon.complete-task-btn:hover {
    background-color: #f0fff4;
    color: #2f855a;
}

.btn-close {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #a0aec0;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background-color: #f7fafc;
    color: #4a5568;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 0.5rem;
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.task-modal-header .task-modal-header-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 120px);
}

.modal-actions {
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.modal-actions-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.modal-actions-right {
    display: flex;
    gap: 0.75rem;
}

.quick-add-list-resolution-hint {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0.5rem 0 0;
    color: #718096;
}

#quick-add-list-resolution-overlay .quick-add-list-resolution-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label:not(.toggle-switch) {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.form-group input:not(.toggle-switch__input),
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.form-group input:not(.toggle-switch__input):focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Task description should be single line by default */
#task-description {
    min-height: auto;
    height: auto;
}

.form-group select[multiple] {
    min-height: 120px;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #718096;
}

/* Help text styling */
#recurring-help-text {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #e6fffa;
    border-left: 3px solid #38b2ac;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #2d3748;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Custom Weekly Recurrence Styles */
.custom-weekly-container {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
}

.custom-weekly-container label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.weekday-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.weekday-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.weekday-item input[type="checkbox"] {
    display: none;
}

.weekday-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 2.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
    margin: 0;
}

.weekday-item input[type="checkbox"]:checked+.weekday-label {
    background-color: #3182ce;
    border-color: #3182ce;
    color: white;
}

.weekday-label:hover {
    border-color: #3182ce;
    color: #3182ce;
}

.weekday-item input[type="checkbox"]:checked+.weekday-label:hover {
    background-color: #2c5aa0;
    border-color: #2c5aa0;
    color: white;
}

.weekday-shortcuts {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-mini {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #fff;
    color: #718096;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-mini:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}

.btn-mini:active {
    background-color: #edf2f7;
}

/* Options Modal Styles */
.options-modal.modal {
    /* Allow in-modal tooltips to paint past the card edge when needed; inner content stays narrow */
    overflow: visible;
}

.options-modal {
    max-width: 500px;
    width: 100%;
    min-width: 0; /* allow flex parent to shrink without horizontal overflow */
    box-sizing: border-box;
}

.options-modal .modal-content {
    min-width: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden; /* no horizontal bar; content + tooltips are full-width of column */
    /* Tooltips are positioned within each label, so they do not widen this box */
}

.options-modal .form-group {
    /* Contain the absolutely positioned help text without clipping (modal-content is the scroll parent) */
    overflow: visible;
}

.options-modal .form-group > label {
    position: relative;
    display: block;
    overflow: visible;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    max-width: 100%;
}

/* Tooltip is only the trigger; the bubble is positioned against the <label> */
.options-modal .form-group > label .tooltip {
    position: static;
    display: inline;
    margin-left: 0.25rem;
}

/* Full-width help below the label line: stays inside the form, not clipped by narrow tooltip box */
.options-modal .form-group > label .tooltip .tooltiptext {
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    top: 100%;
    bottom: auto;
    margin-top: 0.35rem;
    padding: 0.6rem 0.75rem;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: left;
    z-index: 2001;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Arrow: centered above the tooltip box, pointing at the label row */
.options-modal .form-group > label .tooltip .tooltiptext::after {
    left: 50%;
    right: auto;
    margin-left: 0;
    transform: translateX(-50%);
    bottom: 100%;
    top: auto;
    border-color: transparent transparent #2d3748 transparent;
}

.toggle-group {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #4a5568;
    transition: color 0.2s ease;
}

.toggle-option input[type="radio"] {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.toggle-option input[type="radio"]:checked {
    border-color: #3182ce;
    background-color: #3182ce;
}

.toggle-option input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.5rem;
    height: 0.5rem;
    background-color: white;
    border-radius: 50%;
}

.toggle-option:hover input[type="radio"] {
    border-color: #3182ce;
}

.toggle-option:hover {
    color: #2d3748;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: #2d3748;
    color: white;
    text-align: left;
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
}

.tooltip:hover .tooltiptext,
.tooltip:focus-within .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Row above Save/Cancel: the form’s last child is .modal-actions, not .form-group, so :last-of-type never
   matched. Open tooltip above the label so it isn’t clipped at the bottom of the scroll area. */
#options-form > .form-group:nth-last-child(2) > label .tooltip .tooltiptext {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 0.35rem;
}

#options-form > .form-group:nth-last-child(2) > label .tooltip .tooltiptext::after {
    top: 100%;
    bottom: auto;
    left: 50%;
    right: auto;
    margin-left: 0;
    transform: translateX(-50%);
    border-color: #2d3748 transparent transparent transparent;
}

.form-help {
    display: none;
}

/* Dependency Tabs */
.dependency-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.dependency-tab {
    background: none;
    border: none;
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #718096;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dependency-tab:hover {
    color: #4a5568;
    background-color: #f7fafc;
}

.dependency-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background-color: #f7fafc;
}

.dependency-content {
    position: relative;
}

.dependency-panel {
    display: none;
}

.dependency-panel.active {
    display: block;
}

.dependency-panel label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4a5568;
}

/* New Dependency Manager Styles */
.dependency-manager {
    margin-bottom: 1rem;
}

.selected-dependencies {
    min-height: 40px;
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
}

.selected-dependencies:empty::after {
    content: "No dependencies selected";
    color: #a0aec0;
    font-style: italic;
    font-size: 0.875rem;
}

.dependency-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.dependency-chip-remove {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.dependency-chip-remove:hover {
    background: rgba(255, 255, 255, 0.3);
}

.add-dependency {
    margin-top: 0.5rem;
}

.dependency-select {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.875rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.dependency-select:hover {
    border-color: #cbd5e0;
}

.dependency-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Legacy select styles for backward compatibility */
.dependency-panel select[multiple] {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.875rem;
    background-color: white;
    margin-bottom: 0.5rem;
}

.dependency-panel select[multiple] option {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 2px;
}

.dependency-panel select[multiple] option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dependency-panel small {
    display: block;
    color: #718096;
    font-size: 0.75rem;
    font-style: italic;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #718096;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    transform: translateX(100%);
    transition: transform 0.3s;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #38a169;
}

.toast.error {
    border-left: 4px solid #e53e3e;
}

.toast.warning {
    border-left: 4px solid #d69e2e;
}

.toast.info {
    border-left: 4px solid #3182ce;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: #718096;
}

/* Task Detail Modal */
.task-detail-modal {
    max-width: 800px;
}

.task-detail-content {
    display: grid;
    gap: 1.5rem;
}

.detail-section {
    background-color: #f7fafc;
    padding: 1rem;
    border-radius: 0.375rem;
}

.detail-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.875rem;
    color: #2d3748;
}

.detail-notes-container {
    font-size: 0.875rem;
    color: #2d3748;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 5.6rem;
    /* Approximately 4 lines at 1.4rem line-height */
    line-height: 1.4;
    overflow-y: auto;
    padding: 0.5rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-family: inherit;
}

/* Pomodoro (task detail: tomato only; preset in Options) */
.detail-section--pomodoro {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pomodoro-preset-select {
    padding: 0.4rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    background: #fff;
    min-width: 7rem;
}

.pomodoro-tomato-btn {
    font-size: 1.75rem;
    line-height: 1;
    padding: 0.25rem 0.4rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff7ed;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.pomodoro-tomato-btn:hover {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.pomodoro-tomato-btn:active {
    transform: scale(0.95);
}

/* Floating bar (keeps running after closing task modal) */
.pomodoro-floating {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 10050;
    max-width: min(20rem, calc(100vw - 2.5rem));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    background: #1a202c;
    color: #f7fafc;
    border: 1px solid #2d3748;
}

.pomodoro-floating-inner {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
}

.pomodoro-floating-icon {
    font-size: 1.5rem;
    line-height: 1.2;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.pomodoro-floating-body {
    flex: 1;
    min-width: 0;
}

.pomodoro-floating-task {
    font-size: 0.72rem;
    color: #a0aec0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
    max-width: 12rem;
}

.pomodoro-floating-time {
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #fbd38d;
}

.pomodoro-floating-phase {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #cbd5e0;
    margin-top: 0.15rem;
}

.pomodoro-floating-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.pomodoro-floating .btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.4rem;
}

.pomodoro-floating .btn-danger {
    color: #feb2b2;
    background: transparent;
    border: 1px solid #742a2a;
}

.pomodoro-floating .btn-danger:hover {
    background: #742a2a;
    color: #fff;
}

.detail-notes-container::-webkit-scrollbar {
    width: 6px;
}

.detail-notes-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.detail-notes-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.detail-notes-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.dependency-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dependency-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 0.25rem;
    border: 1px solid #e2e8f0;
}

/* Detail Tags */
.detail-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background-color: #3182ce;
    color: white;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Disabled Field Message */
.disabled-field-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    color: #856404;
    font-size: 0.875rem;
    font-weight: 500;
}

.disabled-field-message i {
    color: #f39c12;
}

/* Enhanced disabled field styling */
select:disabled,
input:disabled {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    border-color: #e0e0e0 !important;
}

.dependency-tab:disabled,
.dependency-tab[style*="pointer-events: none"] {
    cursor: not-allowed !important;
}

.selected-dependencies[style*="pointer-events: none"]::after {
    content: "Disabled - Recurrence is enabled";
    color: #999;
    font-style: italic;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .content-header {
        flex-direction: column;
        gap: 1rem;
    }

    .view-actions-panel {
        width: 100%;
        align-items: stretch;
    }

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

    .search-box input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    /* Prevent horizontal page scroll from fixed-width children */
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-container {
        min-height: 0;
    }

    .app-header {
        padding: 0.4rem 0.6rem;
    }

    /* One row: [nav + title] [edit + options + sign out] */
    .header-content {
        max-width: none;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0.35rem 0.5rem;
    }

    .header-top-bar {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.35rem;
        flex: 1 1 0;
        min-width: 0;
        width: auto;
    }

    .mobile-menu-btn {
        display: inline-flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.25);
        color: white;
        width: 2.4rem;
        height: 2.4rem;
        min-width: 2.4rem;
        border-radius: 0.45rem;
    }

    .mobile-menu-btn:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    .app-title {
        font-size: 1.05rem;
        flex: 1 1 0;
        min-width: 0;
        max-width: 100%;
        justify-content: flex-start;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Task list uses full width; sidebar is off-canvas */
    .main-content {
        flex: 1 1 0;
        min-height: 0;
        position: relative;
        display: flex;
        flex-direction: column;
    }

    .mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 2000;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
        pointer-events: none;
    }

    body.nav-drawer-open .mobile-nav-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    body.nav-drawer-open {
        overflow: hidden;
    }

    .sidebar-header-mobile {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
        border-bottom: 1px solid #e2e8f0;
    }

    .sidebar-header-mobile-title {
        font-size: 1rem;
        font-weight: 600;
        color: #2d3748;
    }

    .mobile-menu-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(20rem, calc(100vw - 2.5rem));
        max-width: 100%;
        z-index: 2001;
        margin: 0;
        padding: 1rem 1rem 1.25rem;
        padding-top: max(1rem, env(safe-area-inset-top, 0px));
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        background: white;
        border-right: 1px solid #e2e8f0;
        border-bottom: none;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.nav-drawer-open .sidebar {
        transform: translateX(0);
    }

    .content-area {
        flex: 1 1 0;
        min-width: 0;
        min-height: 0;
        width: 100%;
    }

    .header-divider {
        display: none;
    }

    .header-primary-slot:empty {
        display: none;
    }

    .app-header .header-toolbar-end .header-edit-btn {
        display: inline-flex;
        flex: 0 0 auto;
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.25);
        color: #fff;
        font-size: 0.8rem;
        padding: 0.35rem 0.55rem;
    }

    .app-header .header-toolbar-end .header-edit-btn:hover {
        background: rgba(255, 255, 255, 0.25);
    }

    .header-toolbar-end {
        gap: 0.35rem;
    }

    /* Tight right cluster: Edit, Options, sign out (one row with title bar) */
    .header-actions {
        width: auto;
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-end;
        align-items: center;
        gap: 0.35rem;
    }

    .header-primary-slot .quick-add-container,
    .header-primary-slot .quick-add-input-group {
        width: 100%;
        min-width: 0;
    }

    .header-primary-slot .quick-add-container {
        order: 0;
        flex: 1 1 100%;
    }

    .header-primary-slot .quick-add-input {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        /* 16px avoids iOS auto-zoom on focus */
        font-size: 1rem;
    }

    .quick-add-input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .header-primary-slot .quick-add-input-group .btn,
    #add-task-btn,
    #add-list-btn {
        min-height: 2.5rem;
    }

    .header-primary-slot #add-task-btn,
    .header-primary-slot #add-list-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-actions #options-btn,
    .header-actions #logout-btn {
        flex: 0 0 auto;
        width: 2.4rem;
        height: 2.4rem;
        min-height: 2.4rem;
    }

    .header-actions .nlp-feedback {
        max-width: 100%;
    }

    .content-header {
        padding: 1rem;
        flex: 0 0 auto;
    }

    .view-info {
        width: 100%;
    }

    .view-info .view-title {
        margin-bottom: 0;
    }

    .view-options-toggle {
        display: inline-flex;
    }

    .view-actions-panel {
        width: 100%;
        max-width: 100%;
        align-items: stretch;
    }

    .view-actions-panel:not(.view-actions-panel--open) .view-actions {
        display: none;
    }

    .view-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        max-width: 100%;
        gap: 0.5rem;
    }

    .view-actions .view-mode-toggle {
        align-self: flex-start;
    }

    .view-actions .search-box,
    .view-actions .search-box input {
        width: 100%;
        max-width: none;
    }

    .view-actions .search-box input {
        font-size: 1rem;
    }

    .view-actions .filter-select {
        width: 100%;
        font-size: 1rem;
    }

    .tag-filter-bar {
        flex: 0 0 auto;
    }

    .tasks-container {
        flex: 1 1 0;
        min-height: 0;
        padding: 0.75rem 1rem;
        -webkit-overflow-scrolling: touch;
    }

    .tasks-container.compact-view {
        padding: 0.5rem 0.65rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Task actions: hover not reliable on touch; keep controls visible */
    .task-card .task-actions,
    .compact-view .task-card .task-actions {
        opacity: 1;
    }

    /* Compact: one row (title+actions | date+priority), denser than desktop */
    .compact-view .task-card {
        padding: 0.28rem 0.45rem;
        margin-bottom: 0.08rem;
        gap: 0.3rem;
        /* keep row: .task-header | .task-meta (same as wide screens) */
    }

    .compact-view .task-header {
        min-width: 0;
    }

    .compact-view .task-title {
        font-size: 0.8125rem;
        line-height: 1.2;
        margin-right: 0.35rem;
    }

    .compact-view .task-header .task-actions {
        gap: 0.12rem;
    }

    .compact-view .task-header .btn-icon {
        width: 1.6rem;
        min-width: 1.6rem;
        height: 1.6rem;
        min-height: 1.6rem;
        font-size: 0.7rem;
    }

    .compact-view .task-meta {
        gap: 0.25rem;
        min-width: 0;
    }

    .compact-view .task-meta .due-date,
    .compact-view .task-meta .due-date--placeholder {
        min-width: 0;
        max-width: 4.5rem;
        width: 4.5rem;
        font-size: 0.65rem;
        line-height: 1.1;
        overflow: hidden;
    }

    .compact-view .task-meta .due-date {
        justify-content: flex-end;
    }

    .compact-view .priority-badge {
        min-width: 2.2rem;
        font-size: 0.55rem;
        padding: 0.08rem 0.22rem;
    }

    /* Slightly reduce motion on small screens */
    .task-card:hover {
        transform: none;
    }
}

/* Narrow phones: a touch more room for the title, slightly narrower date column */
@media (max-width: 480px) {
    .compact-view .task-meta .due-date,
    .compact-view .task-meta .due-date--placeholder {
        max-width: 4rem;
        width: 4rem;
        font-size: 0.6rem;
    }

    .app-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 640px) {
    .tag-selection-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .task-tag-modal {
        width: 95%;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a202c;
        color: #e2e8f0;
    }

    .sidebar,
    .content-header,
    .task-card,
    .modal {
        background-color: #2d3748;
        border-color: #4a5568;
    }

    .view-item,
    .list-item {
        color: #cbd5e0;
    }

    .view-item:hover,
    .list-item:hover {
        background-color: #4a5568;
    }

    .view-item.active,
    .list-item.active {
        background-color: #2b6cb0;
        color: #bee3f8;
    }

    .list-item .list-actions {
        background: linear-gradient(90deg, rgba(45, 55, 72, 0) 0%, #4a5568 0.45rem, #4a5568 100%);
        box-shadow: 0 0 0 1px rgba(74, 85, 104, 0.9);
    }

    .list-item.active .list-actions {
        background: linear-gradient(90deg, rgba(43, 108, 176, 0) 0%, #2b6cb0 0.45rem, #2b6cb0 100%);
    }
}

/* Tag Management Styles — one scroll: body scrolls, not the modal frame + body */
.tag-modal {
    width: 600px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* was overflow-y: auto — caused a second bar with .modal-content */
}

.tag-modal .modal-content {
    flex: 1 1 auto;
    min-height: 0; /* so flex child can shrink and overflow-y scrolls */
    overflow-y: auto;
    max-height: none; /* override .modal-content calc(90vh - 120px) and avoid nested scrolls */
}

.tag-controls {
    margin-bottom: 1.5rem;
}

.tags-list {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* Manage Tags: let .tag-modal .modal-content be the only scroller; list grows with it */
.tag-modal .tags-list {
    max-height: none;
    overflow: visible;
}

.tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #f7fafc;
    transition: all 0.2s;
}

.tag-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.tag-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.tag-color-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tag-name {
    font-weight: 500;
    color: #2d3748;
}

.tag-scope {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #718096;
    margin-top: 0.125rem;
}

.form-group-tag-lists {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.tag-lists-control {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.tag-lists-all-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    /* flex-end was wrong: “ALL”+checkbox is taller than one text line, so it aligned tops high */
    align-items: baseline; /* “Applies to Lists:” and “ALL” share a text baseline */
    gap: 0.25rem 0.5rem;
    font-size: 0.875rem;
    color: #2d3748;
    line-height: 1.3;
}

.tag-lists-prompt {
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.3;
}

.tag-lists-all-inline {
    display: inline-flex;
    flex-direction: row;
    align-items: center; /* checkbox next to the word, not shoved to the strut’s bottom */
    gap: 0.35rem;
    margin: 0;
    cursor: pointer;
    user-select: none;
    color: #4a5568;
    white-space: nowrap;
    line-height: 1.3; /* same as prompt for shared baseline in the parent row */
}

.tag-lists-all-word {
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.tag-lists-all-inline input {
    /* align box with the cap height of 0.875rem text: slightly down vs raw baseline */
    margin: 0;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    align-self: center;
    position: relative;
    top: 0.04em;
}

.tag-lists-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 0 0 0.1rem;
    border: none;
    background: transparent;
    color: #718096;
    cursor: help;
    line-height: 1;
    font-size: 0.875rem;
    /* sit on the same line as the label text, not the checkbox’s box */
    align-self: baseline;
    position: relative;
    top: 0.06em;
}

.tag-lists-help:hover,
.tag-lists-help:focus-visible {
    color: #3182ce;
    outline: none;
}

.tag-lists-help:focus-visible {
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.4);
    border-radius: 2px;
}

.tag-lists-multiselect {
    width: 100%;
    min-height: 5.25rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    font-size: 0.875rem;
}

.tag-lists-multiselect:disabled {
    background: #edf2f7;
    color: #a0aec0;
}

.tag-actions {
    display: flex;
    gap: 0.5rem;
}

.tag-form-container {
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1.5rem;
    background: #f7fafc;
}

.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.color-picker-container input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.color-presets {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.color-preset {
    width: 32px;
    height: 32px;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset.selected {
    border-color: #2b6cb0;
    box-shadow: 0 0 0 2px #2b6cb0;
}

.empty-tags {
    text-align: center;
    color: #718096;
    padding: 2rem;
}

.empty-tags i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

/* Tag form header styles */
.tag-form-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.tag-form-header h4 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
}

.tag-form-header .form-description {
    margin: 0;
    color: #718096;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Tag display styles for future use with tasks */
.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Task Tag Management */
.tags-management {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    min-height: 2rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #f8fafc;
}

.selected-tags:empty::after {
    content: "No tags selected";
    color: #a0aec0;
    font-style: italic;
    display: flex;
    align-items: center;
}

.task-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    background-color: var(--tag-color, #718096);
}

.task-tag-chip .remove-tag {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.task-tag-chip .remove-tag:hover {
    opacity: 1;
}

/* Task Tag Selection Modal */
.task-tag-modal {
    max-width: 600px;
    width: 90%;
}

.tag-selection-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.tag-column h4 {
    margin-bottom: 0.75rem;
    color: #2d3748;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.tag-list {
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 0.5rem;
    background-color: #f8fafc;
}

.tag-list:empty::after {
    content: "No tags";
    color: #a0aec0;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 100px;
}

.selectable-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-bottom: 0.25rem;
}

.selectable-tag:hover {
    background-color: #e2e8f0;
}

.selectable-tag:last-child {
    margin-bottom: 0;
}

.tag-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tag-name {
    font-size: 0.875rem;
    color: #2d3748;
    flex-grow: 1;
}

.selected-tags-list .selectable-tag {
    background-color: #e6fffa;
}

.selected-tags-list .selectable-tag:hover {
    background-color: #b2f5ea;
}

/* Tag Filter Styles */
.tag-filter-bar {
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.tag-filter-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #4a5568;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.tag-filter-header:hover {
    background-color: #edf2f7;
}

.tag-filter-header .collapse-toggle {
    background: none;
    border: none;
    color: #4a5568;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
    font-size: 0.75rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-filter-header .collapse-toggle.collapsed {
    transform: rotate(-90deg);
}

.tag-filter-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 0 0 auto;
}

.tag-filter-title i {
    color: #667eea;
}

.tag-filter-manage-tags {
    flex-shrink: 0;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.tag-filter-summary {
    color: #718096;
    font-size: 0.75rem;
    font-weight: 400;
    margin-left: auto;
    min-width: 0;
}

.tag-filter-content {
    padding: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.tag-filter-content.collapsed {
    display: none;
}

.tag-filter-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.selected-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-grow: 1;
    min-height: 1.5rem;
}

.no-tags {
    color: #a0aec0;
    font-style: italic;
    font-size: 0.875rem;
}

.tag-filter-actions {
    display: flex;
    gap: 0.5rem;
}

.tag-filter-actions .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Tag filter modal (add filter) */
.tag-filter-modal {
    max-width: 28rem;
    width: 92vw;
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 36rem);
}

.tag-filter-modal__header {
    padding: 1rem 1.25rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.tag-filter-modal__header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.tag-filter-modal__body {
    padding: 1.2rem 1.25rem 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.tag-filter-modal__lede {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.45;
}

.tag-filter-modal__hint {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #64748b;
}

.tag-filter-modal__hint strong {
    color: #475569;
    font-weight: 600;
}

.tag-filter-pick {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0.5rem;
    max-height: min(45vh, 16rem);
    overflow-y: auto;
    padding: 0.75rem;
    margin: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.tag-filter-pick__empty {
    margin: 0;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    width: 100%;
    padding: 1.25rem 0.5rem;
    line-height: 1.4;
}

.tag-filter-pick__chip {
    --c: var(--tag-color, #3182ce);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.35rem 0.65rem 0.35rem 0.45rem;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: #fff;
    color: #1e293b;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition:
        background 0.15s,
        border-color 0.15s,
        color 0.15s,
        box-shadow 0.15s;
    text-align: left;
    font-family: inherit;
}

.tag-filter-pick__chip:hover {
    border-color: var(--c);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}

.tag-filter-pick__swatch {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--c);
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.tag-filter-pick__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
}

.tag-filter-pick__chip--on {
    background: var(--c);
    color: #fff;
    border-color: var(--c);
}

.tag-filter-pick__chip--on .tag-filter-pick__swatch {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.tag-filter-pick__chip--on:hover {
    filter: brightness(0.97);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.tag-filter-modal__footer {
    padding: 0.9rem 1.25rem 1.1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
    background: #fff;
}

.tag-filter-bar__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    max-width: 100%;
    padding: 0.2rem 0.15rem 0.2rem 0.5rem;
    border-radius: 9999px;
    background: var(--tag-color, #3182ce);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    vertical-align: middle;
}

.tag-filter-bar__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 9rem;
}

.tag-filter-bar__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.14);
    color: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
    padding: 0;
    font-size: 0.65rem;
    line-height: 1;
}

.tag-filter-bar__remove:hover {
    background: rgba(0, 0, 0, 0.26);
}

/* Login Modal Styles */
#login-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#login-modal .modal-dialog {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 400px;
    width: 90vw;
    animation: loginModalIn 0.3s ease-out;
}

@keyframes loginModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#login-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem 0.75rem 0 0;
    text-align: center;
}

#login-modal .modal-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

#login-modal .modal-body {
    padding: 2rem 1.5rem;
}

.login-description {
    text-align: center;
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

#login-modal .form-group {
    margin-bottom: 1rem;
}

#login-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

#login-modal .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#login-modal .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#login-modal .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    text-align: center;
}

#login-modal .error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Delegated (magic-link) users: hide admin-only actions (API still enforces). */
body.auth-app-user #add-list-btn,
body.auth-app-user #manage-tags-btn,
body.auth-app-user #options-btn,
body.auth-app-user .list-actions,
body.auth-app-user .delete-task-btn,
body.auth-app-user #task-delete-btn,
body.auth-app-user #quick-add-resolution-create {
    display: none !important;
}

#login-modal .error-message.hidden {
    display: none;
}

/* Hide main app when not authenticated */
.app-container.login-required .main-content,
.app-container.login-required .app-header {
    filter: blur(5px);
    pointer-events: none;
}