body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    background-color: #f3f4f6;
}

.shiner-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: shiner-spin 0.6s linear infinite;
}
.shiner-spinner-lg {
    width: 3rem;
    height: 3rem;
    border-width: 3px;
}
@keyframes shiner-spin {
    to { transform: rotate(360deg); }
}

/* Chat panel loader: sidebar remains visible */
.shiner-app-loader {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}
.shiner-app-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.shiner-app-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-right-color: #3b82f6;
    border-radius: 50%;
    animation: shiner-spin 0.7s linear infinite;
}
.shiner-app-loader-text {
    margin: 0;
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}
.shiner-loader-enter,
.shiner-loader-leave {
    transition: opacity 0.35s ease;
}
.shiner-loader-enter-start,
.shiner-loader-leave-end {
    opacity: 0;
}
.shiner-loader-enter-end,
.shiner-loader-leave-start {
    opacity: 1;
}

/* Homepage hero: big gradient title + subtitle */
/* Empty chat / welcome2: center hero vertically in the scroll area */
.shiner-welcome-hero-wrap {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

/* Landing (hero + cards + trust): vertical stack, no overlap */
.shiner-landing-wrap {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 1.5rem 0 2rem;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    box-sizing: border-box;
}
.shiner-landing-wrap .shiner-hero {
    flex-shrink: 0;
    margin-bottom: 0.5rem;
}
.shiner-landing-wrap .container {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}
.shiner-landing-wrap .row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}
.shiner-landing-wrap .row > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 0.75rem;
}
.shiner-landing-wrap .shiner-card {
    margin-bottom: 0;
}
.shiner-landing-wrap .shiner-trust-control {
    flex-shrink: 0;
}
.shiner-hero {
    text-align: center;
    padding: 0.5rem 0 1rem;
}
.shiner-hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 40%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Image-accurate: horizontal gradient blue-violet → pink */
.shiner-hero-title-gradient {
    background: linear-gradient(to right, #6366f1, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.shiner-hero-subtitle {
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    color: #6b7280;
    margin: 0;
    font-weight: 500;
}
.shiner-hero-subtitle-plain {
    color: inherit;
}
/* Image-accurate: dark charcoal subtitle */
.shiner-hero-subtitle-dark {
    color: #111827;
    font-weight: 500;
}
body[data-theme="dark"] .shiner-hero-subtitle-dark {
    color: #e5e7eb;
}
.shiner-hero-subtitle-accent {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}
body[data-theme="dark"] .shiner-hero-subtitle {
    color: #9ca3af;
}
body[data-theme="dark"] .shiner-hero-subtitle-plain {
    color: #9ca3af;
}

/* Welcome pages: light background like image */
.welcome-page {
    background-color: #f4f6f8;
    min-height: 100vh;
}
body[data-theme="dark"] .welcome-page {
    background-color: #111827;
}
/* Gradient title and dark subtitle used on welcome + chat-welcome */
.welcome-page .shiner-hero-title-gradient {
    background: linear-gradient(to right, #6366f1, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.welcome-page .shiner-hero-subtitle-dark {
    color: #111827;
}
body[data-theme="dark"] .welcome-page .shiner-hero-subtitle-dark {
    color: #e5e7eb;
}

/* Full welcome page: hero + content layout */
.welcome-page-full .shiner-hero-wrap {
    padding: 3rem 1rem 2rem;
    text-align: center;
}
.welcome-page-full .shiner-hero {
    padding: 0;
}

/* Chat-welcome page: hero vertically centered */
.welcome-page-chat {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.welcome-page-chat .shiner-chat-welcome-center {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.welcome-page-chat .shiner-hero {
    text-align: center;
    padding: 0;
}

.shiner-page-loader,
.shiner-page-error {
    z-index: 9999;
}

.shiner-layout {
    height: 100vh;
    overflow: hidden;
}
.shiner-layout > .container-fluid {
    height: 100%;
    min-height: 0;
}
.shiner-layout .row.h-100 {
    min-height: 0;
    height: 100%;
}

.shiner-sidebar {
    width: 280px;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: visible;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 55%, #eef2f7 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06);
}
.shiner-sidebar .sidebar-section-title {
    letter-spacing: 0.08em;
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.5rem;
}
.shiner-sidebar .sidebar-chat-row,
.shiner-sidebar .sidebar-folder-row {
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.shiner-sidebar .sidebar-chat-row:hover,
.shiner-sidebar .sidebar-folder-row:hover {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.65);
}
.shiner-sidebar .sidebar-load-more,
.shiner-sidebar .btn-link.sidebar-load-more {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb !important;
}
.shiner-sidebar .input-group .form-control,
.shiner-sidebar .input-group-text {
    border-radius: 10px;
    border-color: #e2e8f0;
}
.shiner-sidebar .input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.shiner-sidebar .input-group-text {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.shiner-sidebar-footer-panel {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.98) 100%);
    backdrop-filter: blur(8px);
}
.shiner-sidebar-footer-avatar {
    width: 32px;
    height: 32px;
    object-fit: cover;
    flex-shrink: 0;
}
.shiner-sidebar-footer-sub {
    font-size: 10px;
    line-height: 1.2;
}
.shiner-sidebar-footer-settings {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.85);
    color: #475569;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.shiner-sidebar-footer-settings:hover {
    background: #fff;
    border-color: #94a3b8;
    color: #0f172a;
}
.shiner-sidebar-footer-settings-icon {
    width: 20px;
    height: 20px;
}
.sidebar-content {
    min-height: 0;
    flex: 1 1 0;
    overflow-x: hidden;
    overflow-y: auto;
}
.shiner-sidebar .sidebar-footer {
    flex-shrink: 0;
}

.shiner-main {
    background: #f3f4f6;
    min-height: 0;
    flex: 1 1 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shiner-card {
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

/* Trust & Control section (reused on API page + homepage) */
.shiner-trust-control {
    padding: 1.25rem 1rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}
/* Landing: light blue box, 6 points in grid */
.shiner-trust-control-landing {
    max-width: 720px;
    background: #f0f7ff;
    border: 1px solid #e0eef9;
    padding: 1.5rem 1.25rem;
}
.shiner-trust-control-landing .shiner-trust-control-heading {
    color: #0f172a;
}
.shiner-trust-control-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem 1.5rem;
}
/* Deprecated: moved to public/css/mobile.css (max-width: 640px).
   Keeping this empty media query to avoid double-applying. */
@media (max-width: 0px) {
    .shiner-trust-control-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.shiner-trust-control-heading {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
}
.shiner-trust-control-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem 1.25rem;
}
.shiner-trust-control-item {
    font-size: 0.875rem;
    color: #475569;
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.4;
}
.shiner-trust-control-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.4em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
}
.shiner-trust-control-landing .shiner-trust-control-item {
    color: #4b5563;
    font-size: 0.875rem;
}
.shiner-settings-modal .shiner-trust-control-list {
    grid-template-columns: 1fr;
}
.shiner-settings-modal .shiner-trust-control-heading {
    font-size: 1.1rem;
}

.shiner-input,
.shiner-select {
    border-radius: 12px;
    border: 1px solid #d1d5db;
    padding: 8px 12px;
    background-color: #ffffff;
}

.shiner-input:focus,
.shiner-select:focus,
.shiner-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.shiner-textarea {
    border-radius: 18px;
    border: 1px solid #e5e7eb;
    padding: 12px 16px;
    background-color: #ffffff;
    box-shadow: none;
    resize: none;
    overflow-y: auto;
    max-height: 13rem; /* ~8 lines */
}

.shiner-btn {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    padding: 6px 12px;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.shiner-btn:hover {
    background-color: #f3f4f6;
}

.shiner-btn-primary {
    border-color: #2563eb;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    padding-inline: 18px;
    border-radius: 999px;
}

/* Chat container: messages always visible, bottom bar for input/search */
.shiner-chat-container {
    overflow: hidden;
}
.shiner-messages-container {
    overflow: hidden;
}
.shiner-bottom-bar {
    flex-shrink: 0;
}

/* API key missing: compact warning above input */
.shiner-api-key-warning-wrap {
    margin-bottom: 8px;
}
.shiner-api-key-warning-box {
    padding: 6px 10px;
    border-radius: 10px;
    background: #fffbe9;
    border: 1px solid #facc15;
    width: 600px;
    margin: auto;

}
.shiner-api-key-warning-text {
    font-size: 0.8rem;
    color: #92400e;
    font-weight: 500;
    margin: 0;
}

/* Chat input blocked when no API key */
.shiner-chat-input-blocked .shiner-chat-input-field,
.shiner-chat-input-blocked .shiner-chat-input-send,
.shiner-chat-input-blocked .shiner-chat-input-plus,
.shiner-chat-input-blocked .shiner-chat-input-voice {
    opacity: 0.6;
}
.shiner-chat-input-blocked .shiner-chat-input-field:disabled {
    cursor: not-allowed;
}

.shiner-input-shell {
    max-width: 840px;
    width: 100%;
}

/* Modern ChatGPT-style chat input */
.shiner-chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    min-height: 52px;
}
.shiner-chat-input:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.shiner-chat-input-plus {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.shiner-chat-input-plus:hover {
    background: #f3f4f6;
    color: #111827;
}
.shiner-chat-input-plus:active {
    transform: scale(0.97);
}
.shiner-chat-input-field-wrap {
    position: relative;
}
.shiner-chat-input-field {
    flex: 1;
    width: 100%;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
    resize: none;
    min-height: 24px;
    max-height: 12rem;
    padding: 8px 0;
    line-height: 1.4;
}
.shiner-chat-input-field::placeholder {
    color: #9ca3af;
}
.shiner-chat-input-send {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.6);
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.shiner-chat-input-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}
.shiner-chat-input-send:active:not(:disabled) {
    transform: scale(0.97);
}
.shiner-chat-input-send:disabled,
.shiner-send-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.shiner-attach-popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 6px;
    min-width: 160px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    animation: shiner-fadeSlide 0.2s ease;
}
.shiner-attach-popover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 10px;
    margin: 0 4px;
}
.shiner-attach-popover-item:hover {
    background: #f3f4f6;
}
.shiner-error-popover-wrap {
    margin-bottom: 8px;
}
.shiner-error-popover {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #b91c1c;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    max-width: 100%;
}
.shiner-error-popover-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: #dc2626;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    opacity: 0.95;
}
.shiner-error-popover-close:hover {
    opacity: 1;
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}
.shiner-error-popover-close svg {
    stroke: currentColor;
}

