/* ===== CSS Variables ===== */
:root {
    --lcc-blue: #003366;
    --bg-primary: #dbe6f0;
    --bg-secondary: #eef4fa;
    --bg-tertiary: #f7fbff;
    --bg-hover: #e5eef6;
    --bg-input: #f7fbff;
    --text-primary: #1f2937;
    --text-secondary: #50667b;
    --text-muted: #50667b;
    --accent-color: #003366;
    --accent-hover: #01264c;
    --accent-light: rgba(0, 51, 102, 0.15);
    --border-color: #bccfe0;
    --danger-color: #c53030;
    --warning-color: #b7791f;
    --success-color: #1f9d55;
    --sidebar-width: 300px;
    --header-height: 60px;
    --transition-speed: 0.2s;
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(0, 51, 102, 0.12), transparent 18%),
        radial-gradient(circle at bottom right, rgba(30, 90, 150, 0.14), transparent 22%),
        linear-gradient(rgba(0, 51, 102, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 51, 102, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, #dbe6f0 0%, #e5eef6 48%, #edf3f8 100%);
    background-size:
        auto,
        auto,
        42px 42px,
        42px 42px,
        auto;
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100dvh;
    min-height: 100dvh;
    max-width: 100vw;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ===== App Container ===== */
.app-container {
    display: flex;
    height: 100dvh;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 12px rgba(0, 51, 102, 0.06);
    position: relative;
    z-index: 100;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.5);
}

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

.logo-img {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text {
    font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-color);
}

.logo-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== New Chat Button ===== */
.new-chat-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 40px);
    margin: 16px 20px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: none;
    border-radius: var(--border-radius);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 10px 20px rgba(0, 51, 102, 0.16), 0 2px 6px rgba(0, 51, 102, 0.08);
}

.new-chat-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-1px);
}

.new-chat-btn svg {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

/* ===== Chat History ===== */
.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
    min-height: 0;
    background: rgba(255, 255, 255, 0.2);
}

.chat-history::-webkit-scrollbar {
    width: 6px;
}

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

.chat-history::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.history-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 8px 8px;
}

.chat-list {
    list-style: none;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 4px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
    position: relative;
}

.chat-item:hover {
    background-color: var(--bg-hover);
    color: var(--accent-color);
    border-color: rgba(0, 51, 102, 0.08);
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.06);
}

.chat-item.active {
    background-color: var(--bg-hover);
    color: var(--accent-color);
    border-color: rgba(0, 51, 102, 0.12);
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.08);
}

.chat-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.chat-item span {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.chat-item-empty {
    align-items: flex-start;
    cursor: default;
}

.chat-item-empty:hover {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    box-shadow: none;
}

.chat-item-empty span {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.55;
}

.chat-item-actions {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.chat-item-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: background var(--transition-speed) ease, opacity var(--transition-speed) ease, color var(--transition-speed) ease;
}

.chat-item:hover .chat-item-menu-btn,
.chat-item.active .chat-item-menu-btn,
.chat-item-menu-btn[aria-expanded="true"] {
    opacity: 1;
    pointer-events: auto;
}

.chat-item-menu-btn:hover {
    background: rgba(0, 51, 102, 0.08);
    color: var(--accent-color);
}

.chat-item-menu-btn svg {
    width: 18px;
    height: 18px;
}

.chat-item-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 132px;
    padding: 6px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 51, 102, 0.1);
    box-shadow: 0 10px 24px rgba(0, 51, 102, 0.12);
    z-index: 12;
}

.chat-item-menu[hidden] {
    display: none;
}

.chat-item-menu button {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--danger-color);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
}

.chat-item-menu button:hover {
    background: rgba(197, 48, 48, 0.08);
}

/* ===== Sidebar Footer ===== */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.5);
}

.user-status {
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    background: rgba(0, 51, 102, 0.06);
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
    border: 1px solid rgba(0, 51, 102, 0.08);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--border-radius);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(0, 51, 102, 0.08);
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.05);
    min-width: 0;
}

.profile-card[hidden] {
    display: none;
}

.profile-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    flex-shrink: 0;
}

.profile-icon svg {
    width: 22px;
    height: 22px;
}

.profile-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-copy strong {
    color: var(--accent-color);
    font-size: 0.92rem;
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-copy span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.4;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-actions[hidden] {
    display: none;
}

.logout-btn[hidden] {
    display: none;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 51, 102, 0.28);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 220;
}

