/* =========================================================
   AIECA — Premium Agency UI
   ========================================================= */

/* --- Design Tokens --- */
:root {
    /* Surfaces */
    --bg-deep: #07090d;
    --bg-base: #10141d;
    --surface-0: rgba(13, 17, 24, 0.74);
    --surface-1: rgba(22, 28, 38, 0.82);
    --surface-2: rgba(37, 46, 60, 0.72);
    --surface-hover: rgba(201, 166, 107, 0.08);
    --surface-lift: rgba(255, 255, 255, 0.055);

    /* Accent */
    --accent: #c9a66b;
    --accent-secondary: #f3d49a;
    --accent-gradient: linear-gradient(135deg, #f1d39b 0%, #c9a66b 48%, #7b5d30 100%);
    --accent-glow: 0 18px 48px rgba(201, 166, 107, 0.18);

    /* Semantic */
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.12);
    --warning: #fbbf24;

    /* Text */
    --text-primary: #f7f3ea;
    --text-secondary: #b7ad9f;
    --text-muted: #746c61;

    /* Chat */
    --msg-user: linear-gradient(135deg, #efe0bf 0%, #c9a66b 100%);
    --msg-assistant: var(--surface-1);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.075);
    --border-light: rgba(255, 255, 255, 0.13);
    --border-accent: rgba(201, 166, 107, 0.34);

    /* Radii */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 30px;
    --radius-pill: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-normal: 250ms var(--ease-out);
    --transition-slow: 400ms var(--ease-out);
}

/* --- Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* --- Animated Background --- */
body {
    font-family: 'Outfit', sans-serif;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.028), transparent 28%),
        radial-gradient(circle at 76% 14%, rgba(201, 166, 107, 0.11), transparent 34%),
        radial-gradient(circle at 20% 88%, rgba(65, 82, 109, 0.3), transparent 38%),
        var(--bg-deep);
    color: var(--text-primary);
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255,255,255,0.025) 1px, transparent 1px),
        radial-gradient(680px circle at 22% 28%, rgba(201, 166, 107, 0.08), transparent 58%),
        radial-gradient(560px circle at 84% 74%, rgba(95, 112, 144, 0.15), transparent 62%);
    background-size: 72px 72px, 72px 72px, auto, auto;
    animation: bgShift 24s var(--ease-out) infinite alternate;
    pointer-events: none;
}

@keyframes bgShift {
    0%   { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-20px, 15px) scale(1.02); }
    66%  { transform: translate(15px, -10px) scale(0.98); }
    100% { transform: translate(-10px, -20px) scale(1.01); }
}

/* Subtle noise texture */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* --- Main Container --- */
.glass-container {
    position: relative;
    z-index: 1;
    width: 96%;
    max-width: 1400px;
    height: min(94vh, 940px);
    min-height: 720px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015)),
        var(--surface-0);
    backdrop-filter: blur(28px) saturate(1.15);
    -webkit-backdrop-filter: blur(28px) saturate(1.15);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-2xl);
    display: flex;
    flex-direction: column;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.11) inset,
        0 0 0 1px rgba(201,166,107,0.05) inset,
        0 44px 90px -34px rgba(0, 0, 0, 0.86),
        0 18px 36px -26px rgba(201, 166, 107, 0.3);
    overflow: hidden;
}

.glass-container::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: calc(var(--radius-2xl) - 1px);
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), transparent 20%),
        radial-gradient(circle at 15% 0%, rgba(201,166,107,0.1), transparent 28%);
    z-index: 0;
}

.glass-container > * {
    position: relative;
    z-index: 1;
}

/* --- Header --- */
header {
    padding: 18px 34px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(4, 6, 10, 0.34);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.32));
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.support-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.model-toggle {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset;
}

.model-option {
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    border: 0;
    box-shadow: none;
    font-size: 0.74rem;
}

.model-option:hover {
    color: var(--accent-strong);
    transform: none;
    box-shadow: none;
}

.model-option.active {
    background: var(--accent);
    color: #14100a;
}