.shiner-upload-preview {
    width: 100%;
}
.shiner-upload-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.shiner-upload-preview-inner {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}
.shiner-upload-thumbnail {
    width: 110px;
    height: 110px;
    max-width: 100%;
    border-radius: 10px;
    object-fit: cover;
}
.shiner-upload-file {
    gap: 8px;
}
.shiner-upload-file-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    min-width: 80px;
}
.shiner-upload-file-cell .shiner-upload-file-name {
    font-size: 0.75rem;
    max-width: 100px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}
.shiner-upload-file-icon {
    flex-shrink: 0;
    color: #4b5563;
}
.shiner-upload-file-name {
    font-size: 0.85rem;
    color: #111827;
    word-break: break-all;
}
.shiner-upload-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.shiner-upload-remove:hover {
    background: rgba(15, 23, 42, 1);
}
.shiner-chat-input-voice {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 10px;
    border: none !important;
    box-shadow: none !important;
    background: transparent;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}
.shiner-chat-input-voice:hover {
    background: #f3f4f6;
    color: #111827;
}
.shiner-voice-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    min-height: 52px;
    width: 100%;
}
.shiner-voice-waveform {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 32px;
}
.shiner-voice-bar {
    width: 4px;
    min-height: 8px;
    height: 20px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 2px;
    animation: shiner-voice-wave 0.8s ease-in-out infinite;
    align-self: flex-end;
    transition: height 0.05s ease;
}
.shiner-voice-bar-live {
    animation: none;
    height: 20px;
}
.shiner-voice-bar:nth-child(1) { animation-delay: 0s; }
.shiner-voice-bar:nth-child(2) { animation-delay: 0.1s; }
.shiner-voice-bar:nth-child(3) { animation-delay: 0.2s; }
.shiner-voice-bar:nth-child(4) { animation-delay: 0.3s; }
.shiner-voice-bar:nth-child(5) { animation-delay: 0.4s; }
.shiner-voice-bar:nth-child(6) { animation-delay: 0.2s; }
.shiner-voice-bar:nth-child(7) { animation-delay: 0.1s; }
@keyframes shiner-voice-wave {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}
.shiner-voice-waveform {
    align-items: flex-end;
}
.shiner-voice-player {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 280px;
}
.shiner-voice-player-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shiner-voice-player-btn:hover {
    background: #f3f4f6;
}
.shiner-voice-player-progress-wrap {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}
.shiner-voice-player-progress {
    height: 100%;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 3px;
    transition: width 0.1s linear;
}
.shiner-voice-player-time {
    font-size: 0.75rem;
    color: #6b7280;
    flex-shrink: 0;
}
.shiner-voice-paused,
.shiner-voice-ready {
    font-size: 0.875rem;
    color: #6b7280;
}
.shiner-voice-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.shiner-voice-btn {
    font-size: 0.875rem;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.shiner-voice-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.shiner-voice-send {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    border-color: transparent;
}
.shiner-voice-send:hover {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    color: #fff;
}
.shiner-voice-remove {
    color: #dc2626;
}
.shiner-voice-remove:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}
.shiner-tools-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}
.shiner-tool-item {
    flex-shrink: 0;
}
.shiner-tool-icon {
    flex-shrink: 0;
    color: inherit;
}
.shiner-tool-model .shiner-model-select {
    min-width: 172px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 8px 32px 8px 12px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.shiner-tool-model .shiner-model-select:hover {
    border-color: #d1d5db;
}
.shiner-tool-model .shiner-model-select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.shiner-tool-btn {
    padding: 6px 12px;
    font-size: 0.8125rem;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
}
.shiner-tool-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}
.shiner-search-icon-wrap {
    color: #9ca3af;
}
.shiner-tool-search .shiner-search-in-chat {
    width: 140px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    padding: 6px 10px;
}
.shiner-tool-search .shiner-search-in-chat:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.shiner-tool-search .shiner-search-in-chat::placeholder {
    color: #9ca3af;
}
.shiner-download-popover {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 4px;
    min-width: 100px;
    padding: 4px 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    z-index: 1060;
}
.shiner-download-popover-item {
    display: block;
    width: 100%;
    padding: 6px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 0.8125rem;
    color: #374151;
    cursor: pointer;
}
.shiner-download-popover-item:hover {
    background: #f3f4f6;
}
.shiner-search-count {
    white-space: nowrap;
    font-size: 0.75rem;
}
.shiner-search-nav {
    white-space: nowrap;
}
.shiner-search-index {
    font-size: 0.75rem;
    min-width: 2rem;
}
.shiner-search-clear {
    color: #6b7280;
}
.shiner-search-clear:hover {
    color: #111827;
}
@media (max-width: 576px) {
    .shiner-input-row {
        flex-wrap: wrap;
    }
    .shiner-input-cell.flex-grow-1 {
        order: 1;
        width: 100%;
    }
    .shiner-tools-row {
        gap: 8px;
    }
    .shiner-tool-model .shiner-model-select {
        min-width: 120px;
    }
    .shiner-tool-search .shiner-search-in-chat {
        width: 120px;
    }
}

.shiner-icon-btn {
    border-radius: 999px;
    border: none;
    background: transparent;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #4b5563;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.shiner-icon-btn:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.shiner-api-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid transparent;
    background: #e5e7eb;
    color: #374151;
}