.confirm-overlay[hidden] {
    display: none;
}

.confirm-card {
    width: min(100%, 390px);
    padding: 22px;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid rgba(0, 51, 102, 0.08);
    box-shadow: 0 24px 48px rgba(0, 51, 102, 0.18);
    animation: confirmPopIn 0.18s ease;
}

.confirm-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    color: var(--danger-color);
    background: rgba(197, 48, 48, 0.1);
}

.confirm-icon svg {
    width: 24px;
    height: 24px;
}

.confirm-card h3 {
    font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
    color: var(--accent-color);
    font-size: 1.12rem;
    margin-bottom: 8px;
}

.confirm-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.confirm-btn {
    min-width: 92px;
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, background var(--transition-speed) ease;
}

.confirm-btn:hover {
    transform: translateY(-1px);
}

.confirm-btn.secondary {
    color: var(--accent-color);
    background: rgba(0, 51, 102, 0.08);
}

.confirm-btn.secondary:hover {
    background: rgba(0, 51, 102, 0.12);
}

.confirm-btn.danger {
    color: #ffffff;
    background: linear-gradient(135deg, #c53030, #a32626);
    box-shadow: 0 10px 20px rgba(197, 48, 48, 0.2);
}

@keyframes confirmPopIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
}

.auth-btn svg {
    width: 18px;
    height: 18px;
}

.auth-btn.signup {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 51, 102, 0.16), 0 2px 6px rgba(0, 51, 102, 0.08);
}

.auth-btn.signup:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-1px);
}

.auth-btn.signin {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: var(--accent-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.04);
}

.auth-btn.signin:hover {
    background: linear-gradient(180deg, #f8fbff 0%, #f0f5fa 100%);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.08);
    transform: translateY(-1px);
}

/* ===== Sidebar Back Button (Mobile) ===== */
.sidebar-back-btn {
    display: none;
    width: 42px;
    height: 42px;
    background: rgba(247, 250, 255, 0.96);
    border: 1px solid rgba(0, 51, 102, 0.1);
    color: var(--accent-color);
    cursor: pointer;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease, border-color var(--transition-speed) ease, transform var(--transition-speed) ease;
    flex-shrink: 0;
}

.sidebar-back-btn:hover {
    background: rgba(240, 246, 252, 0.98);
    border-color: rgba(0, 51, 102, 0.16);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.sidebar-back-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== Mobile Overlay ===== */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 51, 102, 0.3);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Chat Area ===== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 80% 20%, rgba(0, 51, 102, 0.03), transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(30, 90, 150, 0.04), transparent 35%),
        linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
    overflow: hidden;
    overflow-x: hidden;
}

/* ===== Chat Header ===== */
.chat-header {
    height: var(--header-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.04);
    flex-shrink: 0;
}

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

.menu-toggle-btn {
    display: none;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 14px;
    background: var(--lcc-blue);
    transition: all var(--transition-speed) ease;
    align-items: center;
    justify-content: center;
}

.menu-toggle-btn:hover {
    background-color: var(--bg-hover);
    color: var(--accent-color);
}

.menu-toggle-btn svg {
    width: 24px;
    height: 24px;
}

.chat-title {
    font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    min-width: 0;
    max-width: min(52vw, 420px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-speed) ease;
}

.header-btn:hover {
    background-color: var(--bg-hover);
    color: var(--accent-color);
}

.header-btn svg {
    width: 30px;
    height: 30px;
}

/* ===== Assistant Chat Section ===== */
.assistant-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