/* --- Status Badge --- */
.status-badge {
    font-size: 0.73rem;
    font-weight: 500;
    padding: 7px 14px 7px 10px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(52, 211, 153, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: all var(--transition-normal);
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-badge.error {
    background: var(--error-bg);
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.2);
}

.status-badge.error::before {
    background: var(--error);
    animation: none;
}

.status-badge.loading::before {
    background: var(--warning);
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* --- Buttons --- */
button {
    font-family: 'Outfit', sans-serif;
    padding: 11px 20px;
    border-radius: var(--radius-pill);
    border: none;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition:
        transform var(--transition-normal),
        border-color var(--transition-normal),
        background var(--transition-normal),
        box-shadow var(--transition-normal),
        color var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

button::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

button:hover::after {
    opacity: 1;
}

button:active {
    transform: scale(0.97);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button:disabled::after {
    display: none;
}

button.primary, #send-btn {
    background: var(--accent-gradient);
    color: #14100a;
    box-shadow: var(--accent-glow);
}

button.primary:hover, #send-btn:hover {
    box-shadow: 0 22px 54px rgba(201, 166, 107, 0.26);
    transform: translateY(-2px);
}

button.secondary {
    background: rgba(255,255,255,0.045);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset;
}

button.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(201, 166, 107, 0.3);
    transform: translateY(-2px);
}

button.tiny {
    padding: 7px 14px;
    font-size: 0.75rem;
    border-radius: var(--radius-pill);
}

.button-mark {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.08);
    color: var(--accent-strong);
    font-size: 0.68rem;
    font-weight: 700;
}

/* Button loading state */
button .btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

button.loading .btn-spinner {
    display: inline-block;
}

button.loading .btn-text {
    display: none;
}

button.loading .btn-loading-text {
    display: inline;
}

button .btn-loading-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Main Layout --- */
main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* --- Chat Section --- */
.chat-section {
    flex: 5;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    min-width: 0;
    background:
        radial-gradient(circle at 14% 12%, rgba(201, 166, 107, 0.055), transparent 28%),
        linear-gradient(180deg, rgba(255,255,255,0.018), transparent 32%);
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
.chat-window::-webkit-scrollbar {
    width: 5px;
}

.chat-window::-webkit-scrollbar-track {
    background: transparent;
}

.chat-window::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
}

.chat-window::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.spec-grid::-webkit-scrollbar {
    width: 4px;
}

.spec-grid::-webkit-scrollbar-track {
    background: transparent;
}

.spec-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-pill);
}

/* --- Messages --- */
.message-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    animation: msgSlideIn 0.35s var(--ease-out) both;
    position: relative;
}

.message-row.user {
    flex-direction: row-reverse;
}

@keyframes msgSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.msg-avatar.ai {
    background: var(--accent-gradient);
    color: #17110a;
    box-shadow: 0 14px 32px rgba(201, 166, 107, 0.18);
}

.msg-avatar.human {
    background: rgba(255,255,255,0.055);
    border: 1px solid var(--border-light);
    color: var(--accent-strong);
}

.message {
    max-width: min(75%, 820px);
    padding: 16px 19px;
    border-radius: 20px;
    line-height: 1.65;
    font-size: 0.94rem;
    word-break: break-word;
}

.message.assistant {
    background: var(--msg-assistant);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 7px;
    color: var(--text-primary);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.06) inset,
        0 22px 48px rgba(0, 0, 0, 0.18);
}

.message.user {
    background: var(--msg-user);
    border-bottom-right-radius: 7px;
    color: #15100a;
    box-shadow: 0 18px 44px rgba(201, 166, 107, 0.16);
}

.seen-receipt {
    position: absolute;
    right: 40px;
    bottom: -17px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    pointer-events: none;
}

.seen-receipt.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Suggestions --- */
.suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-left: 44px;
    animation: msgSlideIn 0.5s var(--ease-out) both;
}

.suggestion-chip {
    appearance: none;
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.suggestion-chip:hover {
    background: var(--surface-hover);
    border-color: var(--border-accent);
    color: var(--accent-strong);
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.suggestion-chip:active {
    transform: translateY(0);
}

.suggestion-chip.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #14100a;
}

.suggestions-container.hidden {
    display: none;
}

/* Markdown content in messages */
.message p { margin-bottom: 8px; }
.message p:last-child { margin-bottom: 0; }
.message ul, .message ol { padding-left: 20px; margin-bottom: 8px; }
.message li { margin-bottom: 2px; }

.message strong {
    color: var(--accent-strong);
    background: rgba(201, 166, 107, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
}

.message code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    font-family: 'Fira Code', monospace;
}

.sample-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.sample-gallery-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
}

.sample-gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.18);
}

.sample-gallery-item figcaption {
    padding: 8px 9px;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.35;
}