.shiner-api-status-badge.validating {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.shiner-api-status-badge.success {
    background: #dcfce7;
    border-color: #bbf7d0;
    color: #166534;
}

.shiner-api-status-badge.error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.shiner-btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.shiner-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.shiner-icon:hover {
    opacity: 1;
}

@media (max-width: 1024px) {
    .shiner-icon {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 640px) {
    .shiner-icon {
        width: 20px;
        height: 20px;
    }
}

.shiner-chat-main {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.shiner-chat-main > .shiner-chat-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    width: 100%;
}

.shiner-chat-scroll {
    width: 100%;
    box-sizing: border-box;
    scroll-padding-top: 12px;
    scroll-behavior: auto;
}

.shiner-chat-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    display: flex;
    flex-direction: column;
}

.shiner-chat-inner-bottom {
    min-height: 100%;
    justify-content: flex-end;
}

/* Chat welcome: new/empty chat — center hero in viewport */
.shiner-chat-welcome-wrap {
    min-height: 60vh;
}

.shiner-messages-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.shiner-chat-message {
    margin-bottom: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.shiner-chat-message-anim {
    animation: none;
}

@keyframes shiner-fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shiner-chat-message.user {
    justify-content: flex-end;
}

.shiner-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}
.shiner-avatar .shiner-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.shiner-avatar-ai-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.shiner-avatar-ai-svg svg {
    flex-shrink: 0;
    color: inherit;
}
.shiner-chat-message.user .shiner-chat-bubble { order: 0; }
.shiner-chat-message.user .shiner-avatar.user { order: 1; }
.shiner-chat-message.ai .shiner-avatar.ai { order: 0; }
.shiner-chat-message.ai .shiner-chat-bubble { order: 1; }
.shiner-chat-message .shiner-avatar {
    margin-top: 2px; /* align with first line of bubble */
}
.shiner-chat-message.user .shiner-chat-bubble {
    max-width: min(500px, 75%);
    min-width: 0;
}
.shiner-chat-message.ai .shiner-chat-bubble {
    max-width: min(780px, 90%);
}
.shiner-chat-bubble-body {
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    overflow: hidden;
}
.shiner-chat-bubble-content {
    flex: 0 1 auto;
    min-width: 0;
}
.shiner-chat-message.user .shiner-chat-bubble-body {
    white-space: normal;
}
.shiner-chat-bubble.ai .shiner-ai-message-content {
    flex: 0 1 auto;
    min-height: 0;
}
/* User bubble text: plain (≤5 effective lines) = tight, no markdown <p> gap */
.shiner-chat-message.user .shiner-chat-user-content-plain {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    margin: 0;
    padding: 4px 10px 5px;
    line-height: 1.35;
    display: inline-block;
    vertical-align: top;
    box-sizing: border-box;
    white-space: pre-wrap;
}
/* Long user messages: markdown + optional collapse */
.shiner-chat-message.user .shiner-chat-user-content-md {
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
    margin: 0;
    padding: 6px 10px;
    line-height: 1.4;
    display: inline-block;
    vertical-align: top;
    box-sizing: border-box;
}
.shiner-chat-message.user .shiner-chat-user-content-md > *:first-child {
    margin-top: 0;
}
.shiner-chat-message.user .shiner-chat-user-content-md > *:last-child {
    margin-bottom: 0;
}
.shiner-chat-expand-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 2px;
    line-height: 1;
    min-height: 0;
    border: none;
    vertical-align: middle;
}
.shiner-chat-expand-icon {
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.shiner-chat-expand-icon.shiner-chat-expand-icon--up {
    transform: rotate(180deg);
}

.shiner-chat-bubble {
    padding: 10px 14px;
    margin: 4px 0;
    max-width: 80%;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.shiner-chat-bubble.ai {
    line-height: 1.6;
}
.shiner-chat-bubble.ai .shiner-chat-bubble-content {
    margin-bottom: 0;
}
.shiner-chat-bubble.ai .shiner-ai-message-content p,
.shiner-chat-bubble.ai .shiner-ai-message-content .shiner-md-li + .shiner-md-li {
    margin-top: 0.35em;
    margin-bottom: 0.35em;
}
.shiner-chat-bubble.ai .shiner-ai-message-content > div:first-child {
    margin-top: 0;
}

.shiner-chat-bubble.user {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    border-radius: 16px 5px 16px 16px;
    padding: 0;
    margin-top: 2px;
}
.shiner-chat-bubble.user.shiner-chat-bubble-no-attachments .shiner-chat-meta-row-user {
    margin-top: 2px;
}

.shiner-chat-message.user .shiner-chat-bubble-body {
    padding: 0; padding: 10px 14px;
}
.shiner-chat-message.user .shiner-chat-bubble-content {
    padding: 0;
}
.shiner-chat-message.user .shiner-chat-bubble-content .shiner-msg-attachments {
    margin-bottom: 6px;
    padding: 8px 12px 0;
    box-sizing: border-box;
}
.shiner-chat-message.user .shiner-chat-user-content-md p {
    margin: 0;
}
.shiner-chat-message.user .shiner-chat-user-content-md * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/* Tighten user bubble: markdown renderer adds a trailing <br> per line — drop the last one to avoid extra gap */
.shiner-chat-message.user .shiner-chat-user-content-md br:last-child {
    display: none;
}
.shiner-chat-message.user .shiner-chat-user-content-md br:only-child,
.shiner-chat-message.user .shiner-chat-user-content-md p:empty {
    display: none;
}

/* Collapsed long user message: 4-line preview; full text via Show more */
.shiner-chat-message.user .shiner-chat-user-content-md.shiner-chat-user-content-collapsed {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    transition: opacity 0.2s ease;
}

/* Expand animation when full message is shown */
.shiner-chat-message.user .shiner-chat-user-content-md.shiner-chat-user-content-expanded {
    animation: shiner-user-msg-expand 0.42s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes shiner-user-msg-expand {
    from {
        opacity: 0.88;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bubble hint when long message is clamped */
.shiner-chat-bubble.user.shiner-chat-long-collapsed {
    align-self: flex-start;
}
.shiner-msg-attachments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0.5rem;
}
.shiner-msg-attachments:last-child {
    margin-bottom: 0;
}
.shiner-msg-attachment {
    margin-bottom: 4px;
}
.shiner-voice-msg-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    max-width: 260px;
}
.shiner-voice-msg-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shiner-voice-msg-btn:hover {
    opacity: 0.9;
}
.shiner-voice-msg-progress-wrap {
    flex: 1;
    height: 5px;
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}
.shiner-voice-msg-progress {
    height: 100%;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border-radius: 3px;
    transition: width 0.1s linear;
}
.shiner-voice-msg-time {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.9);
    flex-shrink: 0;
}
.shiner-chat-bubble.user .shiner-voice-msg-time {
    color: rgba(255,255,255,0.9);
}
.shiner-chat-bubble.ai .shiner-voice-msg-player {
    background: #f3f4f6;
}
.shiner-chat-bubble.ai .shiner-voice-msg-time {
    color: #6b7280;
}
.shiner-msg-attachment-img {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    max-width: 100%;
}
.shiner-msg-thumb {
    max-height: 110px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}
.shiner-msg-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.06);
    border-radius: 10px;
    font-size: 0.85rem;
}
.shiner-msg-attachment-filename {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    word-break: break-all;
}

.shiner-chat-meta-row {
    margin-top: 0.5rem;
    padding-top: 0;
    padding-bottom: 0;
}
.shiner-chat-meta-row.shiner-chat-meta-row-inner {
    gap: 6px;
    row-gap: 4px;
}
.shiner-chat-bubble.user .shiner-chat-meta-row {
    margin-top: 2px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 4px;
    padding-top: 2px;
    box-sizing: border-box;
}
.shiner-chat-meta-row-user {
    margin-top: 2px;
    margin-bottom: 0;
}
.shiner-chat-bubble.user .shiner-msg-meta-actions {
    gap: 6px;
    align-items: center;
    line-height: 1;
    min-height: 0;
}
.shiner-chat-bubble.user .shiner-msg-action-wrap {
    line-height: 0;
    display: inline-flex;
    align-items: center;
}
.shiner-chat-bubble.user .shiner-msg-actions-dots {
    padding: 2px 4px;
    line-height: 0;
    min-height: 0;
    border-radius: 6px;
}
.shiner-chat-bubble.user .shiner-copy-btn,
.shiner-chat-bubble.user .shiner-chat-expand-btn,
.shiner-chat-bubble.user .shiner-msg-actions-dots {
    color: rgba(255, 255, 255, 0.9);
}
.shiner-chat-bubble.user .shiner-copy-btn {
    padding: 2px 4px;
    line-height: 1.1;
    min-height: 0;
}

.shiner-chat-bubble.user .shiner-copy-btn:hover,
.shiner-chat-bubble.user .shiner-chat-expand-btn:hover,
.shiner-chat-bubble.user .shiner-msg-actions-dots:hover {
    color: #fff;
}
.shiner-chat-bubble.user .shiner-chat-expand-btn.btn-link {
    text-decoration: none;
}