/* ===== Chat Messages ===== */
.chat-messages,
.ai-messages,
.assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    justify-content: flex-start;
    background:
        radial-gradient(circle at top left, rgba(0, 51, 102, 0.12), transparent 18%),
        radial-gradient(circle at bottom right, rgba(30, 90, 150, 0.14), transparent 22%),
        linear-gradient(rgba(0, 51, 102, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 51, 102, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, #dbe6f0 0%, #e5eef6 48%, #edf3f8 100%);
    background-size:
        auto,
        auto,
        42px 42px,
        42px 42px,
        auto;
    color: #1f2937;
    background-attachment: fixed;
}

.chat-messages::-webkit-scrollbar,
.ai-messages::-webkit-scrollbar,
.assistant-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track,
.ai-messages::-webkit-scrollbar-track,
.assistant-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb,
.ai-messages::-webkit-scrollbar-thumb,
.assistant-messages::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover,
.ai-messages::-webkit-scrollbar-thumb:hover,
.assistant-messages::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* ===== AI Message Styles ===== */
.ai-msg {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: min(760px, 84%);
    animation: slideIn 0.3s ease;
    word-break: break-word;
    overflow-wrap: break-word;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.7;
}

.ai-msg.user {
    flex-direction: row-reverse;
    margin-left: auto;
    align-self: flex-end;
    background: linear-gradient(135deg, #0d4d86 0%, #1e5a96 100%);
    color: #ffffff;
    border-bottom-right-radius: 6px;
    /* box-shadow: 0 10px 24px rgba(0, 51, 102, 0.18), 0 4px 12px rgba(0, 51, 102, 0.08); */
}

.ai-msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 51, 102, 0.08);
    border-bottom-left-radius: 6px;
    box-shadow: 0 10px 22px rgba(0, 51, 102, 0.08), 0 4px 12px rgba(0, 51, 102, 0.04);
}

.ai-msg.bot:not(.pending)::before {
    content: "Phinny";
    display: block;
    margin-bottom: 8px;
    color: var(--accent-color);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ai-msg p {
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.ai-msg p + p {
    margin-top: 10px;
}

.ai-msg ul, .ai-msg ol {
    margin: 10px 0;
    padding-left: 24px;
}

.ai-msg li {
    margin-bottom: 6px;
}

.ai-msg strong {
    font-weight: 600;
}

.ai-msg code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.ai-msg pre {
    background: var(--bg-tertiary);
    padding: 14px;
    border-radius: var(--border-radius-sm);
    overflow-x: auto;
    margin: 10px 0;
}

.ai-msg pre code {
    background: none;
    padding: 0;
}

.ai-msg a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

.ai-msg.user a {
    color: #ffffff;
}

/* ===== Pending Message ===== */
.ai-msg.pending {
    display: block;
    align-self: flex-start;
    width: auto;
    max-width: min(220px, calc(100% - 12px));
    opacity: 0.95;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.9);
    border-style: dashed;
    position: relative;
    font-style: normal;
    box-shadow: 0 4px 12px rgba(0, 51, 102, 0.06);
}

.ai-msg.pending::after {
    content: " ...";
    display: inline;
    letter-spacing: 0.08em;
    animation: ai-ellipsis 1s infinite ease-in-out;
}

@keyframes ai-ellipsis {
    0%   { opacity: 0.35; }
    50%  { opacity: 1; }
    100% { opacity: 0.35; }
}

/* ===== Chat Form ===== */
.ai-form,
.assistant-form {
    padding: 16px 24px 24px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 12px rgba(0, 51, 102, 0.04);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: linear-gradient(180deg, #f8fbff 0%, #f4f8fc 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 8px 8px 8px 16px;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(0, 51, 102, 0.04);
}

.form-input-wrapper:focus-within {
    border-color: rgba(0, 51, 102, 0.28);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.08);
}

.chat-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    min-height: 40px;
    max-height: 150px;
    padding: 8px 0;
    overflow-y: hidden;
}

.chat-input::-webkit-scrollbar {
    display: none;
}

.chat-input {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.chat-input::placeholder {
    color: var(--text-secondary);
}

.chat-input:focus {
    outline: none;
}

.send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    border: none;
    border-radius: var(--border-radius-sm);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(0, 51, 102, 0.16), 0 2px 6px rgba(0, 51, 102, 0.08);
}

.send-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    transform: translateY(-1px);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== Input Hint ===== */
.input-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0;
    padding: 0;
    width: 100%;
}

/* ===== Welcome Message ===== */
.welcome-message {
    text-align: center;
    padding: 34px 22px;
    animation: aiWelcomeFadeIn 0.45s ease both;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    margin: auto;
    border-radius: var(--border-radius);
}

.welcome-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: aiWelcomeRise 0.5s ease 0.06s both;
}

.welcome-icon svg {
    width: 36px;
    height: 36px;
}

.welcome-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.welcome-message h2 {
    font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 12px;
    animation: aiWelcomeRise 0.5s ease 0.12s both;
}

.welcome-message p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
    animation: aiWelcomeRise 0.5s ease 0.18s both;
}

.assistant-intro-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.assistant-intro-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 12px;
}

.assistant-prompt-grid {
    width: min(700px, 100%);
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
    animation: aiWelcomeRise 0.5s ease 0.2s both;
}

