        /* App-specific layout (not part of macos9.css design system) */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            padding: 20px;
            padding-top: 30px; /* Space for fixed menu bar */
            min-height: 100vh;
        }

        /* Fixed menu bar at top */
        .menu-bar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
        }

        /* Main window container */
        .main-window {
            max-width: 850px;
            margin: 10px auto;
            min-height: calc(100vh - 70px);
        }

        /* Draggable window state */
        .main-window.dragging,
        .main-window[data-positioned="true"] {
            position: fixed;
            margin: 0;
            width: 850px;
            max-width: calc(100vw - 40px);
            height: auto;
            min-height: auto;
            max-height: calc(100vh - 50px);
        }

        .main-window.dragging {
            user-select: none;
            box-shadow:
                2px 2px 0 var(--mac9-border-outer),
                4px 4px 8px rgba(0,0,0,0.3);
        }

        /* Prevent text selection while dragging */
        .main-window.dragging * {
            user-select: none;
        }

        /* Detail view layout: fill height and pin actions to bottom */
        #view-detail .main-window {
            display: flex;
            flex-direction: column;
            height: calc(100vh - 70px);
        }

        #view-detail .main-window[data-positioned="true"] {
            height: calc(100vh - 50px);
        }

        /* List view layout: fill height and let list scroll */
        #view-list .main-window {
            display: flex;
            flex-direction: column;
            height: calc(100vh - 70px);
        }

        #view-list .main-window[data-positioned="true"] {
            height: calc(100vh - 50px);
        }

        #view-list .window-body {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

        /* Create view layout: fill height and let content area expand */
        #view-create .main-window {
            display: flex;
            flex-direction: column;
            height: calc(100vh - 70px);
        }

        #view-create .main-window[data-positioned="true"] {
            height: calc(100vh - 50px);
        }

        #view-create .window-body {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

        #view-create .create-content-group {
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }

        #view-create #createContent {
            flex: 1;
            min-height: 0 !important;
            height: 100%;
        }

        /* Menu bar right section */
        .menu-bar-right {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 12px;
            padding-right: 8px;
            font-size: 11px;
        }

        .menu-bar-time {
            font-weight: normal;
        }

        .menu-bar-app {
            font-weight: bold;
        }

        /* Toolbar in window */
        .window-toolbar {
            display: flex;
            align-items: center;
            padding: 6px 8px;
            gap: 8px;
            border-bottom: 1px solid var(--mac9-border-medium);
            background: var(--mac9-surface);
        }

        /* Search box with icon */
        .search-box {
            display: flex;
            align-items: center;
            padding: 2px 6px;
            flex: 1;
            max-width: 200px;
            margin-left: auto;
            height: 18px;
            background: #FFFFFF;
            border: 1px solid var(--mac9-border-dark);
            box-shadow:
                inset 1px 1px 0 var(--mac9-border-light),
                inset -1px -1px 0 var(--mac9-border-dark);
        }

        .search-box::before {
            content: '🔍';
            font-size: 10px;
            margin-right: 4px;
            filter: grayscale(1);
        }

        .search-box input {
            border: none;
            outline: none;
            font-size: 12px;
            width: 100%;
            background: transparent;
            height: 100%;
            padding: 0;
            box-shadow: none;
        }

        /* List header (Finder-style columns) */
        .list-header {
            display: grid;
            grid-template-columns: 1fr 140px 70px;
            background: var(--mac9-surface);
            border-bottom: 1px solid var(--mac9-border-medium);
            font-size: 12px;
            font-weight: bold;
        }

        .list-header-cell {
            padding: 3px 8px;
            border-right: 1px solid var(--mac9-border-medium);
            display: flex;
            align-items: center;
            cursor: pointer;
            box-shadow:
                inset 1px 1px 0 var(--mac9-border-light),
                inset -1px -1px 0 var(--mac9-border-dark);
        }

        .list-header-cell:last-child {
            border-right: none;
        }

        .list-header-cell.sorted::after {
            content: ' ▼';
            font-size: 8px;
        }

        /* List body */
        .list-body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            background: var(--mac9-content-bg);
        }

        #promptsGrid,
        #searchResults {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-height: 0;
        }

        #searchResultsList {
            flex: 1;
            min-height: 0;
        }

        #view-create .form-actions {
            margin-top: auto;
        }

        .list-row {
            display: grid;
            grid-template-columns: 1fr 140px 70px;
            border-bottom: 1px solid var(--mac9-surface-light);
            cursor: pointer;
            font-size: 12px;
        }

        .list-row:nth-child(odd) {
            background: var(--mac9-content-bg);
        }

        .list-row:nth-child(even) {
            background: #F8F8F8;
        }

        .list-row:hover {
            background: var(--mac9-selection);
            color: var(--mac9-selection-text);
        }

        .list-cell {
            padding: 4px 8px;
            display: flex;
            align-items: center;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .list-cell.name {
            gap: 8px;
        }

        /* Document icon */
        .doc-icon {
            width: 16px;
            height: 20px;
            background: linear-gradient(135deg, #FFFFFF 0%, #EEEEEE 100%);
            border: 1px solid #888888;
            position: relative;
            flex-shrink: 0;
        }

        .doc-icon::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 5px;
            height: 5px;
            background: linear-gradient(135deg, #DDDDDD 50%, #888888 50%);
        }

        .doc-icon::after {
            content: '';
            position: absolute;
            top: 7px;
            left: 2px;
            right: 2px;
            height: 1px;
            background: #CCCCCC;
            box-shadow: 0 3px 0 #CCCCCC, 0 6px 0 #CCCCCC;
        }

        /* List footer */
        .list-footer {
            padding: 4px 8px;
            background: var(--mac9-surface);
            border-top: 1px solid var(--mac9-border-medium);
            font-size: 11px;
            color: var(--mac9-text-disabled);
            text-align: center;
        }

        /* Empty state */
        .empty-state {
            padding: 40px;
            text-align: center;
            color: var(--mac9-text-disabled);
        }

        .empty-state p {
            margin-bottom: 12px;
        }

        /* Form layout */
        .form-group {
            margin-bottom: 12px;
        }

        .form-group label {
            display: block;
            font-weight: bold;
            margin-bottom: 4px;
        }

        .form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
            padding-top: 12px;
            border-top: 1px solid var(--mac9-border-medium);
            margin-top: 12px;
        }

        /* Detail view meta row */
        .detail-meta {
            display: flex;
            gap: 16px;
            padding: 6px 8px;
            background: var(--mac9-surface-light);
            border-bottom: 1px solid var(--mac9-border-medium);
            font-size: 10px;
            color: var(--mac9-text-disabled);
        }

        .detail-meta a {
            color: var(--mac9-selection);
        }

        /* Detail content area */
        .detail-content {
            padding: 12px;
            background: var(--mac9-content-bg);
            border: 2px solid;
            border-color: var(--mac9-border-dark) var(--mac9-border-light) var(--mac9-border-light) var(--mac9-border-dark);
            margin: 8px;
            font-family: 'Monaco', 'Courier New', monospace;
            font-size: 12px;
            line-height: 1.5;
            min-height: 0;
            flex: 1 1 auto;
            overflow-y: auto;
        }

        .detail-content.raw-mode {
            background: var(--mac9-content-bg);
            font-family: 'Monaco', 'Courier New', monospace;
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        .detail-content.raw-mode pre {
            margin: 0;
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        /* Detail actions bar */
        .detail-actions {
            display: flex;
            justify-content: space-between;
            padding: 8px;
            background: var(--mac9-surface);
            /* White highlight on top edge separates content from controls */
            border-top: 1px solid #FFFFFF;
            box-shadow: 0 -1px 0 var(--mac9-border-medium);
            margin-top: auto;
        }

        /* Modal overlay */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.25);
            z-index: 2000;
            align-items: center;
            justify-content: center;
        }

        .modal-overlay.visible {
            display: flex;
        }

        .modal {
            background: var(--mac9-surface);
            border: 1px solid var(--mac9-border-outer);
            box-shadow:
                1px 1px 0 var(--mac9-border-outer),
                3px 3px 0 rgba(0,0,0,0.2);
            padding: 20px;
            max-width: 300px;
            text-align: center;
        }

        .modal-icon {
            font-size: 48px;
            margin-bottom: 12px;
        }

        .modal h2 {
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .modal p {
            font-size: 12px;
            color: var(--mac9-text-disabled);
            margin-bottom: 8px;
            line-height: 1.4;
        }

        .modal-actions {
            margin-top: 16px;
        }

        /* Markdown content styling */
        .detail-content h1 { font-size: 13px; font-weight: bold; margin: 8px 0 4px; }
        .detail-content h2 { font-size: 12px; font-weight: bold; margin: 6px 0 4px; }
        .detail-content h3 { font-size: 11px; font-weight: bold; margin: 4px 0 2px; }
        .detail-content p { margin: 0; line-height: 1.5; }
        .detail-content p + p { margin-top: 8px; }
        .detail-content ul { margin: 4px 0 4px 16px; list-style: disc; }
        .detail-content ol { margin: 4px 0 4px 16px; list-style: decimal; }
        .detail-content li { margin: 2px 0; line-height: 1.4; }
        .detail-content code { background: #F0F0F0; padding: 1px 3px; font-size: 10px; }
        .detail-content pre { background: #F8F8F8; border: 1px solid #CCCCCC; padding: 8px; overflow-x: auto; margin: 6px 0; font-size: 10px; }
        .detail-content pre code { background: transparent; padding: 0; }
        .detail-content hr { margin: 8px 0; border: none; border-top: 1px solid #CCCCCC; }

        /* Custom XML tags in prompt content */
        .custom-tag {
            color: #888888;
        }

        /* Utilities */
        .hidden {
            display: none !important;
        }

        .view {
            display: none;
        }

        .view:not(.hidden) {
            display: block;
        }

        /* Mobile: hide date column to maximize title width */
        @media (max-width: 600px) {
            .list-header {
                grid-template-columns: 1fr 70px;
            }

            .list-row {
                grid-template-columns: 1fr 70px;
            }

            /* Hide the date column (second column) */
            .list-header-cell:nth-child(2),
            .list-row .list-cell:nth-child(2) {
                display: none;
            }
        }