.shiner-msg-actions-dots {
    opacity: 0.75;
}
.shiner-chat-bubble:hover .shiner-msg-actions-dots {
    opacity: 1;
}
.shiner-msg-action-wrap {
    display: inline-flex;
    position: relative;
}
.shiner-msg-action-popover {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 6px;
    min-width: 140px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    overflow: hidden;
}
.shiner-msg-action-popover.shiner-msg-action-popover--fixed {
    position: fixed;
    bottom: auto;
    right: auto;
    margin-bottom: 0;
}
.shiner-folder-create-dialog {
    width: min(92vw, 420px);
    max-width: 100%;
}
.shiner-folder-create-card {
    border-radius: 16px;
    width: 100%;
}
.shiner-message-focus-active {
    opacity: 1;
}
.shiner-message-focus-dim {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}
.shiner-chat-bubble.user .shiner-msg-action-popover {
    background: #fff;
    color: #111827;
}
.shiner-msg-action-menu .shiner-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    border-radius: 0;
}
.shiner-msg-action-menu .shiner-menu-item:hover {
    background: #f3f4f6;
}
/* Message edit modal (opened from bubble ⋯ → Edit) */
.shiner-msg-edit-modal-backdrop {
    z-index: 10050;
}
.shiner-msg-edit-modal-dialog {
    width: min(80vw, 720px);
    max-width: 80vw;
    max-height: 80vh;
    min-width: 350px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}
.shiner-msg-edit-modal-content {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.shiner-msg-edit-modal-content .shiner-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.shiner-msg-edit-textarea {
    width: 100%;
    min-height: 220px;
    resize: vertical;
    flex: 1 1 auto;
}
@media (max-width: 767.98px) {
    .shiner-msg-edit-modal-dialog {
        width: 90vw;
        min-width: unset;
        min-height: unset;
        max-height: 85vh;
    }
}
.shiner-msg-action-remove .shiner-msg-action-check {
    color: #16a34a;
    display: inline-flex;
}

.shiner-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.1s ease;
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: inherit;
    border-radius: 6px;
}
.shiner-copy-btn:hover {
    opacity: 1;
}
.shiner-copy-btn:active {
    transform: scale(0.97);
}
.shiner-copy-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.shiner-copy-btn-done {
    opacity: 1;
    color: #16a34a;
}
.shiner-chat-bubble.user .shiner-copy-btn-done {
    color: #86efac;
}

.shiner-chat-bubble.ai {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 5px 16px 16px 16px;
}

/* Thinking indicator: last item in messages, always above input */
.shiner-thinking-indicator {
    margin-top: 6px;
    align-self: flex-start;
}
.shiner-chat-bubble-streaming .shiner-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}
.shiner-typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(145deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
    animation: shiner-typing-wave 1.25s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite both;
    will-change: transform, opacity;
}
.shiner-typing-dots span:nth-child(1) { animation-delay: 0ms; }
.shiner-typing-dots span:nth-child(2) { animation-delay: 160ms; }
.shiner-typing-dots span:nth-child(3) { animation-delay: 320ms; }
@keyframes shiner-typing-wave {
    0%, 100% { transform: translateY(0) scale(0.72); opacity: 0.45; }
    35% { transform: translateY(-5px) scale(1.05); opacity: 1; }
    70% { transform: translateY(0) scale(0.88); opacity: 0.75; }
}
.shiner-thinking-plain {
    padding: 4px 0;
    letter-spacing: 0.02em;
}
.shiner-search-highlight-dim {
    background: rgba(234, 179, 8, 0.14);
    border-radius: 2px;
    padding: 0 1px;
    border-bottom: none;
}
.shiner-search-highlight-current {
    background: rgba(234, 179, 8, 0.28);
    border-radius: 2px;
    padding: 0 1px;
    border-bottom: 2px solid #ca8a04;
}
.shiner-chat-bubble-streaming {
    border-color: #93c5fd;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.shiner-chat-expand-btn,
.shiner-chat-copy-btn {
    font-size: 0.75rem;
    text-decoration: none;
    color: #6b7280;
}

.shiner-chat-expand-btn:hover,
.shiner-chat-copy-btn:hover {
    color: #111827;
}

.shiner-chat-bubble-error {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
    color: #92400e;
}

.shiner-scroll-to-bottom {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    z-index: 10;
}
.shiner-scroll-to-bottom:hover {
    background: #f9fafb;
    color: #111827;
}

/* Navbar: model left, search + list right */
.shiner-navbar-list-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    color: #6b7280;
}
.shiner-navbar-list-btn:hover {
    background: #f9fafb;
    color: #111827;
}
.shiner-navbar-search {
    max-width: 220px;
}

/* Message list: floating popover (anchored top-right, not fixed sidebar) */
.shiner-message-list-popup {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 300px;
    max-width: calc(100vw - 2rem);
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.18);
    z-index: 1050;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.shiner-message-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.shiner-message-list-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    font-size: 0.8125rem;
    color: #dc2626 !important;
    border-color: rgba(220, 38, 38, 0.35) !important;
}
.shiner-message-list-close:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c !important;
    border-color: rgba(220, 38, 38, 0.5) !important;
}
.shiner-message-list-close svg {
    stroke: currentColor;
}
.shiner-message-list-items {
    padding: 0.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}
.shiner-message-list-item {
    display: block;
    padding: 0.5rem 0.25rem;
    margin-bottom: 2px;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 0.8125rem;
    line-height: 1.3;
}
.shiner-message-list-item:hover {
    background: #f3f4f6;
}

.shiner-ai-message-content > div + .shiner-code-block,
.shiner-ai-message-content > .shiner-code-block + div {
    margin-top: 0.75rem;
}

.shiner-ai-message-content .shiner-md-h1 { font-size: 1.35rem; font-weight: 700; margin: 0.75rem 0 0.35rem; line-height: 1.3; }
.shiner-ai-message-content .shiner-md-h2 { font-size: 1.15rem; font-weight: 600; margin: 0.6rem 0 0.3rem; line-height: 1.35; }
.shiner-ai-message-content .shiner-md-h3 { font-size: 1rem; font-weight: 600; margin: 0.5rem 0 0.25rem; line-height: 1.4; }
.shiner-ai-message-content .shiner-md-ul { margin: 0.5rem 0; padding-left: 1.5rem; list-style: disc; }
.shiner-ai-message-content .shiner-md-ol { margin: 0.5rem 0; padding-left: 1.5rem; list-style: decimal; }
.shiner-ai-message-content .shiner-md-li { margin: 0.25rem 0; }
.shiner-ai-message-content .shiner-md-table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.9rem; }
.shiner-ai-message-content .shiner-md-table th, .shiner-ai-message-content .shiner-md-table td { border: 1px solid #e5e7eb; padding: 8px 12px; text-align: left; }
.shiner-ai-message-content .shiner-md-table th { background: #f3f4f6; font-weight: 600; }
.shiner-inline-code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
}
.shiner-chat-bubble.user .shiner-inline-code {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.shiner-md-link {
    color: #2563eb;
    text-decoration: none;
}
.shiner-md-link:hover {
    text-decoration: underline;
}
.shiner-chat-bubble.user .shiner-md-link {
    color: rgba(255,255,255,0.95);
    text-decoration: underline;
}

.shiner-code-block {
    background: #1e293b;
    border-radius: 10px;
    overflow: hidden;
    margin: 0.5rem 0;
    border: 1px solid #334155;
}
.shiner-code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: #334155;
    font-size: 0.7rem;
    color: #94a3b8;
}
.shiner-code-lang {
    text-transform: uppercase;
    font-weight: 600;
}
.shiner-code-copy-btn {
    padding: 2px 8px;
    font-size: 0.7rem;
    background: transparent;
    border: 1px solid #64748b;
    color: #94a3b8;
    border-radius: 4px;
}
.shiner-code-copy-btn:hover {
    background: #475569;
    color: #e2e8f0;
}
.shiner-code-pre {
    margin: 0;
    padding: 12px 14px;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #e2e8f0;
}
.shiner-code-pre code {
    background: none;
    padding: 0;
    font-family: ui-monospace, monospace;
}

.shiner-gradient {
    background: linear-gradient(135deg, #2563eb, #22c1c3);
}

.shiner-shadow-soft {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.shiner-scroll {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
    margin-left: -10px;
    margin-right: -12px;
}

.shiner-scroll::-webkit-scrollbar {
    width: 6px;
}

.shiner-scroll::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 999px;
}

.sidebar-folder-row {
    position: relative;
    transition: background-color 0.15s ease;
}

.sidebar-folder-row:hover {
    background-color: #e5e7eb;
}

.sidebar-folder-actions,
.sidebar-chat-actions {
    opacity: 1;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
    display: block;
    color: #6b7280;
}

.sidebar-folder-row:hover .sidebar-folder-actions,
.sidebar-chat-row:hover .sidebar-chat-actions {
    color: #111827;
}

.sidebar-chat-row {
    position: relative;
    transition: background-color 0.15s ease;
}

.sidebar-chat-row:hover {
    background-color: #e5e7eb;
}

/* Modern thin scrollbar for chat textarea */
.shiner-textarea::-webkit-scrollbar {
    width: 6px;
}

.shiner-textarea::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 999px;
}

.shiner-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.shiner-icon-btn {
    border-radius: 999px;
    border: none;
    background: transparent;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #4b5563;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}

.shiner-icon-btn:hover {
    background-color: #e5e7eb;
    color: #111827;
}

.shiner-icon-btn-lg {
    border-radius: 999px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}

.shiner-icon-btn-lg:hover {
    background-color: #eff6ff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

/* Alpine x-cloak: hide until ready */
[x-cloak] {
    display: none !important;
}

/* Guest settings modal */
.shiner-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.shiner-settings-modal-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
    max-width: 56rem;
    width: 100%;
    height: 85vh;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}
.shiner-settings-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 0;
}

/* Modal inner layout (no Tailwind) */
.shiner-settings-modal-box > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3rem;
    padding: 0 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}
