/* Global Styles */
:root {
    --list-width: 300px;
    --list-collapsed-width: 48px;
    --list-gap: 16px;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: auto;
}

.error {
    color: var(--pico-del-color);
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Login Screen */
#login-screen {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#login-screen article {
    max-width: 400px;
    margin: 0 auto;
}

/* App Header - Stealth and minimal */
nav {
    border-bottom: 1px solid var(--pico-muted-border-color);
    padding: 0.25rem 0.75rem !important;
    opacity: 1;
    transition: opacity 0.2s;
}

nav ul {
    margin: 0 !important;
    padding: 0 !important;
    gap: 0.25rem;
}

nav li {
    padding: 0 !important;
    margin: 0 !important;
}

nav button {
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.3;
    transition: opacity 0.2s;
}

nav button:hover {
    opacity: 1;
}

nav strong {
    font-size: 0.85rem;
}

#user-name {
    font-size: 0.75rem;
    padding: 0.15rem 0.25rem;
    margin: 0 1rem;
}

/* Board Switcher */
.board-switcher {
    position: relative;
}

.board-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.85rem !important;
    opacity: 1 !important;
    min-width: 150px;
    justify-content: space-between;
}

.board-switcher-btn span:first-child {
    cursor: pointer;
}

.board-switcher-arrow {
    font-size: 0.7rem;
    opacity: 0.7;
}

.board-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.25rem;
    min-width: 200px;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    box-shadow: var(--pico-card-box-shadow);
    z-index: 1000;
    padding: 0.5rem 0;
}

.board-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--pico-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.board-dropdown a:hover {
    background-color: var(--pico-secondary-background);
}

.board-dropdown hr {
    margin: 0.5rem 0;
    border-color: var(--pico-muted-border-color);
}

/* Board Action Panels (Rename/Delete) */
.board-action-panel {
    padding: 1rem;
    min-width: 250px;
}

.board-action-panel h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.board-action-panel p {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
}

.board-action-panel input {
    margin-bottom: 0.75rem !important;
    font-size: 0.875rem;
}

.board-action-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.board-action-buttons button {
    flex: 1;
    font-size: 0.8rem !important;
    padding: 0.4rem 0.6rem !important;
    opacity: 1 !important;
}

/* Mobile Navigation */
.nav-mobile {
    display: none;
}

.hamburger-btn {
    font-size: 1.5rem !important;
    padding: 0.25rem 0.5rem !important;
    line-height: 1;
    opacity: 1 !important;
}

.hamburger-icon {
    display: inline-block;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: flex-end;
}

.mobile-menu {
    background: var(--pico-background-color);
    width: 80%;
    max-width: 300px;
    height: 100%;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
}

.mobile-menu-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--pico-color);
    opacity: 0.7;
}

.mobile-menu-close:hover {
    opacity: 1;
}

.mobile-menu-section {
    margin-bottom: 2rem;
}

.mobile-menu-section h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
    margin-bottom: 1rem;
}

.mobile-menu-user {
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.mobile-menu-btn {
    width: 100%;
    margin-bottom: 0.5rem;
    opacity: 1 !important;
}

/* Board Switcher Mobile */
.board-switcher-mobile {
    position: relative;
}

.board-switcher-btn-mobile {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    opacity: 1 !important;
}

.board-dropdown-mobile {
    margin-top: 0.5rem;
    background: var(--pico-card-background-color);
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    padding: 0.5rem 0;
}

.board-dropdown-mobile a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--pico-color);
    text-decoration: none;
    transition: background-color 0.2s;
}

.board-dropdown-mobile a:hover {
    background-color: var(--pico-secondary-background);
}

.board-dropdown-mobile hr {
    margin: 0.5rem 0;
    border-color: var(--pico-muted-border-color);
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .nav-desktop {
        display: none;
    }

    .nav-mobile {
        display: flex;
    }

    nav strong {
        font-size: 1rem;
    }
}

/* Lists Container */
.lists-wrapper {
    display: flex;
    gap: var(--list-gap);
    padding: 1rem;
    min-height: calc(100vh - 90px);
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: safe center;
    align-items: flex-start;
}

/* List Card */
.list-card {
    flex-shrink: 0;
    width: var(--list-width);
    height: calc(100vh - 90px);
    background: var(--pico-card-background-color);
    border-radius: var(--pico-border-radius);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    perspective: 1000px;
}

