html {
    min-height: 100%;
    height: auto;
}
html:has(body.chat-body-with-nav) {
    height: 100%;
}
body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f3f4f6;
    padding-top: var(--navbar-height, 5rem);
    padding-bottom: var(--chat-composer-pad, 200px);
    box-sizing: border-box;
}
body.chat-body-with-nav {
    overflow: hidden;
    height: 100vh;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}
.chat-body-with-nav {
    --chat-sidebar-width: 260px;
    display: block;
    min-height: 0;
    box-sizing: border-box;
    background-color: #f3f4f6;
    background-image: linear-gradient(
        90deg,
        #e8edf5 0,
        #e8edf5 var(--chat-sidebar-width),
        #f3f4f6 var(--chat-sidebar-width)
    );
}
@media (max-width: 768px) {
    .chat-body-with-nav {
        background-image: none;
    }
}
#navbar-full {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    width: 100%;
    max-width: 100%;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
}
#navbar-full:has(#user-info:not(.hidden)) #login-btn {
    display: none !important;
}
#navbar-full .navbar {
    font-size: 16px !important;
    line-height: 1.2 !important;
}
#navbar-full .logo-container {
    display: flex;
    align-items: center;
}
#navbar-full .logo-image {
    max-height: 64px;
    height: auto;
    width: auto;
    object-fit: contain;
}
.chat-nav-spacer {
    display: block;
    width: 100%;
    height: var(--navbar-height, 4rem);
    min-height: 0;
    flex: none;
    pointer-events: none;
    box-sizing: border-box;
}
.chat-page {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: calc(100vh - var(--navbar-height, 4rem));
    max-height: calc(100vh - var(--navbar-height, 4rem));
    overflow: hidden;
    min-height: 0;
}
.chat-history-sidebar {
    flex: 0 0 var(--chat-sidebar-width);
    width: var(--chat-sidebar-width);
    min-width: var(--chat-sidebar-width);
    max-width: var(--chat-sidebar-width);
    flex-shrink: 0;
    box-sizing: border-box;
    background: linear-gradient(180deg, #f1f5f9 0%, #eef2f7 100%);
    border-right: 1px solid #cbd5e1;
    padding: 0.875rem 0.7rem 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    align-self: stretch;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    z-index: 50;
    -webkit-overflow-scrolling: touch;
}
.chat-history-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.875rem;
    border: none;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.chat-history-new:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}