.shiner-settings-modal-box > div:nth-child(2) {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.shiner-settings-modal-box aside {
    width: 16rem;
    border-right: 1px solid #e5e7eb;
    padding: 0.75rem;
    overflow-y: auto;
}
.shiner-settings-modal-box section {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Guest settings modal: header and close button */
.shiner-settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3rem;
    padding: 0 1rem;
    border-bottom: 1px solid #e5e7eb;
}
.shiner-settings-modal-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.shiner-settings-modal-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}
.shiner-settings-modal-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}
.shiner-settings-close {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #dc2626;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.shiner-settings-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}
.shiner-settings-close svg {
    stroke: currentColor;
}

/* Guest settings: compact typography and sections */
.shiner-settings-modal aside nav button,
.shiner-settings-modal .shiner-settings-section h2,
.shiner-settings-modal .shiner-settings-section h3 {
    font-size: 0.8125rem;
    font-weight: 600;
}
.shiner-settings-nav-heading {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin: 0 0 6px 0;
    padding: 0 4px;
}
.shiner-settings-modal aside nav button span {
    font-size: 1rem;
}
.shiner-settings-modal aside nav button {
    padding: 0.4rem 0.6rem;
    margin-bottom: 2px;
    border: none;
    background: transparent;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s;
}
.shiner-settings-modal .shiner-settings-nav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
}
.shiner-settings-modal aside nav button:hover,
.shiner-settings-modal aside nav button.active-section {
    background: #f3f4f6;
    color: #111827;
}
.shiner-settings-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
}
.shiner-settings-nav-dot.active {
    background: #2563eb;
}
.shiner-settings-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}
.shiner-settings-section-desc {
    font-size: 0.7rem;
    color: #6b7280;
    margin: 0 0 1rem 0;
}
.shiner-profile-pic-wrap {
    position: relative;
    flex-shrink: 0;
}
.shiner-profile-pic-wrap .shiner-profile-pic {
    display: block;
}
.shiner-profile-pic-upload {
    cursor: pointer;
}

.shiner-settings-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}
.shiner-settings-card-body { padding: 0; }
.shiner-settings-card-text {
    font-size: 0.75rem;
    color: #4b5563;
    margin: 0 0 0.75rem 0;
}
.shiner-settings-card-danger {
    border-color: #fecaca;
    background: #fef2f2;
}
.shiner-settings-modal .btn-sm { font-size: 0.75rem; }
.shiner-settings-modal .form-label,
.shiner-settings-modal label { font-size: 0.75rem; }
.shiner-settings-modal .form-control,
.shiner-settings-modal select { font-size: 0.8125rem; }

/* Settings modal: medium text for all section content (API providers, etc.) */
.shiner-settings-modal-box section h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}
.shiner-settings-modal-box section h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.35rem 0;
}
.shiner-settings-modal-box section p,
.shiner-settings-modal-box section .opacity-70 {
    font-size: 0.75rem;
    color: #6b7280;
}
.shiner-settings-modal-box section .card,
.shiner-settings-modal-box section [class*="card"] {
    font-size: 0.8125rem;
}
.shiner-settings-modal-box section .card h3,
.shiner-settings-modal-box section .card label {
    font-size: 0.8125rem;
}
.shiner-settings-modal-box section .card p,
.shiner-settings-modal-box section .card [class*="text-"] {
    font-size: 0.75rem;
}
.shiner-settings-modal-provider-card .provider-label { font-size: 0.8125rem; font-weight: 600; }
.shiner-settings-modal-provider-card .provider-subtitle { font-size: 0.7rem; color: #6b7280; }
.shiner-settings-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-top: 1px solid #e5e7eb !important;
    background: #fafafa;
    font-size: 0.7rem;
    color: #6b7280;
}
.shiner-settings-modal-footer .btn { font-size: 1rem; }

/* Sidebar: action icon always visible, click opens options popup */
.sidebar-action-btn {
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}
.sidebar-action-btn:hover {
    color: #111827;
}

/* Sidebar section titles */
.sidebar-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin: 0 0 10px 0;
    padding: 0 6px 0 0;
}
.sidebar-chats-label {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Sidebar folder row – elegant hover and active */
.sidebar-folder-row {
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-folder-row:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.sidebar-chat-row {
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.sidebar-chat-row:hover {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.sidebar-chats-under-folder {
    border-left-color: #e5e7eb !important;
    border-left-width: 2px;
}

/* Sidebar: subtle divider between folder list and root chats */
.sidebar-folders-section {
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

/* Sidebar: animated "Load more" */
.sidebar-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background-color 0.15s ease, transform 0.15s ease;
}
.sidebar-load-more:hover {
    background: rgba(37, 99, 235, 0.08);
    transform: translateY(-1px);
}
.sidebar-load-more::after {
    content: "→";
    transition: transform 0.15s ease;
}
.sidebar-load-more:hover::after {
    transform: translateX(2px);
}

/* Sidebar: action icon (three-dot) visible only on row hover */
.sidebar-folder-name-btn,
.sidebar-chat-name-btn {
    min-width: 0;
    overflow: hidden;
}
.sidebar-folder-name-btn .small,
.sidebar-chat-name-btn .small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-folder-name-btn .small {
    flex: 1;
    min-width: 0;
}
.sidebar-chat-name-btn .small {
    flex: 1;
    min-width: 0;
}

.sidebar-folder-row .sidebar-action-btn,
.sidebar-chat-row .sidebar-action-btn {
    opacity: 0;
    transition: opacity 0.15s ease;
}
.sidebar-folder-row:hover .sidebar-action-btn,
.sidebar-chat-row:hover .sidebar-action-btn {
    opacity: 1;
}

/* Folder: count and 3-dots share same slot at far right; hover replaces count with 3-dots */
.sidebar-folder-actions-wrap {
    justify-content: flex-end;
    gap: 2px;
}
.sidebar-folder-count-slot {
    position: relative;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.sidebar-folder-count-slot .sidebar-folder-count {
    transition: opacity 0.15s ease;
}
.sidebar-folder-row:hover .sidebar-folder-count-slot .sidebar-folder-count {
    opacity: 0;
    pointer-events: none;
}
.sidebar-folder-count-slot .sidebar-folder-dots-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.15s ease;
    min-width: 28px;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
}
.sidebar-folder-row:hover .sidebar-folder-count-slot .sidebar-folder-dots-btn,
.sidebar-folder-count-slot .sidebar-folder-dots-btn[style*="opacity:1"] {
    opacity: 1;
}
.sidebar-folder-count-slot .sidebar-folder-dots-btn:hover {
    color: #111827;
}

/* Sidebar dropdown (folder/chat actions) - kept next to row, high z-index so not clipped */
.sidebar-folder-item-wrap,
.sidebar-chat-row {
    overflow: visible;
}
.sidebar-folder-item-wrap .position-relative,
.sidebar-chat-row .position-relative {
    overflow: visible;
}
.shiner-sidebar-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 180px;
    padding: 4px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    animation: shiner-fadeSlide 0.2s ease;
    transform-origin: top;
}
.shiner-sidebar-dropdown.shiner-sidebar-dropdown--above {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 4px;
    transform-origin: bottom;
}
.shiner-sidebar-dropdown .dropdown-item,
.shiner-sidebar-dropdown .shiner-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    font-size: 0.875rem;
    text-align: left;
    border: none;
    background: transparent;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
}
.shiner-sidebar-dropdown .dropdown-item:hover,
.shiner-sidebar-dropdown .shiner-menu-item:hover {
    background: #f3f4f6;
}
.shiner-sidebar-dropdown .dropdown-item.text-danger,
.shiner-sidebar-dropdown .shiner-menu-item.delete {
    color: #ef4444;
}
.shiner-sidebar-dropdown .dropdown-item.text-danger:hover,
.shiner-sidebar-dropdown .shiner-menu-item.delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}
.shiner-sidebar-dropdown .shiner-menu-item-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.shiner-sidebar-dropdown-close {
    color: #dc2626 !important;
}
.shiner-sidebar-dropdown-close:hover {
    color: #b91c1c !important;
}

/* Move popover inside chat action dropdown */
.shiner-sidebar-dropdown-chat {
    min-width: 180px;
    max-width: 240px;
}
.shiner-move-popover {
    list-style: none;
    padding: 0 4px 4px;
    margin: 0;
    white-space: nowrap;
}
.shiner-move-popover-list {
    max-height: 200px;
    overflow-y: auto;
}
.shiner-move-remove-from-folder {
    color: #dc2626 !important;
}
.shiner-move-remove-from-folder:hover {
    background: #fef2f2 !important;
    color: #b91c1c !important;
}

/* Tippy action menu (folder/chat rows) */
.shiner-tippy-menu {
    padding: 4px 0;
    min-width: 120px;
    font-size: 0.8125rem;
}
.shiner-tippy-menu button {
    display: block;
    width: 100%;
    padding: 6px 12px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: #374151;
    transition: background 0.1s;
}
.shiner-tippy-menu button:hover {
    background: #f3f4f6;
}
.shiner-tippy-menu button.text-danger {
    color: #dc2626;
}
.shiner-tippy-menu button.text-danger:hover {
    background: #fef2f2;
}
.tippy-box[data-theme="shiner-menu"] {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    padding: 0;
}
.tippy-box[data-theme="shiner-menu"] .tippy-content {
    padding: 0;
}

.shiner-sidebar-logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}