.sample-gallery-item.image-error {
    min-height: 76px;
    display: grid;
    place-items: center;
    padding: 12px;
}

.sample-gallery-item.image-error::before {
    content: 'Không tải được ảnh mẫu';
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

/* --- Typing Indicator --- */
.typing-indicator {
    display: none;
    align-items: flex-end;
    gap: 10px;
    padding: 0;
    flex-shrink: 0;
}

.typing-indicator.visible {
    display: flex;
}

.typing-indicator.visible .msg-avatar {
    animation: typingAvatarFloat 1.6s var(--ease-out) infinite;
}

.typing-text {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    background: rgba(22, 28, 38, 0.88);
    border: 1px solid var(--border-subtle);
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    border-bottom-left-radius: 7px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
    animation: typingBubbleFloat 1.8s var(--ease-out) infinite;
}

.typing-text::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 0%,
        rgba(201, 166, 107, 0.04) 34%,
        rgba(201, 166, 107, 0.16) 50%,
        rgba(201, 166, 107, 0.04) 66%,
        transparent 100%
    );
    transform: translateX(-110%);
    animation: typingShimmer 1.8s ease-in-out infinite;
    pointer-events: none;
}

.typing-text > span {
    position: relative;
    z-index: 1;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    box-shadow: 0 0 12px rgba(201, 166, 107, 0.55);
    animation: typingDotBounce 0.9s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.14s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.28s;
}

@keyframes typingAvatarFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes typingBubbleFloat {
    0%, 100% {
        transform: translateY(0);
        border-color: var(--border-subtle);
    }
    50% {
        transform: translateY(-2px);
        border-color: rgba(201, 166, 107, 0.2);
    }
}

@keyframes typingShimmer {
    0% { transform: translateX(-110%); }
    55%, 100% { transform: translateX(110%); }
}

@keyframes typingDotBounce {
    0%, 80%, 100% {
        transform: translateY(0) scale(0.78);
        opacity: 0.45;
    }
    40% {
        transform: translateY(-5px) scale(1);
        opacity: 1;
    }
}

/* --- Input Area --- */
.input-area {
    padding: 18px 32px 22px;
    display: flex;
    gap: 12px;
    border-top: 1px solid var(--border-subtle);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), transparent),
        rgba(4, 6, 10, 0.28);
    flex-shrink: 0;
}

input[type="text"] {
    flex: 1;
    min-width: 0;
    font-family: 'Outfit', sans-serif;
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border-light);
    padding: 15px 20px;
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-size: 0.92rem;
    outline: none;
    transition: all var(--transition-normal);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
}

input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(201, 166, 107, 0.12);
    background: rgba(255,255,255,0.065);
}

#send-btn {
    padding: 12px 12px 12px 22px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    min-width: 92px;
    flex-shrink: 0;
}

.send-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-pill);
    background: rgba(20, 16, 10, 0.12);
    margin-left: 2px;
    transition: transform var(--transition-normal), background var(--transition-normal);
}

#send-btn:hover .send-mark {
    transform: translateX(2px);
    background: rgba(20, 16, 10, 0.18);
}

/* --- Dashboard Section --- */
.dashboard-section {
    flex: 3;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), transparent 38%),
        rgba(5, 7, 11, 0.34);
    min-width: 0;
    overflow: hidden;
}

.dashboard-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

button.dashboard-header {
    width: 100%;
    background: transparent;
    color: inherit;
    border-radius: 0;
    justify-content: flex-start;
    text-align: left;
}

button.dashboard-header:hover {
    background: var(--surface-hover);
    transform: none;
}

button.dashboard-header::after {
    display: none;
}

.dashboard-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.spec-summary {
    color: var(--accent-strong);
    background: rgba(201, 166, 107, 0.09);
    border: 1px solid rgba(201, 166, 107, 0.22);
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    white-space: nowrap;
}

.spec-chevron {
    color: var(--text-secondary);
    font-size: 0.8rem;
    transition: transform var(--transition-normal);
}

.dashboard-header[aria-expanded="true"] .spec-chevron {
    transform: rotate(180deg);
}

.dashboard-header .accent-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--border-light), transparent);
}

.panel-kicker {
    color: var(--accent-strong);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    padding: 7px 8px;
    border: 1px solid rgba(201, 166, 107, 0.22);
    border-radius: var(--radius-sm);
    background: rgba(201, 166, 107, 0.08);
}

.dashboard-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

.dashboard-body.collapsed {
    display: none;
}