.chat-history-new:active {
    transform: scale(0.98);
}
.chat-history-heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 0.625rem;
    padding: 0 0.2rem;
}
.chat-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.chat-history-item {
    margin: 0;
    padding: 0;
    position: relative;
}
.chat-history-item-row {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.55rem 0.35rem 0.55rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.chat-history-item-row:hover:not(:has(.chat-history-item-btn.is-active)) {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(148, 163, 184, 0.45);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.chat-history-item-row:has(.chat-history-item-btn.is-active) {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border-color: rgba(129, 140, 248, 0.55);
    color: #312e81;
    box-shadow: inset 3px 0 0 #6366f1, 0 2px 10px rgba(99, 102, 241, 0.12);
}
.chat-history-item-btn {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    text-align: left;
    padding: 0.1rem 0.15rem 0.1rem 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #334155;
    font-size: inherit;
    line-height: 1.45;
    cursor: pointer;
    transition: color 0.15s ease;
}
.chat-history-item-more {
    flex-shrink: 0;
    align-self: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0.45rem;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, opacity 0.15s ease;
}
.chat-history-item-more:hover {
    color: #334155;
}
.chat-history-item-more i {
    font-size: 1.05rem;
}
.chat-history-item-row:has(.chat-history-item-btn.is-active) .chat-history-item-more {
    background: transparent;
    color: #6366f1;
}
.chat-history-item-row:has(.chat-history-item-btn.is-active) .chat-history-item-more:hover {
    color: #4f46e5;
}
.chat-history-item.is-pinned .chat-history-item-btn i::before {
    content: "\ee1f"; /* ri-pushpin-fill */
    color: #6366f1;
    background: rgba(99, 102, 241, 0.12);
}
.chat-history-item.is-pinned .chat-history-item-row {
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    border-color: rgba(139, 92, 246, 0.35);
}
.chat-history-item-menu {
    position: absolute;
    right: 0.25rem;
    top: 100%;
    margin-top: 0.15rem;
    z-index: 200;
    min-width: 7.5rem;
    padding: 0.35rem 0;
    margin: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    box-sizing: border-box;
}
.chat-history-item-menu[hidden] {
    display: none !important;
}
.chat-history-item-menu-item {
    display: block;
    width: 100%;
    padding: 0.45rem 0.85rem;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 0.8125rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.12s ease;
}
.chat-history-item-menu-item:hover {
    background: #f3f4f6;
}
.chat-history-item-menu-item.is-danger {
    color: #b91c1c;
}
.chat-history-item-menu-item.is-danger:hover {
    background: #fef2f2;
}
.chat-history-item-btn.is-active {
    color: #312e81;
}
.chat-history-item-btn.is-active i {
    color: #6366f1;
    background: rgba(255, 255, 255, 0.85);
}
.chat-history-item-btn i {
    flex-shrink: 0;
    width: 1.875rem;
    height: 1.875rem;
    margin-top: 0.05rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 0.5rem;
    transition: color 0.15s ease, background 0.15s ease;
}
.chat-history-item-inner {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    gap: 0.125rem;
}
.chat-history-item-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.5;
    color: #1e293b;
}
.chat-history-item-title-input {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 0;
    padding: 0.1rem 0.25rem;
    border: 1px solid #c7d2fe;
    border-radius: 0.35rem;
    background: #fff;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.5;
    color: #1e293b;
    outline: none;
}
.chat-history-item-title-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}
.chat-history-item-btn.is-active .chat-history-item-title-input {
    color: #312e81;
}
.chat-history-item-btn.is-active .chat-history-item-title {
    color: #312e81;
}
.chat-history-item-meta {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.125rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}
.chat-history-item-btn.is-active .chat-history-item-meta {
    color: #6366f1;
    opacity: 0.95;
}
.chat-main-column {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    padding-bottom: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}
@media (max-width: 768px) {
    body.chat-body-with-nav {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        padding-bottom: var(--chat-composer-pad, 200px);
    }
    .chat-page {
        flex-direction: column;
        min-height: calc(100vh - var(--navbar-height, 4rem));
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .chat-history-sidebar {
        position: relative;
        top: auto;
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 0;
        height: auto;
        max-height: 220px;
        border-right: none;
        border-bottom: 1px solid #cbd5e1;
    }
    .chat-main-column {
        min-height: 0;
        flex: 1 1 auto;
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .chat-main-scroll {
        overflow: visible;
        flex: 1 1 auto;
        min-height: 12rem;
    }
    .chat-empty-examples {
        min-height: 8rem;
        padding-top: 0.25rem;
    }
    .chat-stream {
        overflow: visible;
        min-height: 12rem;
    }
    .chat-input-shell {
        left: 0;
        position: fixed;
    }
    .chat-input-shell::before {
        display: none;
    }
}
.chat-main-scroll {
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    scroll-padding-top: 0.25rm;
    padding-top: 1rem;
}
.chat-showcase-grid {
    width: 100%;
    min-width: 0;
}
.chat-showcase-card.chat-ex-card {
    text-align: left;
}
.chat-showcase-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    overflow: hidden;
}
.chat-showcase-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.chat-empty-examples {
    flex: 1 1 auto;
    min-height: 10rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 1rem;
    padding: 0 1rem 2.5rem;
    box-sizing: border-box;
    width: 100%;
    max-width: min(70rem, 100%);
    margin: 0 auto;
}
.chat-empty-examples[hidden] {
    display: none !important;
}
.chat-empty-examples::after {
    content: "";
    display: block;
    width: 100%;
    height: 1rem;
    flex-shrink: 0;
}
.chat-ex-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: stretch;
    justify-items: stretch;
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
    max-width: min(70rem, 100%);
}
.chat-ex-grid > .chat-ex-card {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
button.chat-ex-card {
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
}
@media (max-width: 1100px) {
    .chat-ex-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 820px) {
    .chat-ex-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 380px) {
    .chat-ex-grid {
        grid-template-columns: 1fr;
    }
}
.chat-ex-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    margin: 0;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #fff;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.chat-ex-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}
.chat-ex-card:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #6366f1;
}
.chat-ex-card.is-selected {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15), 0 8px 28px rgba(239, 68, 68, 0.12);
}
.chat-ex-card:has(.chat-ex-card-compare).is-selected {
    border-color: #c4b5fd;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}
.chat-ex-card:has(.chat-ex-card-compare).is-selected:hover {
    border-color: #a78bfa;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.14);
}
.chat-ex-card-badge {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    z-index: 3;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    line-height: 1.3;
    pointer-events: none;
}
.chat-ex-card-compare {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
}
.chat-ex-card-half {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-ex-card-half:first-child {
    border-right: 1px solid rgba(148, 163, 184, 0.45);
}
.chat-ex-card-half img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.chat-ex-card-arrow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #fff;
    color: #64748b;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 2;
    pointer-events: none;
}
.chat-ex-card-text {
    padding: 0.5rem 0.6rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    border-top: 1px solid #f1f5f9;
    background: #fafafa;
}
.chat-ex-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}
.chat-ex-card-desc {
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.4;
}
.chat-main-scroll--conversation .chat-stream {
    flex: 1 1 0%;
    min-height: 0;
}
.chat-stream {
    flex: 0 0 auto;
    padding: 1rem;
    padding-bottom: 0.5rem;
    max-width: min(72rem, 100%);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    overflow: visible;
}
.chat-msg {
    margin-bottom: 1rem;
}
.chat-msg::after {
    content: '';
    display: table;
    clear: both;
}
.chat-msg-assist.chat-active-thinking {
    margin-top: 1rem;
}
.chat-msg-user-images {
    float: right;
    clear: both;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    max-width: 92%;
    margin-bottom: 0.35rem;
}
.chat-msg-user-thumb {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: cover;
    border-radius: 0.45rem;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    display: block;
}
.chat-msg-user {
    max-width: 92%;
    margin-left: auto;
    float: right;
    clear: both;
    background: #eef2ff;
    color: #1e1b4b;
    padding: 0.65rem 0.9rem;
    border-radius: 1rem 1rem 0.35rem 1rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-stream::after {
    content: "";
    display: table;
    clear: both;
}
.chat-msg-assist {
    clear: both;
    max-width: 100%;
    margin-bottom: 0.75rem;
}
.chat-thinking-box {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: #f5f3ff;
    border: 1px solid #e9d5ff;
    border-radius: 0.75rem;
    color: #5b21b6;
    font-size: 0.875rem;
}
.chat-thinking-box .spin {
    animation: chat-spin 0.85s linear infinite;
}
.chat-thinking-box-done {
    background: #ecfdf5;
    border-color: #6ee7b7;
    color: #065f46;
}
.chat-thinking-box-done::before {
    content: '';
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23065f46'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
}
.chat-thinking-detail {
    margin-top: 0.5rem;
    padding: 0.65rem 0.85rem;
    max-width: 100%;
    max-height: min(40vh, 280px);
    overflow-y: auto;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #4b5563;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}
.chat-thinking-detail[hidden] {
    display: none !important;
}
@keyframes chat-spin {
    to {
        transform: rotate(360deg);
    }
}
.chat-result-media {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    vertical-align: top;
    max-height: 480px;
}
.chat-result-img {
    max-width: 100%;
    max-height: 480px;
    width: auto;
    height: auto;
    display: block;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    object-fit: contain;
}
.chat-result-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.chat-result-media:hover .chat-result-overlay {
    opacity: 1;
    pointer-events: auto;
}
.chat-result-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.chat-result-preview-btn:hover {
    background: #fff;
}
.chat-result-download-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.chat-result-download-btn:hover {
    background: #fff;
}
@media (hover: none) {
    .chat-result-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}
.chat-result-caption {
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.5rem;
    line-height: 1.45;
}
.chat-result-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #7c3aed;
}
.chat-input-shell {
    position: relative;
    flex-shrink: 0;
    left: auto;
    right: auto;
    z-index: 10;
    padding: 0.35rem 1rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    box-sizing: border-box;
    border-top: none;
    overflow: visible;
}
.chat-input-shell::before {
    display: none;
}
.chat-input-shell .home-hero-panel {
    max-width: min(72rem, 100%);
    margin: 0 auto;
}
.chat-error {
    color: #b91c1c;
    font-size: 0.875rem;
    padding: 0.5rem 0;
}
.chat-result-grid {
    display: grid;
    gap: 0.5rem;
    max-width: 100%;
}
.chat-result-grid-2 {
    grid-template-columns: 1fr 1fr;
}
.chat-result-grid-3,
.chat-result-grid-4 {
    grid-template-columns: 1fr 1fr;
}
.chat-img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483640;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}
.chat-img-lightbox[hidden] {
    display: none !important;
}
.chat-img-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}
.chat-img-lightbox-panel {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.chat-img-lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    font-size: 1.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.chat-img-lightbox-close:hover {
    background: #fff;
}
.chat-img-lightbox-stage {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
}
.chat-img-lightbox-nav {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border: none;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.chat-img-lightbox-nav[hidden] {
    display: none !important;
}
.chat-img-lightbox-imgbox {
    position: relative;
    max-width: min(92vw, 1100px);
    max-height: min(85vh, 900px);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #0f172a;
}
.chat-img-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: min(85vh, 900px);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}
.chat-img-lightbox-dl {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    font-size: 1.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.chat-img-lightbox-dl:hover {
    background: #fff;
}
.chat-img-lightbox-counter {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.92);
    text-align: center;
    min-height: 1.25rem;
}
        .home-hero-panel {
            width: 100%;
            max-width: min(72rem, 100%);
            margin-left: auto;
            margin-right: auto;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 2rem;
            box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
            overflow: hidden;
        }
        .home-hero-textarea {
            width: 100%;
            min-height: 108px;
            max-height: 240px;
            padding: 0.65rem 0.85rem 0.5rem;
            border: 0;
            resize: none;
            overflow-y: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
            font-size: 0.9375rem;
            color: #374151;
            line-height: 1.55;
            outline: none;
            background: #fff;
        }
        .home-hero-textarea::-webkit-scrollbar {
            display: none;
            width: 0;
            height: 0;
        }
        .home-hero-textarea::placeholder {
            color: #9ca3af;
        }
        .home-hero-attachments {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.4rem;
            padding: 0.45rem 0.75rem 0;
            background: #fff;
        }
        .home-hero-attachments[hidden] {
            display: none !important;
        }
        .home-hero-attachments-list {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem;
        }
        .home-hero-attach-item {
            position: relative;
            flex-shrink: 0;
            z-index: 1;
        }
        .home-hero-attach-item:hover {
            z-index: 40;
        }
        .home-hero-attach-thumb {
            width: 3rem;
            height: 3rem;
            position: relative;
            border-radius: 0.45rem;
            overflow: hidden;
            border: 1px solid #e5e7eb;
            background: #f9fafb;
        }
        .home-hero-attach-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
            transition: transform 0.22s ease;
        }
        .home-hero-attach-item:hover .home-hero-attach-thumb img {
            transform: scale(1.12);
        }
        .home-hero-attach-hover-preview {
            display: none;
            position: fixed;
            left: 0;
            top: 0;
            z-index: 2147483640;
            width: min(240px, 72vw);
            max-height: min(320px, 80vh);
            padding: 8px;
            box-sizing: border-box;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
            border: 1px solid #e5e7eb;
            pointer-events: none;
        }
        .home-hero-attach-hover-preview img {
            width: 100%;
            height: auto;
            max-height: min(300px, 70vh);
            object-fit: contain;
            display: block;
            border-radius: 8px;
        }
        .home-hero-attach-remove {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 1.125rem;
            height: 1.125rem;
            border: none;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.55);
            color: #fff;
            font-size: 0.75rem;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
        }
        .home-hero-attach-add {
            flex-shrink: 0;
            width: 3rem;
            height: 3rem;
            border-radius: 0.45rem;
            border: 2px dashed #c4b5fd;
            background: #faf5ff;
            color: #7c3aed;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.35rem;
            transition: background 0.15s, border-color 0.15s;
        }
        .home-hero-attach-add:hover {
            background: #f3e8ff;
            border-color: #a78bfa;
        }
        .home-hero-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.4rem 0.5rem;
            padding: 0 0.75rem 0.65rem;
            background: #fff;
        }
        .home-hero-toolbar-tile {
            flex: 0 0 6.75rem;
            width: 6.75rem;
            min-width: 6.75rem;
            max-width: 6.75rem;
            box-sizing: border-box;
        }
        .home-hero-toolbar-tile.home-hero-tool-btn {
            justify-content: center;
            padding-left: 0.4rem;
            padding-right: 0.4rem;
        }
        .home-hero-toolbar-tile.home-hero-tool-select {
            max-width: none;
            padding-left: 0.45rem;
            padding-right: 1.35rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .home-ratio-wrap.home-hero-toolbar-tile {
            display: block;
        }
        .home-ratio-wrap.home-hero-toolbar-tile .home-ratio-trigger {
            width: 100%;
            max-width: none;
            justify-content: center;
            padding-left: 0.4rem;
            padding-right: 0.4rem;
            min-width: 0;
        }
        #home-ratio-trigger-text {
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: center;
        }
        .home-hero-tool-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #111827;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 0.45rem 0.75rem;
            cursor: pointer;
            transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
        }
        .home-hero-tool-btn:hover {
            border-color: #d1d5db;
            color: #1f2937;
        }
        .home-hero-tool-select {
            font-size: 0.8125rem;
            font-weight: 500;
            color: #111827;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 0.45rem 2rem 0.45rem 0.65rem;
            max-width: 155px;
            cursor: pointer;
            appearance: none;
            -webkit-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'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 0.5rem center;
            background-size: 14px;
            line-height: 1.3;
        }
        .home-hero-tool-select:focus {
            outline: none;
            border-color: #d1d5db;
        }
        .home-hero-send {
            margin-left: auto;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.4rem 0.9rem;
            border-radius: 0.5rem;
            font-size: 0.8125rem;
            font-weight: 600;
            border: none;
            cursor: pointer;
            transition: background 0.2s, color 0.2s;
        }
        .home-hero-send:disabled {
            background: #e5e7eb;
            color: #9ca3af;
            cursor: not-allowed;
        }
        .home-hero-send:not(:disabled) {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: #fff;
        }
        .home-hero-quick-links {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 0.6rem;
            padding: 1rem 0 0;
        }
        .home-quick-link {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.45rem 0.85rem;
            font-size: 0.8125rem;
            color: #4b5563;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 1.5rem;
            text-decoration: none;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .home-quick-link:hover {
            color: #6366f1;
            border-color: #6366f1;
            background: #f5f3ff;
        }
        .home-quick-link i {
            font-size: 0.875rem;
        }
        .home-hero-nano-wrap {
            padding: 0 1rem 1rem;
            border-top: 1px solid #f3f4f6;
            background: #fff;
        }
        .home-hero-nano-wrap[hidden] {
            display: none !important;
        }
        .home-hero-nano-status {
            font-size: 0.8125rem;
            color: #6b7280;
            margin: 0.5rem 0 0;
            line-height: 1.45;
        }
        .home-hero-nano-preview {
            margin-top: 0.5rem;
        }
        .home-hero-nano-preview img {
            display: block;
            max-width: 100%;
            max-height: min(70vh, 520px);
            border-radius: 0.5rem;
            border: 1px solid #e5e7eb;
        }
        .home-hero-nano-preview a {
            display: inline-block;
            margin-top: 0.5rem;
            font-size: 0.8125rem;
            color: #7c3aed;
        }
        .home-ratio-wrap {
            position: relative;
            z-index: 20;
        }
        .home-ratio-sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
        .home-ratio-trigger {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #111827;
            background-color: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 0.45rem 0.65rem;
            cursor: pointer;
            line-height: 1.3;
            max-width: 200px;
            transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s, color 0.15s;
        }
        .home-ratio-trigger:hover {
            border-color: #d1d5db;
        }
        .home-ratio-trigger:focus {
            outline: none;
            border-color: #d1d5db;
            box-shadow: 0 0 0 2px rgba(209, 213, 219, 0.5);
        }
        .home-ratio-trigger i {
            font-size: 1rem;
            color: #6b7280;
        }
        .home-ratio-trigger .home-ratio-chevron {
            font-size: 1rem;
            margin-left: 0.15rem;
            color: #6b7280;
        }
        .home-ratio-trigger.home-ratio-trigger-active {
            color: #5b21b6;
            background-color: #f5f3ff;
            border-color: #c4b5fd;
        }
        .home-ratio-trigger.home-ratio-trigger-active:hover {
            border-color: #a78bfa;
        }
        .home-ratio-trigger.home-ratio-trigger-active:focus {
            border-color: #a78bfa;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
        }
        .home-ratio-trigger.home-ratio-trigger-active i,
        .home-ratio-trigger.home-ratio-trigger-active .home-ratio-chevron {
            color: #7c3aed;
        }
        .home-ratio-panel {
            position: fixed;
            z-index: 2147483000;
            width: min(300px, 92vw);
            margin: 0;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.625rem;
            box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
            padding: 0.5rem;
            box-sizing: border-box;
            max-height: min(70vh, 420px);
            overflow-x: hidden;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        .home-ratio-panel[hidden] {
            display: none !important;
        }
        .home-ratio-header-row {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            width: 100%;
            text-align: left;
            padding: 0.55rem 0.6rem;
            border: none;
            border-radius: 0.5rem;
            background: #ede9fe;
            cursor: pointer;
            margin-bottom: 0.45rem;
            transition: background 0.15s;
        }
        .home-ratio-header-row:hover {
            background: #e4dfff;
        }
        .home-ratio-header-row.is-selected .home-ratio-check {
            opacity: 1;
        }
        .home-ratio-header-row .home-ratio-check {
            opacity: 0;
            color: #7c3aed;
            font-size: 1.125rem;
            margin-left: auto;
        }
        .home-ratio-header-mid {
            display: flex;
            flex-direction: column;
            gap: 0.1rem;
            min-width: 0;
        }
        .home-ratio-header-title {
            font-size: 0.8125rem;
            font-weight: 700;
            color: #111827;
        }
        .home-ratio-header-desc {
            font-size: 0.6875rem;
            color: #6b7280;
        }
        .home-ratio-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.4rem;
        }
        .home-ratio-cell {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            padding: 0.45rem 0.5rem;
            border: 1px solid #e5e7eb;
            border-radius: 0.45rem;
            background: #fff;
            cursor: pointer;
            text-align: left;
            transition: border-color 0.15s, background 0.15s;
        }
        .home-ratio-cell:hover {
            border-color: #d1d5db;
            background: #fafafa;
        }
        .home-ratio-cell.is-selected {
            border-color: #c4b5fd;
            background: #faf5ff;
        }
        .home-ratio-shape-wrap {
            flex-shrink: 0;
            width: 22px;
            height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .home-ratio-shape {
            border: 1.5px solid #6b7280;
            border-radius: 2px;
            box-sizing: border-box;
            display: block;
        }
        .home-ratio-cell-text {
            display: flex;
            flex-direction: column;
            gap: 0.05rem;
            min-width: 0;
        }
        .home-ratio-cell-main {
            font-size: 0.75rem;
            font-weight: 700;
            color: #111827;
        }
        .home-ratio-cell-sub {
            font-size: 0.625rem;
            color: #9ca3af;
        }
        .home-model-wrap.home-hero-toolbar-tile {
            display: block;
        }
        .home-model-wrap.home-hero-toolbar-tile .home-model-trigger {
            width: 100%;
            max-width: none;
            justify-content: center;
            padding-left: 0.4rem;
            padding-right: 0.4rem;
            min-width: 0;
        }
        .home-model-credits-hint {
            flex: 0 0 auto;
            align-self: center;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #64748b;
            white-space: nowrap;
            line-height: 1.3;
            padding: 0 0.15rem;
        }
        .home-model-trigger {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #5b21b6;
            background-color: #f5f3ff;
            border: 1px solid #c4b5fd;
            border-radius: 0.5rem;
            padding: 0.45rem 0.65rem;
            cursor: pointer;
            line-height: 1.3;
            transition: border-color 0.15s, box-shadow 0.15s;
            width: 100%;
            box-sizing: border-box;
        }
        .home-model-trigger:hover {
            border-color: #a78bfa;
        }
        .home-model-trigger:focus {
            outline: none;
            border-color: #a78bfa;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
        }
        .home-model-trigger .home-model-trigger-icon {
            font-size: 1rem;
            color: #7c3aed;
        }
        .home-model-trigger .home-model-chevron {
            margin-left: 0.15rem;
            font-size: 1rem;
            color: #7c3aed;
        }
        #home-model-trigger-text {
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: center;
        }
        .home-model-panel {
            position: fixed;
            z-index: 2147483000;
            width: min(360px, 94vw);
            margin: 0;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.75rem;
            box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
            padding: 0.65rem 0.65rem 0.55rem;
            box-sizing: border-box;
            max-height: min(75vh, 480px);
            overflow-x: hidden;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        .home-model-panel[hidden] {
            display: none !important;
        }
        .home-model-panel-top {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 0.5rem;
            padding: 0 0.15rem 0.55rem;
            margin-bottom: 0.4rem;
            border-bottom: 1px solid #f3f4f6;
        }
        .home-model-panel-title {
            font-size: 0.9375rem;
            font-weight: 700;
            color: #111827;
        }
        .home-model-card {
            position: relative;
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
            width: 100%;
            text-align: left;
            padding: 0.65rem 2rem 0.65rem 0.6rem;
            margin-bottom: 0.45rem;
            border: 2px solid #e5e7eb;
            border-radius: 0.5rem;
            background: #fff;
            cursor: pointer;
            transition: border-color 0.15s, background 0.15s;
            box-sizing: border-box;
        }
        .home-model-card:last-of-type {
            margin-bottom: 0;
        }
        .home-model-card:hover {
            border-color: #d1d5db;
            background: #fafafa;
        }
        .home-model-card.is-selected {
            border-color: #8b5cf6;
            background: #faf5ff;
        }
        .home-model-card-icon {
            flex-shrink: 0;
            font-size: 1.25rem;
            color: #7c3aed;
            margin-top: 0.05rem;
        }
        .home-model-card-mid {
            flex: 1;
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
        }
        .home-model-card-title {
            font-size: 0.8125rem;
            font-weight: 700;
            color: #111827;
        }
        .home-model-card-desc {
            font-size: 0.6875rem;
            color: #6b7280;
            line-height: 1.35;
        }
        .home-model-card-check {
            position: absolute;
            top: 0.5rem;
            right: 0.45rem;
            font-size: 1.1rem;
            color: #7c3aed;
            opacity: 0;
            pointer-events: none;
        }
        .home-model-card.is-selected .home-model-card-check {
            opacity: 1;
        }
        .home-imagesize-wrap.home-hero-toolbar-tile {
            display: block;
        }
        .home-imagesize-wrap.home-hero-toolbar-tile[hidden] {
            display: none !important;
        }
        .home-imagesize-wrap.home-hero-toolbar-tile .home-imagesize-trigger {
            width: 100%;
            max-width: none;
            justify-content: center;
            padding-left: 0.4rem;
            padding-right: 0.4rem;
            min-width: 0;
        }
        .home-imagesize-trigger {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.8125rem;
            font-weight: 500;
            color: #5b21b6;
            background-color: #f5f3ff;
            border: 1px solid #c4b5fd;
            border-radius: 0.5rem;
            padding: 0.45rem 0.65rem;
            cursor: pointer;
            line-height: 1.3;
            transition: border-color 0.15s, box-shadow 0.15s;
            width: 100%;
            box-sizing: border-box;
        }
        .home-imagesize-trigger:hover {
            border-color: #a78bfa;
        }
        .home-imagesize-trigger:focus {
            outline: none;
            border-color: #a78bfa;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
        }
        .home-imagesize-trigger .home-imagesize-trigger-icon {
            font-size: 1rem;
            color: #7c3aed;
            flex-shrink: 0;
        }
        .home-imagesize-trigger .home-imagesize-chevron {
            margin-left: 0.15rem;
            font-size: 1rem;
            color: #7c3aed;
            flex-shrink: 0;
        }
        #home-imagesize-trigger-text {
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            text-align: center;
        }
        .home-imagesize-panel {
            position: fixed;
            z-index: 2147483000;
            width: min(240px, 92vw);
            margin: 0;
            background: #fff;
            border: 1px solid #e5e7eb;
            border-radius: 0.75rem;
            box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12);
            padding: 0.55rem 0.6rem 0.5rem;
            box-sizing: border-box;
        }
        .home-imagesize-panel[hidden] {
            display: none !important;
        }
        .home-imagesize-panel-hint {
            font-size: 0.6875rem;
            color: #9ca3af;
            line-height: 1.35;
            margin-bottom: 0.45rem;
        }
        .home-imagesize-opt {
            display: block;
            width: 100%;
            text-align: center;
            padding: 0.45rem 0.5rem;
            border: 1px solid #e5e7eb;
            border-radius: 0.45rem;
            margin-bottom: 0.3rem;
            background: #fff;
            cursor: pointer;
            font-size: 0.8125rem;
            font-weight: 600;
            color: #374151;
            transition: border-color 0.15s, background 0.15s;
        }
        .home-imagesize-opt:last-of-type {
            margin-bottom: 0;
        }
        .home-imagesize-opt:hover {
            border-color: #d1d5db;
            background: #fafafa;
        }
        .home-imagesize-opt.is-selected {
            border-color: #c4b5fd;
            background: #faf5ff;
            color: #5b21b6;
        }