.shiner-chat-active-dot-wrap {
    width: 12px;
    min-width: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}
.shiner-chat-active-dot {
    width: 8px;
    height: 8px;
    background: #dc2626;
    flex-shrink: 0;
}

.sidebar-icon-folder {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #6b7280;
}
.sidebar-icon-chat {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.sidebar-folder-row span.small {
    font-size: 14px;
    font-weight: 500;
}
.btn.disabled, .btn:disabled{
    background: #e0e0e0;
    color:white
}
.shiner-current-model-label-above {
    line-height: 1.2;
}
.shiner-current-model-label-above .small {
    font-size: 0.75rem;
}

.shiner-chat-input-footer {
    padding-top: 0;
    flex-shrink: 0;
    position: relative;
}

/* Removed blur/shadow overlay for a cleaner minimal feel */
.shiner-chat-input-footer::before {
    display: none;
}
img.rounded-circle{
    width: 40px !important;
    height: 40px !important;
}

/* ---- Floating action sidebar ---- */
.shiner-floating-sidebar {
    position: fixed;
    left: 280px; /* right of main .shiner-sidebar */
    top: 50%;
    transform: translateY(-50%);
    z-index: 1040;
    padding-left: 8px;
}
.shiner-floating-sidebar-inner {
    width: 48px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    transition: width 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.shiner-floating-sidebar-expanded {
    width: 180px;
    padding-left: 12px;
    padding-right: 12px;
    align-items: stretch;
}
.shiner-floating-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    min-height: 44px;
    width: 100%;
    justify-content: flex-start;
}
.shiner-floating-btn:hover {
    background: #f3f4f6;
    color: #111827;
}
.shiner-floating-btn-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shiner-floating-btn-icon svg {
    width: 20px;
    height: 20px;
}
.shiner-floating-btn-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-width 0.3s ease;
}
.shiner-floating-sidebar-expanded .shiner-floating-btn-label {
    opacity: 1;
    max-width: 120px;
}
.shiner-floating-btn-wrap {
    position: relative;
}
/* Download modal (centered, like model modal) */
.shiner-download-modal-backdrop {
    z-index: 1095;
}
.shiner-download-modal-dialog {
    max-width: 360px;
}
.shiner-download-modal-content {
    border-radius: 16px;
    overflow: hidden;
}
.shiner-download-modal-body {
    padding: 8px 20px 20px;
}
.shiner-download-modal-subtitle {
    margin-bottom: 12px;
}
.shiner-download-modal-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.shiner-download-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}
.shiner-download-modal-item:hover {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
.shiner-download-modal-item .shiner-menu-item-icon {
    color: #6b7280;
}
.shiner-download-modal-item:hover .shiner-menu-item-icon {
    color: #2563eb;
}

/* Search input bar (replaces chat input when isSearchMode) */
.shiner-search-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    min-height: 52px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.shiner-search-input:focus-within {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.shiner-search-input-icon {
    color: #9ca3af;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shiner-search-input-field {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 15px;
    background: transparent;
}
.shiner-search-input-field::placeholder {
    color: #9ca3af;
}
.shiner-search-input-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: #6b7280;
    white-space: nowrap;
}
.shiner-search-nav-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}
.shiner-search-nav-btn:hover {
    background: #f3f4f6;
    color: #111827;
}
.shiner-search-no-results {
    white-space: nowrap;
}
@media (max-width: 768px) {
    .shiner-input-shell {
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }
    .shiner-chat-input,
    .shiner-search-input {
        padding: 8px 12px;
        min-height: 48px;
    }
}
.shiner-search-close-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #dc2626;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}
.shiner-search-close-btn:hover {
    background: #fef2f2;
    color: #b91c1c;
}

/* Popover/menu animation */
@keyframes shiner-fadeSlide {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- Model switch modal ---- */
.shiner-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.shiner-modal-dialog {
    width: 100%;
    max-width: 420px;
}
.shiner-modal-content {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}
.shiner-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}
.shiner-modal-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}
button.shiner-modal-close.btn-link {
    color: #dc2626 !important;
}
button.shiner-modal-close.btn-link:hover {
    color: #b91c1c !important;
}
.shiner-modal-close {
    padding: 6px;
    border: none;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}
.shiner-modal-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}
.shiner-modal-close svg {
    stroke: currentColor;
}
body[data-theme="dark"] .shiner-modal-close {
    color: #f87171;
}
body[data-theme="dark"] .shiner-modal-close:hover {
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}
.shiner-modal-body {
    padding: 20px;
}
.shiner-modal-message {
    margin-bottom: 12px;
}
.shiner-modal-select {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 10px 36px 10px 12px;
    font-size: 0.9375rem;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-color: #fff;
}
.shiner-action-modal-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9375rem;
}