.list-card.collapsed {
    width: var(--list-collapsed-width);
}

/* List Card Flip Architecture */
.list-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

/* Hide config panel when collapsed to prevent showing during drag */
.list-card.collapsed .list-card-back {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .list-card-inner {
        transition: none;
    }
}

.list-card[data-flipped="true"] .list-card-inner {
    transform: rotateY(180deg);
}

.list-card-front,
.list-card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    width: 100%;
    height: 100%;
}

.list-card-front {
    display: flex;
    flex-direction: column;
}

.list-card-back {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotateY(180deg);
    background: var(--pico-card-background-color);
    border-radius: var(--pico-border-radius);
    overflow-y: auto;
}

/* Disable pointer events on hidden sides */
.list-card[data-flipped="false"] .list-card-back {
    pointer-events: none;
}

.list-card[data-flipped="true"] .list-card-front {
    pointer-events: none;
}

/* List Header - Compact */
.list-header {
    padding: 0.5rem 0.75rem;
    border-radius: var(--pico-border-radius) var(--pico-border-radius) 0 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.list-card.collapsed .list-header {
    position: relative;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    overflow: hidden;
}

/* Gradient overlay using ::before pseudo-element */
.list-card.collapsed .list-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

/* Dynamic gradient based on item count (0-10 items) */
.list-card.collapsed[data-item-count="0"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 30%);
}

.list-card.collapsed[data-item-count="1"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 35%);
}

.list-card.collapsed[data-item-count="2"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 40%);
}

.list-card.collapsed[data-item-count="3"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 50%);
}

.list-card.collapsed[data-item-count="4"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 60%);
}

.list-card.collapsed[data-item-count="5"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 65%);
}

.list-card.collapsed[data-item-count="6"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 70%);
}

.list-card.collapsed[data-item-count="7"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 80%);
}

.list-card.collapsed[data-item-count="8"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 85%);
}

.list-card.collapsed[data-item-count="9"] .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 20%,
        var(--pico-background-color) 90%);
}

/* 10+ items: Full height gradient */
.list-card.collapsed[data-item-count="10"] .list-header::before,
.list-card.collapsed[data-item-count]:not([data-item-count="0"]):not([data-item-count="1"]):not([data-item-count="2"]):not([data-item-count="3"]):not([data-item-count="4"]):not([data-item-count="5"]):not([data-item-count="6"]):not([data-item-count="7"]):not([data-item-count="8"]):not([data-item-count="9"]) .list-header::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        var(--pico-background-color) 100%);
}

.list-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
}

