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

html {
    scrollbar-gutter: stable;
    height: auto;
    width: 100%;
    overflow-y: scroll;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

#app {
    width: 100%;
    min-height: 100vh;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

header {
    background: #fafbfc;
    border-bottom: none;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    position: relative;
    z-index: 1400;
}

@keyframes header-gradient-slide {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header-top {
    padding: 12px 0;
    background: linear-gradient(90deg, #36bfb8 0%, #0066cc 50%, #36bfb8 100%);
    background-size: 200% 100%;
    animation: header-gradient-slide 6s ease infinite;
}

/* Keep top header visible while scrolling on non-small screens. */
@media (min-width: 731px) {
    header {
        padding-top: var(--desktop-header-total-offset, 0px);
    }

    .header-top {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1450;
    }

    .header-nav {
        position: fixed;
        top: var(--desktop-header-top-offset, 0px);
        left: 0;
        right: 0;
        z-index: 1440;
        background: #fafbfc;
    }
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.header-nav {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0;
}

.header-nav .container {
    display: flex;
    align-items: stretch;
    position: relative;
}

.header-nav .header-page-nav {
    display: flex;
    gap: 0;
    flex: none;
    justify-content: flex-start;
    margin-bottom: 0;
}

.views-bar-flash {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1301;
    max-width: min(42vw, 520px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 10px;
    border: 1px solid #bfe8e5;
    border-radius: 999px;
    background: rgba(245, 255, 254, 0.96);
    color: #0f766e;
    font-size: 12px;
    line-height: 1.25;
    font-weight: 600;
}

.header-nav .header-page-nav button {
    border-radius: 0;
    background: transparent;
    color: #4b5563;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.header-nav .header-page-nav button:hover {
    background: #f0f9f9;
    color: #0f7680;
}

.header-nav .header-page-nav button:not(.secondary) {
    color: #36bfb8;
    border-bottom-color: #36bfb8;
    background: transparent;
}

.header-nav .header-page-nav button:not(.secondary):hover {
    background: #f0f9f9;
}

.tools-dropdown {
    position: relative;
    display: inline-flex;
    align-items: stretch;
}

.tools-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 140px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.15);
    z-index: 1200;
    padding: 6px;
}

.tools-dropdown-menu button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #374151;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
}

.tools-dropdown-menu button:hover {
    background: #f0f9f9;
    color: #0f7680;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}

.header-user-meta {
    color: rgba(255, 255, 255, 0.9);
}

.header-top .header-toolbar-actions button.secondary {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.header-top .header-toolbar-actions button.secondary:hover {
    background: rgba(255, 255, 255, 0.28);
}

.clock {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    letter-spacing: 0.03em;
    font-variant-numeric: tabular-nums;
    display: inline-block;
    min-width: 13em;
}

button {
    background: #0066cc;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background: #0052a3;
}

button.secondary {
    background: #6c757d;
}

button.secondary:hover {
    background: #5a6268;
}

button.danger {
    background: #dc3545;
}

button.danger:hover {
    background: #c82333;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 100%;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-bottom: 24px;
    text-align: center;
    font-size: 28px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.error {
    color: #dc3545;
    font-size: 14px;
    margin-top: 4px;
}

.success {
    color: #157347;
    font-size: 14px;
    margin-top: 4px;
}

.page-nav {
    display: flex;
    gap: 8px;
}

.header-page-nav {
    flex: 1;
    justify-content: center;
    margin-bottom: 0;
}

.page-nav-wrapper {
    margin-bottom: 16px;
}

.mobile-menu-toggle {
    display: none;
}

.icon-button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    color: #1f2937;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mobileMenuBtnHeader,
#mobileNewTaskBtn,
#mobileTasksMenuBtnHeader {
    display: none;
}

.storage-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.storage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.usage-bar {
    width: 100%;
    height: 12px;
    background: #eef1f4;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #009688 0%, #4caf50 50%, #f57c00 85%, #dc3545 100%);
}

.table-list {
    margin-top: 8px;
    border-top: 1px solid #eee;
}

.table-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f3f3;
    font-size: 14px;
}

.users-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.users-card h3 {
    margin-bottom: 12px;
}

.users-list {
    border-top: 1px solid #eee;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f3f3;
}

.user-main {
    min-width: 0;
}

.user-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #666;
    font-size: 13px;
}

.user-role {
    text-transform: uppercase;
    font-weight: 600;
    color: #4b5563;
}

.user-online {
    color: #15803d;
    font-weight: 600;
}

.user-offline {
    color: #6b7280;
    font-weight: 600;
}

.user-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: #555;
    font-size: 13px;
    text-align: right;
}

.user-session-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.user-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
}

.user-session-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