.spec-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.spec-item {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.048), rgba(255,255,255,0.012)),
        var(--surface-0);
    border: 1px solid var(--border-subtle);
    padding: 14px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.spec-item:hover {
    background:
        linear-gradient(135deg, rgba(201,166,107,0.08), rgba(255,255,255,0.02)),
        var(--surface-0);
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.06) inset,
        0 18px 38px rgba(0, 0, 0, 0.26);
}

.spec-item.filled {
    border-color: rgba(201, 166, 107, 0.24);
}

.spec-item.filled::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 0 2px 2px 0;
}

.spec-item.flash {
    animation: specFlash 0.6s ease-out;
}

@keyframes specFlash {
    0% { background: rgba(201, 166, 107, 0.15); }
    100% { background: var(--surface-0); }
}

.spec-icon {
    font-size: 0.62rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.075);
    border-radius: 11px;
    color: var(--text-secondary);
    font-weight: 800;
    letter-spacing: 0.08em;
    flex-shrink: 0;
    margin-top: 1px;
}

.spec-item.filled .spec-icon {
    background: rgba(201, 166, 107, 0.13);
    color: var(--accent-strong);
    border-color: rgba(201, 166, 107, 0.2);
}

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

.spec-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
    font-weight: 700;
}

.spec-value {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spec-value.empty {
    color: var(--text-muted);
    font-weight: 400;
    font-style: italic;
    font-size: 0.82rem;
}

/* --- Actions Area --- */
.actions-area {
    padding: 18px 20px 20px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(3, 5, 9, 0.2);
    flex-shrink: 0;
}

select {
    font-family: 'Outfit', sans-serif;
    background-color: rgba(255,255,255,0.045);
    border: 1px solid var(--border-light);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 166, 107, 0.11);
}

select option {
    background: #161c26;
    color: var(--text-primary);
}

.export-buttons {
    display: flex;
    gap: 8px;
}

.export-buttons button {
    flex: 1;
    padding: 12px 16px;
}

/* --- Toast Notification System --- */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 420px;
    padding: 14px 20px;
    border-radius: var(--radius-lg);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(16px);
    border: 1px solid;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.08) inset,
        0 22px 52px rgba(0, 0, 0, 0.42);
    animation: toastIn 0.4s var(--ease-out) both;
    line-height: 1.4;
}

.toast.removing {
    animation: toastOut 0.3s var(--ease-out) both;
}

.toast.success {
    background: rgba(16, 48, 36, 0.9);
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.2);
}

.toast.error {
    background: rgba(48, 16, 16, 0.9);
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.2);
}

.toast.info {
    background: rgba(35, 28, 18, 0.92);
    color: var(--accent-strong);
    border-color: rgba(201, 166, 107, 0.24);
}

.toast-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.08);
    font-size: 0.7rem;
    font-weight: 800;
    flex-shrink: 0;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .glass-container {
        width: 100%;
        height: 100dvh;
        min-height: 0;
        border-radius: 0;
    }

    main {
        flex-direction: column;
    }

    .chat-section {
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        flex: 1;
        min-height: 0;
    }

    .dashboard-section {
        flex: none;
        max-height: 45vh;
    }

    .spec-grid {
        grid-template-columns: 1fr 1fr;
    }

    header {
        padding: 12px 16px;
    }

    .logo {
        font-size: 0.9rem;
    }

    .chat-window {
        padding: 18px 16px;
    }

    .input-area {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 540px) {
    .input-area {
        gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }

    input[type="text"] {
        padding: 12px 14px;
        font-size: 0.88rem;
    }

    #send-btn {
        min-width: 58px;
        padding: 10px 10px 10px 14px;
        font-size: 0.86rem;
    }

    .send-mark {
        width: 26px;
        height: 26px;
    }

    .spec-grid {
        grid-template-columns: 1fr;
    }

    .sample-gallery {
        grid-template-columns: 1fr;
    }

    .header-actions {
        gap: 6px;
    }

    .support-label {
        font-size: 0.66rem;
    }

    .model-option {
        font-size: 0.66rem;
        padding: 5px 8px;
    }

    .status-badge {
        font-size: 0.66rem;
        padding: 6px 9px;
    }

    button.tiny {
        font-size: 0.68rem;
        padding: 7px 10px;
    }

    .button-mark {
        width: 17px;
        height: 17px;
        font-size: 0.62rem;
    }

    .export-buttons {
        flex-direction: column;
    }
}