.list-card.collapsed .list-header h3 {
    position: relative;
    z-index: 2;
    writing-mode: sideways-lr;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.list-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.list-header:hover .list-actions {
    opacity: 1;
}

.list-card.collapsed .list-actions {
    position: relative;
    z-index: 2;
    flex-direction: column;
    margin-top: 1rem;
}

/* Hide config gear when collapsed */
.list-card.collapsed .config-list {
    display: none;
}

.list-action-btn {
    background: none;
    border: none;
    color: var(--pico-contrast);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    font-size: 0.875rem;
    line-height: 1;
}

.list-action-btn:hover {
    opacity: 0.4;
}

/* Touch Device Overrides */
.touch-device .list-actions,
.touch-device .bookmark-actions {
    opacity: 1 !important;
    display: flex !important;
}

.touch-device .list-action-btn,
.touch-device .bookmark-action-btn {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* List Configuration Panel */
.list-config-panel {
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.list-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}

.list-config-header h4 {
    margin: 0;
    font-size: 1rem;
}

.config-close-btn {
    background: none;
    border: none;
    color: var(--pico-muted-color);
    cursor: pointer;
    font-size: 1.5rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.config-close-btn:hover {
    color: var(--pico-contrast);
}

.config-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.config-form-group input {
    padding: 0.5rem;
    font-size: 0.875rem;
}

.config-color-section {
    margin: 1rem 0;
}

.config-color-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.color-preset-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 2px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    padding: 0;
}

.color-preset-btn:hover {
    transform: scale(1.05);
    border-color: var(--pico-contrast);
}

.config-color-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.config-color-custom label {
    margin: 0;
    font-size: 0.9rem;
}

.color-picker-input {
    width: 60px;
    height: 40px;
    border: 2px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    cursor: pointer;
    padding: 2px;
}

.color-picker-input:hover {
    border-color: var(--pico-contrast);
}

.config-board-target {
    padding: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

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

.config-copy-btn,
.config-move-btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.config-copy-btn:disabled,
.config-move-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.config-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pico-muted-border-color);
}

.config-delete-btn {
    background: var(--pico-del-color);
    color: white;
    flex: 1 1 100%;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.config-delete-btn:hover {
    background: var(--pico-del-color);
    opacity: 0.8;
}

.config-cancel-btn,
.config-save-btn {
    flex: 1;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
}

.config-cancel-btn {
    background: var(--pico-secondary-background);
}

.config-save-btn {
    background: var(--pico-primary);
}

/* Bookmark Configuration Panel */
.bookmark-config-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bookmark-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.bookmark-config-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.bookmark-config-close-btn {
    background: none;
    border: none;
    color: var(--pico-muted-color);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

.bookmark-config-close-btn:hover {
    color: var(--pico-contrast);
}

.bookmark-config-panel input {
    padding: 0.5rem;
    font-size: 0.875rem;
    margin: 0;
}

.bookmark-config-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.bookmark-config-delete-btn {
    background: var(--pico-del-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    margin-right: auto;
}

.bookmark-config-cancel-btn,
.bookmark-config-save-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
}

/* Bookmarks Container */
.bookmarks-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem;
    cursor: grab;
}

.bookmarks-container:active {
    cursor: grabbing;
}

.list-card.collapsed .bookmarks-container {
    display: none;
}

/* Bookmark Item */
.bookmark-item {
    margin-bottom: 0.5rem;
    background: var(--pico-background-color);
    border-radius: var(--pico-border-radius);
    cursor: pointer;
    transition: transform 0.2s;
    text-decoration: none;
    color: var(--pico-color);
    perspective: 1000px;
    position: relative;
}

.bookmark-item:hover {
    transform: translateX(4px);
    background: var(--pico-secondary-background);
}

.bookmark-item.sortable-ghost {
    opacity: 0.4;
}

/* Bookmark Card Flip Architecture */
.bookmark-card-inner {
    position: relative;
    width: 100%;
    min-height: 1rem;
}

.bookmark-card-front,
.bookmark-card-back {
    width: 100%;
    transition: opacity 0.3s, transform 0.3s;
}

@media (prefers-reduced-motion: reduce) {
    .bookmark-card-front,
    .bookmark-card-back {
        transition: none;
    }
}

.bookmark-card-front {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    text-decoration: none;
}

.bookmark-card-front:hover {
    text-decoration: none;
}

.bookmark-card-front:hover .bookmark-title,
.bookmark-card-front:hover .bookmark-url {
    text-decoration: none;
}

.bookmark-card-back {
    display: none;
    padding: 0.75rem;
}

/* When flipped, hide front and show back */
.bookmark-item[data-flipped="true"] .bookmark-card-front {
    display: none;
}

.bookmark-item[data-flipped="true"] .bookmark-card-back {
    display: block;
}

.bookmark-favicon {
    width: 24px;
    flex-shrink: 0;
}

.bookmark-favicon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.bookmark-favicon-placeholder {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pico-secondary-background);
    border-radius: 4px;
    font-size: 1rem;
}

.bookmark-content {
    flex: 1;
    min-width: 0;
    min-height: 1.8rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.bookmark-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bookmark-url {
    font-size: 0.75rem;
    color: var(--pico-muted-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: 1.2;
}

.bookmark-actions {
    display: none;
    gap: 0.25rem;
    flex-shrink: 0;
}

.bookmark-item:hover .bookmark-actions {
    display: flex;
}

.bookmark-action-btn {
    background: none;
    border: none;
    color: var(--pico-muted-color);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
}

.bookmark-action-btn:hover {
    color: var(--pico-contrast);
}

/* Add Item Buttons Container */
.list-add-buttons {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 1rem 1rem;
}

.list-card.collapsed .list-add-buttons {
    display: none;
}

/* Add Link and Add Note Buttons */
.add-bookmark-btn,
.add-note-btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
    border: 1px dashed var(--pico-muted-border-color);
    background: transparent;
    opacity: 0.5;
    color: var(--pico-muted-color);
    transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
}

.add-bookmark-btn:hover,
.add-note-btn:hover {
    border-color: var(--pico-primary);
    background: var(--pico-primary-background);
    opacity: 1;
}

/* Add List Button - Subtle and list-height */
#add-list-container {
    flex-shrink: 0;
    padding: 0;
    display: flex;
    align-items: flex-start;
}

.add-list-button {
    width: var(--list-collapsed-width);
    height: calc(100vh - 140px);
    max-height: calc(100vh - 140px);
    border: 1px dashed var(--pico-muted-border-color);
    background: transparent;
    border-radius: var(--pico-border-radius);
    font-size: 1.2rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s, opacity 0.2s;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    color: var(--pico-muted-color);
}

.add-list-button:hover {
    border-color: var(--pico-primary);
    background: var(--pico-primary-background);
    opacity: 1;
}

/* Color classes removed - now using inline styles */

/* Sortable Dragging */
.sortable-drag {
    opacity: 0.5;
}

/* Modal Styles */
dialog article {
    max-width: 500px;
}

/* Color Picker Modal */
.color-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1rem;
}