button.sm {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.tasks-grid {
    display: grid;
    grid-template-columns: repeat(var(--task-columns-count, 1), minmax(0, 1fr));
    align-items: start;
    column-gap: var(--columns-view-column-gap, 6px);
    row-gap: 0;
    margin-bottom: 24px;
}

.task-grid-column {
    display: flex;
    flex-direction: column;
    gap: var(--columns-view-row-gap, 6px);
    min-width: 0;
    min-height: 140px;
}

.task-column-drop-zone {
    height: 0;
    min-height: 0;
    border-radius: 8px;
    transition: height 0.15s;
}

.tasks-grid.is-dragging .task-column-drop-zone {
    height: 56px;
    min-height: 56px;
}

.task-grid-column-empty {
    border: 2px dashed rgba(148, 163, 184, 0.45);
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.55);
}

.task-grid-column.drag-over-column {
    outline: 2px dashed rgba(0, 102, 204, 0.45);
    outline-offset: 4px;
    border-radius: 10px;
}

.column-new-task-btn {
    width: 100%;
    padding: 11px 10px;
    font-size: 12px;
    background: transparent;
    color: #9ca3af;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.column-new-task-btn:hover {
    background: #f0f7ff;
    color: #0066cc;
    border-color: #93c5fd;
}

.tasks-grid .task-card {
    margin-bottom: 0;
}

.tasks-toolbar {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 3px;
    margin-bottom: 16px;
    position: relative;
}

.toolbar-filters {
    display: flex;
    align-items: center;
    width: auto;
    margin-bottom: 0;
    gap: 6px;
    min-width: 0;
}

.toolbar-styles {
    display: flex;
    align-items: center;
    width: auto;
    gap: 12px;
    margin-left: auto;
}

.styles-layout-switcher {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: auto;
    gap: 4px;
}

.filters-selector {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: auto;
    gap: 4px;
}

.styles-layout-switcher button,
.filters-selector button {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 999px;
    line-height: 1.4;
    background: #f3f4f6;
    color: #374151;
    border: 1px solid transparent;
}

.styles-layout-switcher button {
    flex: 0 0 auto;
}

.filters-selector button {
    flex: 0 0 auto;
}

.styles-layout-switcher button:hover,
.filters-selector button:hover {
    background: #e5e7eb;
}

.styles-layout-switcher button:not(.secondary) {
    background: #0066cc;
    color: #fff;
    border-color: transparent;
}

.styles-layout-switcher button:not(.secondary):hover {
    background: #0052a3;
}

.styles-color-switcher button:not(.secondary) {
    background: #7c3aed;
    border-color: transparent;
}

.styles-color-switcher button:not(.secondary):hover {
    background: #6d28d9;
}

.tasks-list {
    grid-template-columns: 1fr;
    row-gap: var(--list-view-row-gap, 2px);
}

.tasks-list .task-grid-column {
    display: contents;
}

.tasks-list .task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 0;
}

.tasks-list .task-title {
    margin-bottom: 0;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding-right: 0;
}

.task-list-inline-meta,
.task-list-inline-description {
    display: none;
}

.task-title-text {
    min-width: 0;
}

.tasks-list .task-title-text {
    flex: 0 0 auto;
    font-size: 14px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.tasks-list .task-list-inline-meta {
    display: inline-block;
    flex: 0 0 auto;
    white-space: nowrap;
    color: var(--task-muted, #6b7280);
    font-size: 11px;
    font-weight: 500;
    background-color: #e5e7eb;
    padding: 2px 6px;
    border-radius: 3px;
}

.tasks-list .task-list-inline-description {
    display: inline-block;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--task-muted, #6b7280);
    font-size: 13px;
    font-weight: 400;
}

.tasks-list .task-card-footer {
    margin-top: 0;
    min-width: auto;
    justify-content: flex-end;
}

.tasks-list .task-card-footer .task-description-preview {
    display: none;
}

.tasks-long-view .task-card {
    min-height: 0;
}

.filters-selector button:not(.secondary) {
    background: #36bfb8;
    color: #fff;
    border-color: transparent;
}

.filters-selector button:not(.secondary):hover {
    background: #2fa9a3;
}

#filterSelectorCustom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#filterSelectorCustom::after {
    content: "▾";
    font-size: 10px;
    line-height: 1;
}

#filterSelectorCustom[aria-expanded="true"]::after {
    content: "▴";
}

.filters-panel {
    margin: -8px 0 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
}

.task-settings-panel {
    margin: 8px 0 12px;
    border: 1px solid #bfe8e5;
    border-radius: 10px;
    background: linear-gradient(180deg, #f7fffe 0%, #ffffff 100%);
    padding: 12px;
}

.task-settings-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.task-settings-panel-head h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #0f766e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.task-settings-readonly {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e6f6f5;
    color: #0f766e;
    border: 1px solid #bfe8e5;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
}

.task-settings-save-indicator {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    background: #f8fafc;
}

.task-settings-save-indicator.hidden {
    visibility: hidden;
}

.task-settings-save-indicator.saving {
    color: #0f766e;
    border-color: #99f6e4;
    background: #ecfdf5;
}