.assistant-prompt-grid,
.assistant-prompt-grid.assistant-prompt-grid-mini {
    display: grid;
    grid-template-columns: 1fr;
}

.assistant-prompt-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 58px;
    text-align: left;
    padding: 7px 9px;
    border: 1.5px solid rgba(0, 51, 102, 0.3);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.58), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 254, 0.98) 100%);
    box-shadow: 0 10px 24px rgba(0, 51, 102, 0.06);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    animation: aiWelcomeRise 0.45s ease both;
}

.assistant-prompt-card:nth-child(1) {
    animation-delay: 0.24s;
}

.assistant-prompt-card:nth-child(2) {
    animation-delay: 0.3s;
}

.assistant-prompt-card:nth-child(3) {
    animation-delay: 0.36s;
}

.assistant-prompt-card:nth-child(4) {
    animation-delay: 0.42s;
}

.assistant-prompt-card:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 51, 102, 0.38);
    box-shadow: 0 14px 28px rgba(0, 51, 102, 0.09);
}

.assistant-prompt-card::after {
    content: "";
    position: absolute;
    right: -20px;
    top: -20px;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    opacity: 0.08;
    pointer-events: none;
    background: rgba(0, 51, 102, 0.12);
}

.assistant-prompt-card strong {
    display: block;
    color: var(--accent-color);
    font-family: "Sora", "Manrope", "Segoe UI", system-ui, sans-serif;
    font-size: 0.8rem;
    line-height: 1.2;
    margin-bottom: 0;
    text-align: center;
}

.assistant-prompt-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-bottom: 0;
    color: var(--accent-color);
    background: rgba(0, 51, 102, 0.08);
    box-shadow: inset 0 0 0 1px rgba(0, 51, 102, 0.05);
}

.assistant-prompt-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes aiWelcomeFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (min-width: 769px) {
    .assistant-prompt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .assistant-intro-copy {
        width: min(100%, 540px);
        margin: 0 auto;
    }

    .welcome-message p {
        max-width: 540px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== Fullscreen Mode ===== */
body.assistant-chat-open {
    overflow: hidden;
}

.assistant-chat.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: linear-gradient(180deg, #dbe6f0 0%, #e5eef6 48%, #edf3f8 100%);
    height: 100dvh;
    min-height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .assistant-prompt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 14px;
    }

    .assistant-prompt-card {
        gap: 7px;
        min-height: 54px;
        padding: 7px 8px;
        border-radius: 16px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease;
        z-index: 100;
        width: 85%;
        max-width: 320px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-back-btn {
        display: flex;
    }

    .mobile-overlay {
        display: block;
    }

    .menu-toggle-btn {
        display: flex;
    }

    .chat-messages,
    .ai-messages,
    .assistant-messages {
        padding: 16px;
    }

    .ai-form,
    .assistant-form {
        padding: 12px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .chat-header {
        padding: 0 16px;
    }

    .chat-title {
        max-width: min(48vw, 220px);
    }

    .ai-msg,
    .ai-msg.user,
    .ai-msg.bot {
        max-width: 95%;
    }

    .chat-item-menu-btn {
        opacity: 1;
        pointer-events: auto;
    }

    .confirm-card {
        padding: 20px 18px;
        border-radius: 18px;
    }

    .confirm-actions {
        flex-direction: column-reverse;
    }

    .confirm-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .chat-title {
        font-size: 0.95rem;
        max-width: min(44vw, 170px);
    }

    .header-btn {
        width: 36px;
        height: 36px;
    }

    .welcome-message {
        padding: 32px 16px;
    }

    .welcome-icon {
        width: 56px;
        height: 56px;
    }

    .welcome-message h2 {
        font-size: 1.25rem;
    }

    .welcome-message p {
        font-size: 0.9rem;
        max-width: 280px;
    }

    .assistant-intro-copy {
        width: min(100%, 280px);
        margin: 0 auto;
    }

    .assistant-intro-logo {
        width: 46px;
        height: 46px;
        margin-bottom: 10px;
    }

    .assistant-prompt-icon {
        width: 28px;
        height: 28px;
        border-radius: 10px;
    }

    .assistant-prompt-icon svg {
        width: 16px;
        height: 16px;
    }

    .assistant-prompt-card strong {
        font-size: 0.7rem;
        line-height: 1.16;
    }

    .logo-text {
        font-size: 1rem;
    }

    .logo-img {
        width: 36px;
        height: 36px;
    }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}