.shiner-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}
.shiner-btn-secondary {
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    padding: 8px 16px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.shiner-btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Model info popup */
.shiner-model-category-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: capitalize;
    background: #f3f4f6;
    color: #6b7280;
}
.shiner-model-cat-premium { background: #dbeafe; color: #1d4ed8; }
.shiner-model-cat-balanced { background: #fef3c7; color: #b45309; }
.shiner-model-cat-economy { background: #d1fae5; color: #047857; }

.shiner-model-info-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 2px;
}
.shiner-model-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.shiner-model-info-table th,
.shiner-model-info-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
.shiner-model-info-table th {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
}
.shiner-cap-yes {
    color: #059669;
    font-weight: 500;
}
.shiner-cap-no {
    color: #dc2626;
    font-weight: 500;
}

/* Capability-disabled buttons (attach, voice) */
.shiner-btn-disabled-capability {
    opacity: 0.5;
    cursor: not-allowed;
}
.shiner-btn-disabled-capability:hover {
    opacity: 0.5;
}
.shiner-attach-popover-item-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Guest settings: API key input validation state */
.shiner-api-key-input.shiner-api-key-valid {
    border-color: #059669;
    box-shadow: 0 0 0 1px #059669;
}
.shiner-api-key-input.shiner-api-key-invalid {
    border-color: #dc2626;
    box-shadow: 0 0 0 1px #dc2626;
}
.shiner-api-key-status {
    font-size: 0.8125rem;
}

/* Modal enter/leave (fade + scale) */
.shiner-modal-enter,
.shiner-modal-leave {
    transition: opacity 0.25s ease;
}
.shiner-modal-enter .shiner-modal-dialog,
.shiner-modal-leave .shiner-modal-dialog {
    transition: transform 0.25s ease;
}
.shiner-modal-enter-start,
.shiner-modal-leave-end {
    opacity: 0;
}
.shiner-modal-enter-start .shiner-modal-dialog,
.shiner-modal-leave-end .shiner-modal-dialog {
    transform: scale(0.95);
}
.shiner-modal-enter-end,
.shiner-modal-leave-start {
    opacity: 1;
}
.shiner-modal-enter-end .shiner-modal-dialog,
.shiner-modal-leave-start .shiner-modal-dialog {
    transform: scale(1);
}

/* Model selection modal (provider + models) */
.shiner-model-modal-dialog {
    position: relative;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.shiner-model-field-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}
.shiner-model-provider-select-wrap {
    position: relative;
}
.shiner-model-provider-select {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 0.65rem 0.9rem;
    font-weight: 500;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
.shiner-model-provider-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.shiner-model-picker-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: min(48vh, 420px);
    overflow-y: auto;
    padding-right: 4px;
}
.shiner-model-modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.shiner-modal-subtitle {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 2px;
}
.shiner-model-modal-body {
    overflow-y: auto;
    padding: 16px 20px;
    flex: 1 1 auto;
    min-height: 0;
}
.shiner-current-model {
    border: 2px solid #22c55e;
    background: #ecfdf5;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
}
.shiner-current-model-line1 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #15803d;
    line-height: 1.35;
    margin-bottom: 6px;
}
.shiner-current-model-line2 {
    font-weight: 600;
    color: #111827;
    font-size: 1rem;
    line-height: 1.35;
    word-break: break-word;
}
.shiner-model-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.shiner-model-group-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 8px;
}
.shiner-model-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.shiner-model-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    background: #fff;
    font-size: 0.9375rem;
    color: #374151;
}
.shiner-model-item:hover {
    background: #f3f4f6;
}
.shiner-model-item.selected {
    border: 2px solid #fb923c;
    background: #fff7ed;
}
.shiner-model-item-label {
    font-weight: 500;
}
.shiner-model-item-check {
    color: #ea580c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.shiner-model-confirm-popover {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    border: 1px solid #e5e7eb;
    z-index: 10;
}
.shiner-model-switch-content {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}
.shiner-model-switch-old {
    color: #22c55e;
}
.shiner-model-switch-arrow {
    font-weight: 700;
    font-size: 18px;
    color: #374151;
}
.shiner-model-switch-new {
    color: #3b82f6;
}
.shiner-model-confirm-message {
    font-size: 0.9375rem;
    color: #374151;
    text-align: center;
    max-width: 320px;
}
.shiner-model-confirm-message.validation-text,
.validation-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    color: #111827;
}
@media (max-width: 576px) {
    .shiner-model-modal-dialog {
        max-width: 100%;
        max-height: 85vh;
    }
    .shiner-model-modal-content {
        max-height: 85vh;
    }
}

/* Search Mode label */
.shiner-search-mode-wrap {
    display: flex;
    flex-direction: column;
}
.shiner-search-label,
.search-label {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    margin-bottom: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    color: #374151;
    width: fit-content;
}