.task-settings-save-indicator.saved {
    color: #166534;
    border-color: #86efac;
    background: #f0fdf4;
}

.task-settings-save-indicator.error {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}

.task-settings-note {
    margin: 0 0 10px;
    font-size: 12px;
    color: #4b5563;
}

.task-settings-note.compact {
    margin-bottom: 6px;
    font-size: 11px;
}

.task-middle-behavior-options {
    margin: 6px 0;
    padding: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.task-middle-option-btn {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    cursor: pointer;
    font-size: 11px;
    color: #334155;
    padding: 6px 7px;
    border: 1px solid #dde6ef;
    border-radius: 6px;
    background: #ffffff;
    text-align: left;
    line-height: 1.2;
}

.task-middle-option-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.task-middle-option-btn.active {
    border-color: #0f766e;
    background: #ecfdf5;
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.task-middle-option-btn small {
    color: #64748b;
    display: block;
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.25;
}

.task-middle-option-btn strong {
    font-size: 11px;
    color: #0f172a;
}

.task-popup-position-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-popup-position-options .task-middle-option-btn {
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 34px;
}

@media (max-width: 900px) {
    .task-middle-behavior-options {
        grid-template-columns: 1fr;
    }

    .task-popup-position-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.task-settings-warning {
    background: #fef3cd;
    border: 1px solid #f3dfa0;
    border-radius: 8px;
    padding: 8px 10px;
}

.task-shortcut-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

.task-shortcut-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    color: #334155;
}

.task-shortcut-list kbd {
    min-width: 48px;
    text-align: center;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: #0f766e;
    background: #ecfdf5;
    border: 1px solid #99f6e4;
    border-radius: 6px;
    padding: 3px 7px;
    line-height: 1.1;
    box-shadow: inset 0 -1px 0 rgba(15, 118, 110, 0.15);
}

.task-shortcut-list span {
    min-width: 0;
}

.settings-card .task-settings-panel {
    margin: 8px 0 0;
}

.filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 8px;
}

.filter-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    color: #374151;
}

.filter-item input {
    width: auto;
}

.task-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 14px;
    padding-bottom: 12px;
    padding-top: 10px;
    cursor: pointer;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    color: var(--task-fg, #111827);
}

.task-card.task-card-has-draft {
    overflow: hidden;
}

.task-card.task-card-has-draft::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    background-image: repeating-linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.05) 0px,
        rgba(15, 23, 42, 0.05) 6px,
        rgba(15, 23, 42, 0) 6px,
        rgba(15, 23, 42, 0) 12px
    );
}

.task-card.task-card-has-draft > * {
    position: relative;
    z-index: 1;
}

.task-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #0066cc;
    transform: translateX(4px);
}

.task-card.dragging {
    opacity: 0.55;
}

.task-card.drag-over {
    outline: 2px dashed #0066cc;
    outline-offset: 2px;
}

.task-card.drag-insert-before {
    box-shadow: inset 0 3px 0 #0066cc;
}

.task-card.locked {
    background: #fff8e1;
    border-color: #ffc107;
}

.deleted-task-card {
    cursor: default;
}

.deleted-task-list {
    margin-top: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.deleted-task-row {
    display: grid;
    grid-template-columns: 28px 1.7fr 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
}

.deleted-task-row:first-child {
    border-top: none;
}

.deleted-task-header {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.02em;
}

.deleted-task-title {
    font-weight: 600;
    color: #1f2937;
}

.deleted-task-row[data-task-deleted="1"] {
    cursor: default;
}

.deleted-task-row[data-task-deleted="1"]:hover {
    background: #f8fafc;
}

.deleted-task-actions {
    display: flex;
    gap: 4px;
}

.deleted-task-actions button.sm {
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.4;
}

.deleted-pagination {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.deleted-page-indicator {
    font-size: 13px;
    color: #475569;
}

.deleted-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    margin-left: auto;
}

.deleted-bulk-toolbar button {
    padding: 4px 9px;
    font-size: 11px;
    line-height: 1.35;
}

.deleted-bulk-count {
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
    margin-right: 4px;
}

.deleted-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 6px;
}

.deleted-section-header h4 {
    margin: 0;
}

.task-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-word;
    padding-right: 92px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    color: var(--task-fg, #111827);
}