.color-option {
    width: 60px;
    height: 60px;
    border-radius: var(--pico-border-radius);
    border: 3px solid var(--pico-muted-border-color);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: scale(1.1);
    border-color: var(--pico-contrast);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-option.selected {
    border-color: var(--pico-contrast);
    border-width: 4px;
    box-shadow: 0 0 0 2px var(--pico-background-color), 0 0 0 4px var(--pico-contrast);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --list-width: 280px;
        --list-collapsed-width: 40px;
    }

    .lists-wrapper {
        padding: 1rem;
    }

    /* Ensure inputs don't zoom on iOS */
    .config-form-group input,
    .bookmark-config-panel input {
        font-size: 16px;
    }

    /* Adjust color presets for mobile */
    .config-color-presets {
        gap: 0.4rem;
    }
}

/* Hide delete button for temporary items */
[data-is-temp="true"] .config-delete-btn,
[data-is-temp="true"] .bookmark-config-delete-btn {
    display: none;
}

/* Hide bookmark URLs when list has more than 6 bookmarks */
.bookmarks-container:has(.bookmark-item:nth-child(7)) .bookmark-url {
    display: none;
}

/* Note Item Styles */
.note-item {
    margin-bottom: 0.5rem;
    background: var(--pico-background-color);
    border-radius: var(--pico-border-radius);
    cursor: pointer;
    transition: transform 0.2s;
    color: var(--pico-color);
    position: relative;
}

.note-item:hover {
    transform: translateX(4px);
    background: var(--pico-secondary-background);
}

.note-item.sortable-ghost {
    opacity: 0.4;
}

/* Note Card Architecture */
.note-card-inner {
    position: relative;
    width: 100%;
}

.note-card-front {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    text-decoration: none;
    color: inherit;
}

.note-card-back {
    display: none;
    padding: 0.75rem;
}

/* When flipped, hide front and show back */
.note-item[data-flipped="true"] .note-card-front {
    display: none;
}

.note-item[data-flipped="true"] .note-card-back {
    display: block;
}

.note-content {
    flex: 1;
    min-width: 0;
}

.note-text {
    font-size: 0.875rem;
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Markdown element styling within notes */
.note-text h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.note-text h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0.4rem 0;
}

.note-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.3rem 0;
}

.note-text h4, .note-text h5, .note-text h6 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.2rem 0;
}

.note-text strong {
    font-weight: 600;
}

.note-text em {
    font-style: italic;
}

.note-text a {
    color: var(--primary);
    text-decoration: underline;
}

.note-text a:hover {
    opacity: 0.8;
}

.note-text p {
    margin: 0.3rem 0;
}

/* Remove default paragraph margins for cleaner display */
.note-text p:first-child {
    margin-top: 0;
}

.note-text p:last-child {
    margin-bottom: 0;
}

.note-actions {
    display: none;
    gap: 0.25rem;
    flex-shrink: 0;
}

.note-item:hover .note-actions {
    display: flex;
}

.config-note {
    background: none;
    border: none;
    color: var(--pico-muted-color);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.config-note:hover {
    opacity: 1;
}

/* Note Configuration Panel */
.note-config-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.note-config-panel textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.875rem;
    padding: 0.5rem;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: var(--pico-border-radius);
    background: var(--pico-background-color);
    color: var(--pico-color);
}

.note-config-panel textarea:focus {
    outline: none;
    border-color: var(--pico-primary);
}

/* Touch device visibility for note actions */
.touch-device .note-actions {
    display: flex;
}
