        /* Firefox */
        .scrollbar-thin {
            scrollbar-width: thin;
            scrollbar-color: #9ca3af #f3f4f6; /* thumb track */
        }
        /* WebKit (Chrome, Safari, Edge) */
        .scrollbar-thin::-webkit-scrollbar {
            width: 6px;
        }
        .scrollbar-thin::-webkit-scrollbar-track {
            background: #f3f4f6;
            border-radius: 3px;
        }
        .scrollbar-thin::-webkit-scrollbar-thumb {
            background-color: #9ca3af;
            border-radius: 3px;
        }

        /* Скрываем стандартный 'resize' у textarea */
        textarea {
            resize: none;
        }

        /* Полноэкранное мини-приложение (как в референсе) */
        #chat-window {
            height: var(--kv-height, var(--tg-viewport-stable-height, 100dvh));
            top: var(--kv-offset-top, 0px);
            bottom: auto;
            padding-left: var(--tg-safe-area-inset-left, env(safe-area-inset-left, 0px));
            padding-right: var(--tg-safe-area-inset-right, env(safe-area-inset-right, 0px));
        }

        /* Стили для превью вложений */
        .attachment-preview-container {
            width: 3.5rem;
            height: 3.5rem;
            border-radius: 0.75rem;
            border: 1px solid #d1d5db;
            background-color: #ffffff;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            overflow: hidden;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        @media (min-width: 640px) {
            .attachment-preview-container {
                width: 4rem;
                height: 4rem;
            }
        }

        .attachment-preview-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            -webkit-object-fit: cover;
            display: block;
        }

        .attachment-remove-btn {
            position: absolute;
            top: -0.5rem;
            right: -0.5rem;
            width: 1.75rem;
            height: 1.75rem;
            border-radius: 9999px;
            background-color: #1f2937;
            color: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
            border: none;
            cursor: pointer;
            transition: background-color 0.2s ease, transform 0.1s ease;
            z-index: 10;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
        }

        .attachment-remove-btn:hover {
            background-color: #374151;
        }

        .attachment-remove-btn:active,
        .attachment-remove-btn:focus {
            background-color: #374151;
            transform: scale(0.95);
            outline: none;
        }

        /* Стили для вложений в сообщениях */
        .message-attachment-link {
            display: block;
            width: 4rem;
            height: 4rem;
            border-radius: 0.75rem;
            border: 1px solid #dbeafe;
            background-color: #ffffff;
            overflow: hidden;
            box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
            position: relative;
            transition: border-color 0.2s ease;
        }

        @media (min-width: 640px) {
            .message-attachment-link {
                width: 5rem;
                height: 5rem;
            }
        }

        .message-attachment-link:hover {
            border-color: #93c5fd;
        }

        .message-attachment-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            -webkit-object-fit: cover;
            display: block;
        }

        .typing-indicator {
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .typing-indicator .typing-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background-color: #000000;
            opacity: 0.3;
            animation: typing-pulse 1.4s infinite;
        }

        .typing-indicator .typing-dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator .typing-dot:nth-child(3) {
            animation-delay: 0.4s;
        }

        .mcp-step-inline {
            display: inline;
            font-size: 11px;
            color: #6b7280;
            margin-left: 8px;
            font-style: italic;
            vertical-align: middle;
        }

        .mcp-step-inline.hidden {
            display: none;
        }

        /* Стили для правильного переноса длинных слов и ссылок */
        .break-words {
            word-wrap: break-word;
            overflow-wrap: break-word;
            word-break: break-word;
        }

        .overflow-wrap-anywhere {
            overflow-wrap: anywhere;
        }

        .word-break-break-word {
            word-break: break-word;
        }

        /* Обеспечиваем, что ссылки не выходят за пределы контейнера */
        .bg-gray-100 a,
        .bg-white a {
            word-break: break-all;
            overflow-wrap: anywhere;
            display: inline-block;
            max-width: 100%;
        }

        /* Стили для изображений в сообщениях чата (только внутри текста сообщений) */
        .chat-message-image {
            max-width: 180px !important;
            width: auto !important;
            height: auto !important;
            display: block !important;
            margin: 0.5rem 0 !important;
            clear: both !important;
        }

        @media (min-width: 640px) {
            .chat-message-image {
                max-width: 200px !important;
            }
        }

        /* Защита аватаров от влияния стилей изображений - аватары НЕ имеют класс chat-message-image */
        img.inline-block.size-9.rounded-full,
        img.size-9.rounded-full,
        img.size-10.rounded-full {
            max-width: 2.25rem !important;
            width: 2.25rem !important;
            height: 2.25rem !important;
            min-width: 2.25rem !important;
            min-height: 2.25rem !important;
            display: inline-block !important;
            margin: 0 !important;
            clear: none !important;
            flex-shrink: 0 !important;
            object-fit: cover !important;
            object-position: center !important;
        }

        /* Для аватара size-10 в баннере подсказки */
        img.size-10.rounded-full {
            width: 2.5rem !important;
            height: 2.5rem !important;
            min-width: 2.5rem !important;
            min-height: 2.5rem !important;
            max-width: 2.5rem !important;
        }

        /* Обеспечиваем, что изображения не выходят за пределы контейнера */
        .bg-gray-100 img:not(.chat-message-image),
        .bg-white img:not(.chat-message-image) {
            max-width: 100%;
            height: auto;
            display: block;
            margin: 0.5rem 0;
        }

        @keyframes typing-pulse {
            0%, 100% { opacity: 0.3; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.2); }
        }

        /* Стили для полноэкранного мини-приложения */
        html, body {
            height: 100%;
            overflow: hidden;
            -webkit-user-select: none;
            user-select: auto;
            font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        }

        /* Поддержка Safe Area — Telegram fullscreen + env() fallback */
        .safe-area-top {
            padding-top: calc(
                var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px))
                + var(--tg-content-safe-area-inset-top, 0px)
                + 1rem
            ) !important;
        }

        .safe-area-bottom {
            padding-bottom: calc(
                var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))
                + var(--tg-content-safe-area-inset-bottom, 0px)
                + 20px
            );
        }

        .scroll-down-btn {
            position: absolute;
            left: 50%;
            bottom: 12px;
            transform: translateX(-50%) scale(0);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.92);
            color: #6b7280;
            border: 1px solid rgba(0, 0, 0, 0.08);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 50;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
            -webkit-tap-highlight-color: transparent;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .scroll-down-btn.visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateX(-50%) scale(1);
        }

        .scroll-down-btn:active {
            transform: translateX(-50%) scale(0.9);
        }

        #chat-body table { border-collapse: collapse; font-size: 13px; min-width: 100%; width: max-content; }
        #chat-body th, #chat-body td { border: 1px solid #e5e7eb; padding: 6px 10px; text-align: left; word-wrap: break-word; overflow-wrap: break-word; max-width: 220px; }
        #chat-body th { background: #f3f4f6; font-weight: 600; }
        #chat-body .text-sm { line-height: 1.4; }

        .drawer-toggle-btn {
            width: 40px;
            height: 40px;
            border-radius: 9999px;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            color: #4b5563;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
        }

        .drawer-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(15, 23, 42, 0.35);
            z-index: 70;
            backdrop-filter: blur(1px);
            -webkit-backdrop-filter: blur(1px);
        }

        .app-drawer {
            position: fixed;
            top: 0;
            right: 0;
            width: min(88vw, 360px);
            height: 100dvh;
            background: #f9fafb;
            border-left: 1px solid #e5e7eb;
            z-index: 80;
            transform: translateX(100%);
            transition: transform 0.22s ease;
            display: flex;
            flex-direction: column;
            box-shadow: -8px 0 24px rgba(15, 23, 42, 0.12);
            border-top-left-radius: 20px;
            border-bottom-left-radius: 20px;
            overflow: hidden;
        }

        .app-drawer.open {
            transform: translateX(0);
        }

        .drawer-header {
            padding: 18px 16px 12px;
            padding-top: calc(18px + var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid #e5e7eb;
            background: #f9fafb;
        }

        .drawer-close-btn {
            width: 32px;
            height: 32px;
            border-radius: 9999px;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            color: #4b5563;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .drawer-section {
            padding: 14px 16px;
            background: #f9fafb;
        }

        .drawer-label {
            display: block;
            font-size: 12px;
            line-height: 16px;
            color: #6b7280;
            margin-bottom: 8px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: .04em;
        }

        .drawer-select {
            width: 100%;
            border-radius: 12px;
            border: 1px solid #d1d5db;
            background: #ffffff;
            color: #111827;
            font-size: 13px;
            line-height: 18px;
            color: #111827;
            padding: 10px 12px;
            outline: none;
        }

        .new-chat-btn {
            width: 100%;
            border-radius: 12px;
            border: 0;
            background: #2563eb;
            color: #ffffff;
            font-size: 14px;
            font-weight: 600;
            padding: 10px 12px;
        }

        .drawer-conversations-wrap {
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: hidden;
        }

        .drawer-conversations-wrap .conversation-list {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-right: 4px;
        }

        .conversation-item {
            width: 100%;
            text-align: left;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            border-radius: 14px;
            padding: 9px 62px 9px 10px;
            transition: all .15s ease;
            position: relative;
            cursor: pointer;
        }

        .conversation-item.active {
            border-color: #93c5fd;
            background: #eff6ff;
        }

        .conversation-item-title {
            font-size: 12px;
            line-height: 16px;
            font-weight: 600;
            color: #111827;
            margin-bottom: 3px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .conversation-item-subtitle {
            font-size: 11px;
            line-height: 14px;
            color: #6b7280;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .conversation-item-date {
            margin-top: 3px;
            font-size: 10px;
            line-height: 12px;
            color: #9ca3af;
        }

        .conversation-item-actions {
            position: absolute;
            right: 8px;
            top: 8px;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .conversation-rename-btn,
        .conversation-delete-btn {
            width: 22px;
            height: 22px;
            border-radius: 9999px;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            color: #9ca3af;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            cursor: pointer;
        }

        .conversation-rename-btn:hover {
            color: #2563eb;
            border-color: #93c5fd;
            background: #eff6ff;
        }

        .conversation-delete-btn:hover {
            color: #ef4444;
            border-color: #fecaca;
            background: #fef2f2;
        }

        .attachment-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            max-width: 100%;
            border-radius: 12px;
            border: 1px solid #dbeafe;
            background: #eff6ff;
            color: #1f2937;
            padding: 8px 10px;
            font-size: 12px;
        }

        .attachment-chip button {
            border: 0;
            background: transparent;
            color: #6b7280;
            cursor: pointer;
            font-size: 14px;
            line-height: 1;
        }

        .message-file-card {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            border-radius: 12px;
            border: 1px solid #dbeafe;
            background: #ffffff;
            color: #1f2937;
            padding: 8px 10px;
            text-decoration: none;
            max-width: 100%;
        }

        .message-file-card .file-name {
            max-width: 220px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            font-size: 12px;
            line-height: 16px;
        }

        .message-image-thumb {
            width: 140px;
            max-width: 100%;
            border-radius: 12px;
            border: 1px solid #dbeafe;
            display: block;
        }

        .assistant-fullwidth {
            width: 100%;
            max-width: 100%;
        }

        .msg-actions {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 2px;
        }

        .msg-action-btn {
            border: 0;
            background: transparent;
            color: #9ca3af;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 2px;
            line-height: 1;
        }

        .msg-action-btn:hover {
            color: #4b5563;
        }

        .empty-chat-hint {
            min-height: 55vh;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 0 20px;
        }

        .empty-chat-hint-title {
            font-size: 18px;
            line-height: 1.35;
            font-weight: 700;
            color: #334155;
            text-align: center;
            width: 100%;
        }

        .bot-inline-code {
            padding: 1px 6px;
            border-radius: 6px;
            background: #e5e7eb;
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
            font-size: 12px;
        }

        .bot-code {
            margin: 6px 0;
            padding: 10px 12px;
            border-radius: 10px;
            overflow-x: auto;
            background: #111827;
            color: #e5e7eb;
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
            font-size: 12px;
            line-height: 1.45;
        }

        .drawer-footer-bar {
            padding: 12px 14px 16px;
            margin-bottom: env(safe-area-inset-bottom, 0);
            border-top: 1px solid #e5e7eb;
            background: #f9fafb;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        .drawer-footer-user {
            display: flex;
            align-items: center;
            gap: 10px;
            min-width: 0;
            flex: 1;
        }

        .drawer-footer-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
            color: #ffffff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            flex-shrink: 0;
            overflow: hidden;
        }

        .drawer-footer-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .drawer-footer-info {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 1px;
        }

        .drawer-footer-nick {
            font-size: 13px;
            font-weight: 600;
            color: #111827;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .drawer-footer-id {
            font-size: 11px;
            color: #6b7280;
        }

        .drawer-footer-settings-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            color: #4b5563;
            color: #4b5563;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            flex-shrink: 0;
            cursor: pointer;
            transition: all 0.15s ease;
        }

        .drawer-footer-settings-btn:hover {
            background: #f3f4f6;
            border-color: #d1d5db;
        }

        .modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.35);
            z-index: 90;
            opacity: 1;
            transition: opacity 0.22s ease;
        }

        .modal-backdrop.hidden {
            opacity: 0;
            pointer-events: none;
            display: block;
        }

        .modal-window {
            position: fixed;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: min(92vw, 420px);
            max-height: 85vh;
            background: #ffffff;
            color: #111827;
            border-radius: 20px;
            box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
            z-index: 91;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .modal-window.modal-fullscreen {
            inset: 0;
            left: 0;
            top: 0;
            width: 100%;
            max-width: 100%;
            height: 100%;
            max-height: 100%;
            transform: none;
            border-radius: 0;
        }

        .modal-fullscreen-body {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            overflow-anchor: none;
            overscroll-behavior: contain;
            display: flex;
            flex-direction: column;
            align-items: stretch;
            justify-content: flex-start;
            min-width: 0;
        }

        .modal-section-divider {
            height: 1px;
            background: #e5e7eb;
            margin: 20px 0;
        }

        .modal-section-title {
            font-size: 14px;
            font-weight: 600;
            color: #374151;
            margin: 0 0 12px 0;
        }

        .modal-window.hidden {
            display: none;
        }

        .modal-header {
            padding: 16px 20px;
            padding-top: calc(16px + var(--tg-safe-area-inset-top, env(safe-area-inset-top, 0px)) + var(--tg-content-safe-area-inset-top, 0px));
            border-bottom: 1px solid #e5e7eb;
            background: #f9fafb;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .modal-title {
            font-size: 16px;
            font-weight: 700;
            color: #111827;
            margin: 0;
        }

        .modal-close-btn {
            width: 32px;
            height: 32px;
            border-radius: 9999px;
            border: 1px solid #e5e7eb;
            background: #ffffff;
            color: #6b7280;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .modal-close-btn:hover {
            background: #f3f4f6;
            color: #374151;
        }

        .modal-body {
            padding: 20px;
            overflow-y: auto;
            overflow-x: hidden;
            flex: 1;
            min-height: 0;
            min-width: 0;
            background: #ffffff;
        }

        .safe-zone-modal {
            padding-top: 12px;
        }

        .modal-field {
            margin-bottom: 16px;
            min-width: 0;
        }

        .modal-field label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            color: #6b7280;
            margin-bottom: 6px;
        }

        .modal-field-hint {
            display: block;
            font-size: 11px;
            color: #9ca3af;
            margin-top: 4px;
        }

        .mcp-tools-field select[multiple] {
            width: 100%;
            min-height: 80px;
            max-height: 160px;
            font-size: 13px;
            padding: 8px 12px;
        }


        .modal-field textarea,
        .modal-field input,
        .modal-field select {
            width: 100%;
            border-radius: 12px;
            border: 1px solid #d1d5db;
            padding: 10px 12px;
            font-size: 14px;
            font-family: inherit;
            background: #ffffff;
            color: #111827;
            box-sizing: border-box;
        }

        .modal-field select {
            appearance: none;
            -webkit-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            padding-right: 36px;
        }

        .modal-field textarea {
            resize: vertical;
            min-height: 70px;
        }

        .modal-field textarea.modal-prompt-textarea {
            min-height: 140px;
        }

        .modal-field select[multiple] {
            min-height: 80px;
            max-height: 160px;
            padding: 8px 12px;
            background-image: none;
            padding-right: 12px;
        }

        .modal-mcp-check-wrap {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .modal-mcp-check-btn {
            align-self: flex-start;
            padding: 10px 16px;
            font-size: 14px;
            border-radius: 12px;
            border: 1px solid #d1d5db;
            background: #f9fafb;
            color: #374151;
            cursor: pointer;
        }

        .modal-mcp-check-btn:hover:not(:disabled) {
            background: #f3f4f6;
        }

        .modal-mcp-check-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .modal-mcp-check-result {
            font-size: 13px;
            line-height: 1.4;
        }

        .modal-mcp-check-result.ok {
            color: #059669;
        }

        .modal-mcp-check-result.err {
            color: #dc2626;
        }

        .modal-mcp-check-result.hidden {
            display: none;
        }

        .modal-save-btn {
            width: 100%;
            padding: 12px;
            border-radius: 12px;
            border: 0;
            background: #2563eb;
            color: #ffffff;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 8px;
        }

        .modal-save-btn:hover {
            opacity: 0.9;
        }

        .modal-delete-btn {
            padding: 10px 16px;
            border-radius: 12px;
            border: 1px solid #fecaca;
            background: #fef2f2;
            color: #dc2626;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
        }

        .modal-delete-btn:hover {
            background: #fee2e2;
        }

        .reminders-modal-body {
            max-height: 60vh;
        }

        .reminders-calendar-hint {
            font-size: 12px;
            color: #475569;
            margin-bottom: 14px;
            padding: 10px 12px;
            background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
            border: 1px solid #dbeafe;
            border-radius: 12px;
        }

        .reminders-empty-hint {
            font-size: 14px;
            color: #9ca3af;
            text-align: center;
            padding: 24px 16px;
        }

        .reminders-list {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .reminder-card {
            border: 1px solid #dbeafe;
            border-radius: 16px;
            padding: 12px 12px 11px;
            padding-right: 104px;
            background:
                radial-gradient(120% 120% at 100% 0%, #eef4ff 0%, transparent 55%),
                linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
            transition: all 0.18s ease;
            box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
            position: relative;
        }

        .reminder-card:hover {
            border-color: #93c5fd;
            background:
                radial-gradient(120% 120% at 100% 0%, #e7f0ff 0%, transparent 58%),
                linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
            box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
            transform: translateY(-1px);
        }

        .reminder-card.sent {
            opacity: 0.7;
            background: #f9fafb;
        }

        .reminder-card-text {
            font-size: 13px;
            line-height: 1.4;
            color: #0f172a;
            margin-bottom: 8px;
            word-break: break-word;
            max-height: 4.2em;
            overflow: hidden;
            text-overflow: ellipsis;
            position: relative;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            line-clamp: 3;
            -webkit-box-orient: vertical;
            padding-right: 4px;
        }

        .reminder-card-top {
            display: block;
        }

        .reminder-card-meta {
            font-size: 11px;
            color: #64748b;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 8px;
        }

        .reminder-card-actions {
            display: flex;
            gap: 8px;
            flex-shrink: 0;
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 2;
        }

        .reminder-fab-btn {
            width: 40px;
            height: 40px;
            border-radius: 9999px;
            border: 1px solid #bfdbfe;
            background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
            color: #2563eb;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            transition: all 0.15s ease;
            box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
        }

        .reminder-fab-btn:hover {
            background: #eff6ff;
            border-color: #93c5fd;
            color: #1d4ed8;
            transform: translateY(-1px);
        }

        .reminder-fab-btn.danger {
            color: #dc2626;
            border-color: #fecaca;
            box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
        }

        .reminder-fab-btn.danger:hover {
            border-color: #fca5a5;
            background: #fef2f2;
            color: #b91c1c;
        }

        .reminder-time-chip,
        .reminder-id-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            border-radius: 9999px;
            padding: 5px 10px;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            color: #334155;
            max-width: 100%;
            font-size: 11px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .reminder-id-chip {
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        }

        .reminder-edit-actions {
            display: flex;
            gap: 10px;
            margin-top: 16px;
        }

        .reminder-edit-actions .modal-save-btn {
            flex: 1;
            margin-top: 0;
        }

        #reminder-edit-modal .modal-header {
            background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
        }

        #reminder-edit-modal #reminder-edit-datetime {
            min-height: 46px;
            font-variant-numeric: tabular-nums;
            letter-spacing: 0.2px;
            background: #ffffff;
        }