.task-creator {
    font-size: 12px;
    font-weight: 500;
    color: var(--task-muted, #6b7280);
    white-space: nowrap;
    position: absolute;
    top: 10px;
    right: 16px;
    margin-left: 0;
}

.task-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.task-description-preview {
    margin-top: 8px;
    font-size: 13px;
    color: var(--task-muted, #666);
    max-height: 40px;
    overflow: hidden;
}

.task-description-preview p,
.task-description-preview ul,
.task-description-preview ol {
    margin: 0;
}

.task-description-preview ul,
.task-description-preview ol {
    margin-top: 4px;
    padding-left: 18px;
    list-style-position: inside;
}

.task-description-preview ul {
    list-style-type: disc;
}

.task-description-preview ol {
    list-style-type: decimal;
}

.task-description-preview,
.task-description-preview p,
.task-description-preview li,
.task-description-preview strong,
.task-description-preview em,
.task-description-preview code,
.task-description-preview a {
    color: inherit;
}

.task-description-preview pre {
    margin: 4px 0;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-description-preview pre code,
.task-description-preview code {
    white-space: inherit;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-card-footer {
    margin-top: auto;
    display: block;
    padding-right: 40px;
}

.task-card-footer .task-description-preview {
    margin-top: 0;
}

.task-card-expanded-body {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.task-card-expanded-body .task-description-preview {
    margin-top: 0;
}

.task-card-expanded .task-card-footer {
    margin-top: 0px;
}

.task-description-preview-full {
    max-height: none;
    overflow: visible;
}

.task-card-subtasks {
    margin-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.24);
    padding-top: 10px;
}

.task-card-section-title,
.task-card-subtasks-title {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--task-muted, #6b7280);
}

.task-card-actions {
    position: absolute;
    right: 10px;
    bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.task-card:hover .task-card-actions,
.task-card:focus-within .task-card-actions,
.task-card-actions:focus-within {
    opacity: 1;
    pointer-events: auto;
}

.card-delete-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    background: transparent;
    color: var(--task-delete, #c74343);
    border: 1px solid transparent;
}

.card-delete-btn:hover {
    background: var(--task-delete-hover-bg, rgba(199, 67, 67, 0.08));
    border-color: var(--task-delete-hover-border, rgba(199, 67, 67, 0.28));
}

.card-delete-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.task-private-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    color: #374151;
}

.task-private-toggle input {
    width: auto;
}

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

.task-detail-pair h4,
.task-detail-pair label {
    margin-bottom: 6px;
}

.task-meta-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-meta-line {
    font-size: 13px;
    color: #374151;
    display: flex;
    gap: 6px;
    align-items: baseline;
    flex-wrap: wrap;
}

.task-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.status-todo {
    background: #e3f2fd;
    color: #1976d2;
}

.status-in_progress {
    background: #fff3e0;
    color: #f57c00;
}

.status-done {
    background: #e8f5e9;
    color: #388e3c;
}

.lock-badge {
    font-size: 12px;
    color: var(--task-muted, #ffc107);
    margin-left: 8px;
}

.task-card-soft {
    --task-delete: #c74343;
    --task-delete-hover-bg: rgba(199, 67, 67, 0.08);
    --task-delete-hover-border: rgba(199, 67, 67, 0.28);
}

.task-card-strong {
    border-color: rgba(17, 24, 39, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    --task-delete: var(--task-fg, #f9fafb);
    --task-delete-hover-bg: rgba(255, 255, 255, 0.12);
    --task-delete-hover-border: rgba(255, 255, 255, 0.28);
}

.subtasks-editor {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.subtask-item {
    display: grid;
    grid-template-columns: 24px 1fr 136px 30px;
    gap: 6px;
    align-items: center;
    font-size: 12px;
}

.subtask-item textarea,
.subtask-item select {
    font-size: 12px;
    padding: 6px 8px;
}

.subtask-item .subtask-line {
    min-height: 30px;
    max-height: 120px;
    resize: vertical;
    line-height: 1.3;
}

.subtask-item.dragging {
    opacity: 0.55;
}

.subtask-item.drag-over {
    outline: 2px dashed #0066cc;
    outline-offset: 2px;
}

.subtask-drag-handle {
    width: 24px;
    height: 30px;
    padding: 0;
    border-radius: 5px;
    background: #eef2f7;
    color: #475569;
    font-family: monospace;
    font-size: 12px;
    line-height: 1;
    cursor: grab;
}

.subtask-drag-handle:hover {
    background: #dde5ef;
}

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

.subtask-delete-btn {
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    background: #dc3545;
    font-size: 13px;
    line-height: 1;
}

.subtask-delete-btn:hover {
    background: #c82333;
}

.modal-content .subtask-add-btn {
    margin-top: 6px;
    padding: 6px 8px;
    min-height: 30px;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.2;
}

.subtask-empty {
    color: #666;
    font-size: 13px;
}

.subtask-view-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.subtask-view-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 2px;
    align-items: start;
    font-size: 13px;
}

.subtask-view-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    min-height: 15px;
    font-size: 10px;
    font-weight: 600;
    color: #444;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 1px 5px;
    text-align: center;
    margin-top: 1px;
    white-space: nowrap;
}

.subtask-view-content {
    min-width: 0;
    color: #374151;
    line-height: 1.45;
}

.subtask-view-content p,
.subtask-view-content ul,
.subtask-view-content ol {
    margin: 0;
}

.subtask-view-content ul,
.subtask-view-content ol {
    margin-left: 14px;
    padding-left: 14px;
}

.subtask-view-content li {
    margin: 2px 0;
}

.subtask-view-status.status-in_progress,
.task-hover-subtask-status.status-in_progress {
    background: linear-gradient(90deg, #fff5db 0%, #ffe7b8 100%);
    color: #b66507;
}

.subtask-view-status.status-planned,
.task-hover-subtask-status.status-planned {
    background: linear-gradient(90deg, #eef6ff 0%, #dfeeff 100%);
    color: #3568b8;
}

.subtask-view-status.status-pending,
.task-hover-subtask-status.status-pending {
    background: linear-gradient(90deg, #f3efff 0%, #e9defe 100%);
    color: #6850b7;
}

.subtask-view-status.status-optional,
.task-hover-subtask-status.status-optional {
    background: linear-gradient(90deg, #f4f8fb 0%, #e7eef5 100%);
    color: #5e7185;
}

.subtask-view-status.status-completed,
.task-hover-subtask-status.status-completed {
    background: linear-gradient(90deg, #e8f7ec 0%, #d7f0dd 100%);
    color: #2e7d4c;
}

.task-hover-card {
    position: fixed;
    z-index: 1200;
    width: min(360px, calc(100vw - 16px));
    max-height: min(80vh, 600px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
    padding: 10px 12px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
    user-select: text;
    -webkit-user-select: text;
}

.task-hover-card.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.frozen-hover-card-actions {
    display: none;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.frozen-hover-card-edit {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
}

.frozen-hover-card-delete {
    padding: 4px 12px;
    border: 1px solid rgba(199, 67, 67, 0.25);
    border-radius: 999px;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
}

/* Touch device adjustments: increase tapability and expose controls that are hover-only on desktop. */
@media (hover: none), (pointer: coarse) {
    .clock {
        display: none;
    }

    /* Prevent iOS Safari auto-zoom only during focus, without enlarging default modal layout. */
    .modal-content input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):focus,
    .modal-content textarea:focus,
    .modal-content select:focus {
        font-size: 16px;
    }

    .tasks-toolbar {
        flex-wrap: wrap;
        align-items: stretch;
        gap: 4px;
    }

    .filters-selector {
        gap: 6px;
    }

    .styles-layout-switcher button {
        padding: 3px 9px;
        font-size: 11px;
        line-height: 1.25;
    }

    .filters-selector button {
        flex: 1 1 0;
        min-width: 0;
        padding: 3px 8px;
        line-height: 1;
    }

    #filterSelectorCustom {
        gap: 5px;
    }

    #filterSelectorCustom::after {
        font-size: 11px;
    }

    .task-shortcut-list {
        grid-template-columns: 1fr;
    }

    .task-card .task-card-actions {
        opacity: 1;
        pointer-events: auto;
    }

    .frozen-hover-card-actions {
        display: inline-flex;
    }

    .frozen-hover-card {
        max-height: min(65vh, 450px);
    }

    .frozen-hover-card::after {
        content: '';
        display: block;
        height: 50px;
        pointer-events: none;
    }
}

.frozen-hover-card {
    pointer-events: auto;
    padding-top: 18px;
    padding-bottom: 12px;
    touch-action: pan-y;
    user-select: text;
    -webkit-user-select: text;
    overscroll-behavior: contain;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.frozen-hover-card.dragging {
    cursor: grabbing;
}

.frozen-hover-card .task-hover-title-content {
    display: flex;
    align-items: center;
    margin: -8px -8px 6px;
    padding: 8px 26px 8px 8px;
    background: white;
    border-radius: 6px 6px 0 0;
    cursor: grab;
    user-select: none;
}

.frozen-hover-card .task-hover-title-text {
    flex: 1;
    font-weight: 700;
    min-width: 0;
}

.frozen-hover-card-close {
    padding: 4px 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
}

.ui-map-card {
    position: fixed;
    z-index: 1305;
    width: min(420px, calc(100vw - 16px));
}

.ui-map-card .task-hover-title-content[data-ui-map-drag-handle="1"] {
    cursor: grab;
}

.ui-map-card.dragging .task-hover-title-content[data-ui-map-drag-handle="1"] {
    cursor: grabbing;
}

.ui-map-actions {
    display: inline-flex;
}

.ui-map-body {
    font-size: 12px;
    color: #374151;
}

.ui-map-section-title {
    margin: 8px 0 4px;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.ui-map-list {
    margin: 0;
    padding-left: 18px;
}

.ui-map-list li {
    margin: 3px 0;
}

.app-version-subscript {
    font-size: 11px;
    font-weight: 600;
    color: inherit;
    margin-left: 4px;
}

.release-notes-card {
    position: fixed;
    z-index: 1307;
    width: min(560px, calc(100vw - 24px));
    max-height: min(76vh, 640px);
}

.release-notes-body {
    max-height: min(66vh, 560px);
    overflow: auto;
}

.release-version-block + .release-version-block {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.release-version-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.release-version-date {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
}

.release-version-list {
    margin: 0;
    padding-left: 18px;
    color: #1f2937;
    font-size: 13px;
}

.release-version-list li {
    margin: 4px 0;
}

.email-logs-card {
    position: fixed;
    z-index: 1306;
    width: min(900px, calc(100vw - 16px));
    max-height: min(80vh, 760px);
}

.email-logs-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-logs-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.email-logs-stat {
    border: 1px solid #dbe4ea;
    border-radius: 8px;
    padding: 8px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.email-logs-stat strong {
    font-size: 11px;
    color: #334155;
}

.email-logs-stat span {
    font-size: 16px;
    color: #0f172a;
    font-weight: 700;
}

.email-logs-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.email-logs-controls input[type="date"] {
    width: 200px;
}

.email-logs-panels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.email-logs-table-wrap {
    border: 1px solid #dbe4ea;
    border-radius: 8px;
    overflow: auto;
    max-height: 260px;
    background: #fff;
}

.email-logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.email-logs-table th,
.email-logs-table td {
    border-bottom: 1px solid #edf2f7;
    padding: 7px 8px;
    text-align: left;
    white-space: nowrap;
}

.email-logs-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 1;
    color: #334155;
}

.email-log-status.ok {
    color: #166534;
    font-weight: 700;
}

.email-log-status.fail {
    color: #b91c1c;
    font-weight: 700;
}

@media (min-width: 1200px) {
    .email-logs-panels {
        grid-template-columns: 1fr 1.3fr;
    }
}

/* -------------------------------------------------------------------------
   Shared Task Preview Card Styles
   Source of truth for hover/frozen card spacing and layout.
   Popup/new-tab windows intentionally reuse these class names via app.js.
   If you change spacing here, popup/new-tab should update automatically.
   ------------------------------------------------------------------------- */

.task-hover-title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 14px;
    color: #111827;
}

.task-hover-subtask-row.completed .task-hover-subtask-content,
.subtask-view-item.completed .subtask-view-content {
    text-decoration: line-through;
    opacity: 0.6;
}

.task-hover-row {
    font-size: 12px;
    color: #374151;
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}

.task-hover-task-id {
    margin-top: 8px;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: #c4c8cf;
}

.task-hover-desc {
    margin-top: 8px;
    padding-bottom: 10px;
    color: #4b5563;
    font-size: 12px;
    line-height: 1.4;
}

.task-hover-desc + .task-hover-divider {
    margin-top: 0;
}

.task-hover-desc p,
.task-hover-desc ul,
.task-hover-desc ol {
    margin: 0;
}

.task-hover-desc ul,
.task-hover-desc ol {
    margin-top: 4px;
    margin-left: 14px;
    padding-left: 14px;
}

.task-hover-desc li {
    margin: 2px 0;
}

.task-hover-desc pre {
    margin: 4px 0;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-hover-desc pre code,
.task-hover-desc code {
    white-space: inherit;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-hover-subtasks {
    margin-top: 8px;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.task-hover-subtasks + .task-hover-divider {
    margin-top: 0;
}

.task-hover-subtasks-summary {
    margin-top: 8px;
}

.task-hover-subtask-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: 2px;
    align-items: start;
    font-size: 12px;
    color: #374151;
}

.task-hover-subtask-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    min-height: 15px;
    border-radius: 999px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 1px;
}

.task-hover-subtask-content {
    min-width: 0;
    color: #374151;
    line-height: 1.45;
}

.task-hover-subtask-content p,
.task-hover-subtask-content ul,
.task-hover-subtask-content ol {
    margin: 0;
}

.task-hover-subtask-content ul,
.task-hover-subtask-content ol {
    margin-left: 12px;
    padding-left: 12px;
}

.task-hover-subtask-content li {
    margin: 2px 0;
}

.task-hover-subtask-content pre {
    margin: 4px 0;
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-hover-subtask-content pre code,
.task-hover-subtask-content code {
    white-space: inherit;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.task-hover-more {
    margin-top: 2px;
    color: #6b7280;
    font-size: 11px;
}

.task-hover-divider {
    border-top: 1px solid #e5e7eb;
    margin: 8px 0 6px;
}

/* End shared task preview card styles */

.task-title-row {
    margin-bottom: 8px;
}

.task-title-row #taskTitle {
    width: 100%;
}

.task-title-inline-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.color-picker-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.color-picker-inline label {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.color-picker-inline input[type="color"] {
    width: 36px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
}

.permission-picker-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.permission-picker-inline label {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.permission-picker-inline select {
    width: 150px;
    min-width: 150px;
    font-size: 12px;
    padding: 6px 8px;
    height: 34px;
}

.reminder-picker-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    position: relative;
}

.reminder-picker-inline label {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.reminder-choice-group {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.reminder-choice-group button {
    height: 34px;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.1;
}

#taskReminderPickBtn {
    width: 34px;
    min-width: 34px;
    padding: 0;
    font-size: 15px;
}

.reminder-datetime-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
    padding: 0;
}

.reminder-selection-line {
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    color: #dc2626;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    display: none;
}

.reminder-selection-line.visible {
    display: block;
}

.color-picker-inline-profile input[type="color"] {
    width: 48px;
    height: 34px;
}

.color-picker-hex {
    font-size: 12px;
    color: #4b5563;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.profile-top-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.profile-username-group {
    flex: 1;
}

.profile-color-group {
    width: 120px;
}

.profile-password-section {
    margin-top: 16px;
    border-top: 1px solid #e5e7eb;
    padding-top: 14px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2200;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease-out;
}

.modal.active .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
}

.modal-content > form {
    padding: 20px 24px 24px;
}

.modal-header {
    padding: 16px 24px;
    background: linear-gradient(90deg, #36bfb8 0%, #0066cc 100%);
    border-radius: 12px 12px 0 0;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    color: #fff;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #fff;
}

.modal-section {
    margin-bottom: 16px;
}

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

.modal-section-head label {
    margin-bottom: 0;
    font-size: 14px;
    font-weight: 500;
}

.modal-unsaved-indicator {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid #f6c88c;
    background: #fff7e8;
    color: #9a3412;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
}

.modal-unsaved-indicator.hidden {
    display: none;
}

.modal-section h4 {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #36bfb8;
}

.preview {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    min-height: 60px;
    font-size: 14px;
    line-height: 1.6;
}

.conflict-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
    color: #856404;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.button-group button {
    flex: 1;
}

.modal-content .button-group button:not(.secondary):not(.danger) {
    background: linear-gradient(90deg, #36bfb8 0%, #0066cc 100%);
    border: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.modal-content .button-group button:not(.secondary):not(.danger):hover {
    background: linear-gradient(90deg, #2aada6 0%, #0055b3 100%);
}

.modal-content button.secondary {
    background: transparent;
    color: #4b5563;
    border: 1.5px solid #d1d5db;
}

.modal-content button.secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}

.modal-content .button-group button.danger {
    background: #fff0f0;
    color: #dc3545;
    border: 1.5px solid #fca5a5;
}

.modal-content .button-group button.danger:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
    border-color: #36bfb8;
    box-shadow: 0 0 0 3px rgba(54, 191, 184, 0.15);
}

.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 12px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: #36bfb8;
    border-bottom-color: #36bfb8;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tabs-inline {
    margin-bottom: 0;
    border-bottom: none;
    gap: 6px;
}

.tabs-inline .tab {
    padding: 6px 10px;
    min-height: 27px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    line-height: 1.1;
    font-size: 11px;
}

.tabs-inline .tab.active {
    border-color: #36bfb8;
}

.loading {
    text-align: center;
    padding: 24px;
    color: #999;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0066cc;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

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

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

/* Small-screen device layout baseline: stack navigation/content and resize dense UI elements for narrow viewports. */
@media (max-width: 730px) {
    .tasks-grid {
        grid-template-columns: 1fr;
    }

    .header-top .container {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-nav {
        display: block;
    }

    .header-right {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }

    .header-user-meta {
        display: flex;
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }

    .header-toolbar-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-menu-toggle {
        display: block;
        padding: 8px 12px;
        border: 1px solid #d1d5db;
        border-radius: 4px;
        background: white;
        color: #1f2937;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
    }

    .mobile-menu-toggle.icon-button {
        padding: 0;
        width: 40px;
        height: 40px;
    }

    #mobileMenuBtnHeader,
    #mobileNewTaskBtn,
    #mobileTasksMenuBtnHeader {
        display: flex;
    }

    .page-nav-wrapper {
        position: relative;
        margin-bottom: 16px;
    }

    #mobileMenuBtn {
        display: none;
    }

    .header-page-nav {
        display: none;
    }

    .page-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 64px;
        left: 8px;
        right: auto;
        width: min(280px, calc(100vw - 16px));
        background: white;
        border: 1px solid #ddd;
        border-top: 1px solid #ddd;
        border-radius: 0 0 4px 4px;
        padding: 0;
        gap: 0;
        margin: 0;
        z-index: 1500;
        max-height: 0;
        overflow: hidden;
        visibility: hidden;
        opacity: 0;
        transition: max-height 0.2s ease, opacity 0.2s ease;
    }

    .page-nav.mobile-menu-open {
        max-height: 500px;
        visibility: visible;
        opacity: 1;
    }

    .page-nav button {
        display: block;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 12px 8px;
        text-align: left;
        margin: 0;
        width: 100%;
        word-wrap: break-word;
        white-space: normal;
        background: white;
        color: #1f2937;
        font-size: 14px;
        cursor: pointer;
    }

    .page-nav button:last-child {
        border-bottom: none;
    }

    .page-nav.mobile-menu-open button:last-child {
        border-bottom: none;
    }

    .page-nav .tools-dropdown {
        display: block;
        width: 100%;
    }

    .page-nav .tools-dropdown-menu {
        position: static;
        width: 100%;
        min-width: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
        box-shadow: none;
        padding: 0;
    }

    .page-nav .tools-dropdown-menu button {
        border-bottom: 1px solid #f0f0f0;
        border-radius: 0;
        padding: 12px 8px;
        font-size: 14px;
    }

    .tasks-toolbar {
        position: relative;
        margin-bottom: 2px;
        flex-direction: column;
    }

    .toolbar-filters .filters-selector {
        width: 100%;
        flex: 1 1 100%;
        min-width: 0;
    }

    .toolbar-filters .filters-selector button {
        flex: 1 1 0;
        min-width: 0;
    }

    /* toolbar under small screen has this structure: ((filters, styles), column_selector), 3 rows in total */
    .toolbar-filters,
    .toolbar-styles,
    .mobile-column-toggle-row {
        min-height: 8px;
        padding: 2px;
        border-radius: 12px;
        box-sizing: border-box;
        background: #f5fffe;
        border: 1px solid #bfe8e5;
        align-items: stretch;
        z-index: 1200;
        margin: 0;
        width: 100%;
        display: flex;
    }

    .styles-layout-switcher {
        margin: 0px;
        align-items: stretch;
    }

    .toolbar-styles {
        flex-wrap: nowrap;
    }

    .toolbar-styles .styles-layout-switcher {
        width: auto;
        flex: 1 1 0;
    }

    .styles-layout-switcher button {
        flex: 1;
        justify-content: center;
    }

    .mobile-column-toggle-row {
        margin-bottom: 4px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-column-toggle-btn {
        flex: 1 1 90px;
        min-height: 26px;
        border-radius: 10px;
        padding: 4px 8px;
        font-size: 12px;
        line-height: 1.25;
    }

    .mobile-column-toggle-btn.active {
        background: var(--mobile-column-selected-bg, #36bfb8);
        border-color: transparent;
        color: #fff;
    }

    .mobile-column-toggle-btn.active:hover {
        filter: brightness(0.95);
    }

    .tasks-list .task-card {
        grid-template-columns: 1fr;
    }

    .task-detail-pair-row {
        grid-template-columns: 1fr;
    }

    .profile-top-row {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-color-group {
        width: 100%;
    }

    .login-box {
        padding: 24px;
    }

    .user-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-side {
        align-items: flex-start;
        text-align: left;
    }

    .user-session-item {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .subtask-item {
        grid-template-columns: 1fr;
    }

    .subtask-delete-btn {
        width: 100%;
    }

    .subtask-view-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .task-title-inline-controls {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
    }

    .reminder-picker-inline {
        flex: 1 1 100%;
        width: 100%;
    }

    .permission-picker-inline select {
        width: 132px;
        min-width: 132px;
    }

    .reminder-choice-group button {
        padding: 6px 8px;
    }

    #taskReminderPickBtn {
        width: 32px;
        min-width: 32px;
    }

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

    .tabs-inline {
        margin-bottom: 0;
        border-bottom: none;
        gap: 6px;
    }

    .tabs-inline .tab {
        padding: 6px 10px;
        min-height: 27px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        line-height: 1.1;
        font-size: 11px;
    }

    .tabs-inline .tab.active {
        border-color: #0066cc;
    }
}

/* Small-and-touch screens only: tighten header/toolbar spacing for handheld ergonomics. */
@media (max-width: 730px) and (hover: none), (max-width: 730px) and (pointer: coarse) {
    header {
        padding: 8px 0;
        margin-bottom: 4px;
    }

    .tasks-toolbar {
        margin-bottom: 4px;
    }

    .header-top .container {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .header-right {
        width: auto;
        align-items: center;
    }

    .header-user-meta {
        flex-direction: row;
        align-items: center;
        font-size: 13px;
    }

}

/* Markdown styles */
.preview h1,
.preview h2,
.preview h3 {
    margin-top: 12px;
    margin-bottom: 8px;
}

.preview h1 {
    font-size: 24px;
}

.preview h2 {
    font-size: 20px;
}

.preview h3 {
    font-size: 16px;
}

.preview p {
    margin-bottom: 8px;
}

.preview ul,
.preview ol {
    margin-left: 20px;
    margin-bottom: 8px;
}

.preview li {
    margin-bottom: 4px;
}

.preview code {
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.preview blockquote {
    border-left: 4px solid #ddd;
    margin: 8px 0;
    padding-left: 12px;
    color: #666;
}

.preview a {
    color: #0066cc;
    text-decoration: none;
}

.preview a:hover {
    text-decoration: underline;
}