/* ---- Folder View (ChatGPT-like) ---- */
.shiner-folder-enter,
.shiner-folder-leave {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.shiner-folder-enter-start,
.shiner-folder-leave-end {
    opacity: 0;
    transform: translateX(-8px);
}
.shiner-folder-enter-end,
.shiner-folder-leave-start {
    opacity: 1;
    transform: translateX(0);
}

.shiner-folder-window {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
.shiner-folder-window-header {
    padding-bottom: 0.5rem;
}
.shiner-folder-back-btn {
    color: #6b7280;
    flex-shrink: 0;
}
.shiner-folder-back-btn:hover {
    color: #111827;
    background: #f3f4f6;
}
/* Back button when viewing a folder-parented chat: sticky at top, circle border, right-aligned */
.shiner-chat-back-bar {
    position: absolute;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    display: flex;
    
    padding: 12px 0 12px 0;
    margin-bottom: 8px;
    background: linear-gradient(to bottom, var(--shiner-bg, #f3f4f6) 60%, transparent);
}
.shiner-chat-back-btn-sticky {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    color: #374151;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.shiner-chat-back-btn-sticky:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #111827;
}
.shiner-chat-back-btn-sticky {
    margin-left: 25px;
}
body[data-theme="dark"] .shiner-chat-back-btn-sticky {
    background: #1e293b;
    border-color: rgba(248,250,252,0.12);
    color: #e5e7eb;
}
body[data-theme="dark"] .shiner-chat-back-btn-sticky:hover {
    background: #334155;
}
.shiner-folder-window-title {
    color: var(--bs-body-color, #111827);
}
.shiner-folder-window-subtitle {
    font-size: 0.875rem;
}

.shiner-folder-chat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 720px;
}
.shiner-folder-chat-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    text-align: left;
}
.shiner-folder-chat-row:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.shiner-folder-chat-row-line1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 28px;
    width: 100%;
}
.shiner-folder-chat-heading {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}
.shiner-folder-chat-row-line1 .shiner-folder-chat-title {
    flex: 1;
    min-width: 0;
    min-height: 1.25em;
    font-size: 14px;
    font-weight: 500;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shiner-folder-chat-input,
.shiner-folder-chat-rename-input {
    flex: 1;
    min-width: 0;
    padding: 4px 10px;
    border: 1px solid #2563eb;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.shiner-folder-chat-input:focus,
.shiner-folder-chat-rename-input:focus {
    border-color: #2563eb;
    outline: none;
}
.shiner-folder-chat-actions {
    flex-shrink: 0;
}
.shiner-folder-chat-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #6b7280;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.shiner-folder-chat-dots:hover {
    color: #111827;
    background: #f3f4f6;
}
.shiner-folder-window-dropdown {
    top: 100%;
    right: 0;
    margin-top: 6px;
    z-index: 9999;
}
.shiner-folder-window-dropdown.shiner-sidebar-dropdown--above {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 6px;
}
.shiner-folder-chat-row-line2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.8125rem;
}
.shiner-folder-chat-row-line2 .shiner-folder-chat-preview {
    flex: 1;
    min-width: 0;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shiner-folder-chat-row-line2 .shiner-folder-chat-date {
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 0.75rem;
}
.shiner-folder-chat-title {
    display: block;
}
.shiner-folder-chat-preview {
    display: block;
}
.shiner-folder-chat-date {
    display: block;
}

.shiner-folder-empty {
    padding: 2rem 1rem;
    color: #6b7280;
}
.shiner-folder-load-more {
    padding-top: 0.5rem;
}

/* Sidebar: active folder (folder view open or active chat is in this folder) */
.sidebar-folder-row-active {
    color: #2563eb;
}
.sidebar-folder-row-active .sidebar-icon-folder {
    color: inherit;
}
.sidebar-folder-row-active .sidebar-folder-name-btn {
    color: inherit;
}


.d-flex.align-items-center.justify-content-between.px-2.py-1.rounded-3.mb-1.sidebar-chat-row.bg-white.shiner-shadow-soft {
    background: #ffdde2 !important;
}

/* ===== Mobile: ChatGPT-like layout ===== */
:root {
    --shiner-mobile-topbar-height: 56px;
    --shiner-mobile-bottombar-height: 96px; /* approximate shiner-chat-input-footer height */
}

@media (max-width: 768px) {
    /* Hide desktop right floating actions */
    .shiner-floating-sidebar {
        display: none !important;
    }

    /* Mobile header + scroll spacing */
    .shiner-mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        height: var(--shiner-mobile-topbar-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 14px;
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(229, 231, 235, 0.95);
    }

    body[data-theme="dark"] .shiner-mobile-topbar {
        background: rgba(15, 23, 42, 0.85);
        border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    }

    .shiner-mobile-hamburger {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        border: none;
        background: rgba(255, 255, 255, 0.2);
        color: #111827;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background-color 0.15s ease;
    }
    .shiner-mobile-hamburger:hover {
        background: rgba(229, 231, 235, 0.65);
    }

    body[data-theme="dark"] .shiner-mobile-hamburger {
        color: #e5e7eb;
        background: rgba(255, 255, 255, 0.06);
    }
    body[data-theme="dark"] .shiner-mobile-hamburger:hover {
        background: rgba(148, 163, 184, 0.18);
    }

    .shiner-mobile-topbar-title {
        flex: 1;
        min-width: 0;
        text-align: center;
        font-weight: 600;
        font-size: 14px;
        color: inherit;
    }

    /* Sticky/fixed bottom chat input */
    .shiner-bottom-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1030;
        background: rgba(243, 244, 246, 0.72);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 0;
    }
    body[data-theme="dark"] .shiner-bottom-bar {
        background: rgba(15, 23, 42, 0.7);
    }

    /* Main chat scroll offsets for fixed top/bottom bars */
    .shiner-chat-scroll {
        padding-top: var(--shiner-mobile-topbar-height);
        scroll-padding-top: calc(var(--shiner-mobile-topbar-height) + 18px);
        padding-bottom: calc(var(--shiner-mobile-bottombar-height) + 16px);
    }

    /* Hide the scroll-to-bottom control behind the fixed input */
    .shiner-scroll-to-bottom {
        bottom: calc(var(--shiner-mobile-bottombar-height) + 12px) !important;
    }

    /* Optional: keep folder back-bar visible under the mobile header */
    .shiner-chat-back-bar {
        top: var(--shiner-mobile-topbar-height);
    }

    /* Mobile left sidebar slide-over */
    .shiner-mobile-sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(15, 23, 42, 0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.shiner-sidebar-open .shiner-mobile-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .shiner-mobile-sidebar-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1045;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow: hidden;
    }
    body.shiner-sidebar-open .shiner-mobile-sidebar-wrapper {
        transform: translateX(0);
    }
    .shiner-mobile-sidebar-wrapper .shiner-sidebar {
        height: 100%;
        overflow-y: auto;
    }

    /* Mobile profile menu */
    .shiner-mobile-profile-menu {
        position: relative;
        flex-shrink: 0;
    }
    .shiner-mobile-profile-button {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        border: none;
        background: rgba(255, 255, 255, 0.2);
        cursor: pointer;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.15s ease;
    }
    .shiner-mobile-profile-button:hover {
        background: rgba(229, 231, 235, 0.65);
    }
    body[data-theme="dark"] .shiner-mobile-profile-button {
        background: rgba(255, 255, 255, 0.06);
        color: #e5e7eb;
    }
    body[data-theme="dark"] .shiner-mobile-profile-button:hover {
        background: rgba(148, 163, 184, 0.18);
    }
    .shiner-mobile-profile-avatar {
        width: 36px;
        height: 36px;
        border-radius: 999px;
        object-fit: cover;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 13px;
    }

    .shiner-mobile-profile-dropdown {
        position: absolute;
        right: 0;
        top: 48px;
        width: 210px;
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
        padding: 6px;
        z-index: 1120;
    }
    body[data-theme="dark"] .shiner-mobile-profile-dropdown {
        background: #0f172a;
        border-color: rgba(148, 163, 184, 0.25);
    }
    .shiner-mobile-profile-item {
        width: 100%;
        border: 0;
        background: transparent;
        padding: 12px 10px;
        border-radius: 12px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }
    .shiner-mobile-profile-item:hover {
        background: #f3f4f6;
    }
    body[data-theme="dark"] .shiner-mobile-profile-item:hover {
        background: rgba(148, 163, 184, 0.14);
    }
    .shiner-mobile-profile-item-danger .shiner-mobile-profile-item-text,
    .shiner-mobile-profile-item-danger {
        color: #dc2626;
    }

    .shiner-mobile-profile-divider {
        height: 1px;
        background: rgba(229, 231, 235, 0.95);
        margin: 6px 0;
    }

    /* Floating circular button */
    .shiner-mobile-right-fab {
        position: fixed;
        right: 16px;
        bottom: calc(var(--shiner-mobile-bottombar-height) + 10px);
        z-index: 1060;
        width: 56px;
        height: 56px;
        border-radius: 999px;
        border: 0;
        background: linear-gradient(135deg, #2563eb, #4f46e5);
        color: #fff;
        box-shadow: 0 14px 32px rgba(37, 99, 235, 0.35);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: transform 0.12s ease, filter 0.12s ease;
    }
    .shiner-mobile-right-fab:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }
    .shiner-mobile-right-fab:active {
        transform: translateY(0px) scale(0.98);
    }

    /* Right sliding panel */
    .shiner-mobile-right-panel-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1048;
        background: rgba(15, 23, 42, 0.12);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .shiner-mobile-right-panel-backdrop-open {
        opacity: 1;
        pointer-events: auto;
    }

    .shiner-mobile-right-panel {
        position: fixed;
        top: var(--shiner-mobile-topbar-height);
        right: 0;
        bottom: var(--shiner-mobile-bottombar-height);
        z-index: 1049;
        width: 320px;
        max-width: 92vw;
        background: #ffffff;
        border-left: 1px solid #e5e7eb;
        border-radius: 18px 0 0 18px;
        box-shadow: -10px 0 40px rgba(15, 23, 42, 0.18);
        transform: translateX(100%);
        transition: transform 0.25s ease;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        pointer-events: none;
        opacity: 0;
    }
    .shiner-mobile-right-panel-open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .shiner-mobile-right-panel-header {
        padding: 12px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(229, 231, 235, 0.9);
        background: rgba(255, 255, 255, 0.92);
    }
    body[data-theme="dark"] .shiner-mobile-right-panel-header {
        background: rgba(15, 23, 42, 0.85);
        border-bottom: 1px solid rgba(148, 163, 184, 0.25);
    }
    .shiner-mobile-right-panel-title {
        font-weight: 700;
        font-size: 14px;
    }
    .shiner-mobile-right-panel-close {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        border: 1px solid rgba(229, 231, 235, 0.95);
        background: rgba(255, 255, 255, 0.75);
        color: #374151;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    body[data-theme="dark"] .shiner-mobile-right-panel-close {
        border-color: rgba(148, 163, 184, 0.25);
        background: rgba(255, 255, 255, 0.06);
        color: #e5e7eb;
    }

    .shiner-mobile-right-panel-body {
        flex: 1;
        overflow-y: auto;
        padding: 12px 12px 16px;
    }

    .shiner-mobile-right-panel-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .shiner-mobile-right-panel-action {
        width: 100%;
        border: 1px solid rgba(229, 231, 235, 0.95);
        background: #fff;
        padding: 12px 12px;
        border-radius: 14px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        cursor: pointer;
        color: #111827;
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }
    .shiner-mobile-right-panel-action:hover {
        background: #f3f4f6;
        border-color: #d1d5db;
    }
    body[data-theme="dark"] .shiner-mobile-right-panel-action {
        background: rgba(15, 23, 42, 0.4);
        border-color: rgba(148, 163, 184, 0.25);
        color: #e5e7eb;
    }
    body[data-theme="dark"] .shiner-mobile-right-panel-action:hover {
        background: rgba(148, 163, 184, 0.14);
    }

    .shiner-mobile-right-panel-divider {
        height: 1px;
        width: 100%;
        background: rgba(229, 231, 235, 0.95);
        margin: 2px 0 6px;
    }

    .shiner-mobile-right-panel-search-input {
        width: 100%;
    }

    .shiner-mobile-right-panel-search-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 10px;
        margin-bottom: 8px;
        gap: 10px;
    }

    .shiner-mobile-right-panel-results {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .shiner-mobile-right-panel-result {
        width: 100%;
        border: 1px solid rgba(229, 231, 235, 0.95);
        background: #fff;
        border-radius: 14px;
        padding: 10px 12px;
        cursor: pointer;
        text-align: left;
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }
    .shiner-mobile-right-panel-result:hover {
        background: #f3f4f6;
        border-color: #d1d5db;
    }
    body[data-theme="dark"] .shiner-mobile-right-panel-result {
        background: rgba(15, 23, 42, 0.4);
        border-color: rgba(148, 163, 184, 0.25);
        color: #e5e7eb;
    }
    body[data-theme="dark"] .shiner-mobile-right-panel-result:hover {
        background: rgba(148, 163, 184, 0.14);
    }
    .shiner-mobile-right-panel-result-snippet mark.shiner-search-highlight-current {
        border-bottom-width: 2px;
    }
}

