@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --ink: #10172e;
    --ink-2: #182344;
    --ink-3: #27345a;
    --paper: #f7f7f8;
    --card: #ffffff;
    --line: #e3e6ed;
    --muted: #71809e;
    --soft: #a9b4ca;
    --acid: #c8f38b;
    --coral: #ff836f;
    --blue: #8fb5ff;
    --shadow: 0 16px 45px rgba(16, 23, 46, .08);
    --radius-lg: 22px;
    --radius-md: 15px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(143, 181, 255, .75); outline-offset: 3px; }

.app-shell { display: flex; width: 100%; min-height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar {
    width: 256px;
    flex: 0 0 256px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 18px 13px 16px;
    color: #eef2ff;
    background:
        radial-gradient(circle at 15% 0%, rgba(200, 243, 139, .10), transparent 28%),
        var(--ink);
}
.sidebar-top { display: grid; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 3px 8px; }
.brand-mark { position: relative; display: inline-flex; width: 27px; height: 27px; align-items: center; justify-content: center; transform: rotate(-12deg); }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ''; position: absolute; width: 13px; height: 13px; border: 2px solid var(--acid); border-radius: 4px; }
.brand-mark::before { transform: translate(-4px, -4px); opacity: .95; }
.brand-mark::after { transform: translate(4px, 4px); border-color: var(--coral); opacity: .9; }
.brand-mark span:nth-child(1) { transform: translate(0, 0); border-color: #f1f5ff; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { display: none; }
.brand-name { font-family: Manrope, sans-serif; font-size: 16px; font-weight: 800; letter-spacing: -.03em; }
.new-chat {
    display: flex; align-items: center; gap: 9px; width: 100%; border: 0; border-radius: 13px; padding: 12px 12px;
    color: var(--ink); background: var(--acid); font-size: 13px; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease;
}
.new-chat:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(200, 243, 139, .18); }
.new-chat-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: rgba(16, 23, 46, .13); font-size: 18px; line-height: 1; }
.shortcut { margin-left: auto; color: rgba(16, 23, 46, .52); font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 500; }
.history-label { margin: 25px 9px 9px; color: #8795b5; font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.conversation-list { display: grid; gap: 4px; min-height: 40px; overflow: auto; }
.conversation-item {
    display: block; width: 100%; overflow: hidden; border: 0; border-radius: 10px; padding: 10px 11px; color: #bcc7de; background: transparent;
    text-align: left; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; transition: background .18s ease, color .18s ease;
}
.conversation-item:hover, .conversation-item.active { color: #fff; background: rgba(255, 255, 255, .09); }
.empty-history { padding: 10px 9px; color: #7483a5; font-size: 12px; line-height: 1.5; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 15px; padding-top: 26px; }
.catalog-status { display: flex; gap: 9px; align-items: center; padding: 12px; border: 1px solid rgba(255, 255, 255, .10); border-radius: 13px; background: rgba(255, 255, 255, .045); }
.status-dot, .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 0 4px rgba(200, 243, 139, .12); }
.catalog-status strong, .catalog-status small { display: block; }
.catalog-status strong { color: #ecf1ff; font-size: 11px; font-weight: 700; }
.catalog-status small { margin-top: 3px; color: #8290af; font-size: 10px; }
.sidebar-note { padding: 0 9px; color: #6f7e9e; font-size: 10px; line-height: 1.5; }

.sidebar-scrim { display: none; }
.chat-area { position: relative; display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 100%; height: 100%; background: var(--paper); }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 14px clamp(18px, 5vw, 74px); border-bottom: 1px solid rgba(223, 228, 239, .78); background: rgba(247, 247, 248, .90); }
.topbar-title { display: grid; gap: 3px; }
.eyebrow { color: var(--coral); font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.topbar-heading { color: var(--ink); font-family: Manrope, sans-serif; font-size: 15px; font-weight: 800; letter-spacing: -.04em; }
.topbar-chip { display: inline-flex; align-items: center; gap: 9px; color: #657390; font-size: 11px; }
.topbar-chip .pulse { width: 6px; height: 6px; }
.mobile-menu { display: none; width: 34px; height: 34px; place-items: center; border: 1px solid transparent; border-radius: 9px; color: var(--ink); background: transparent; font-size: 19px; line-height: 1; }
.mobile-menu:hover { border-color: var(--line); background: #fff; }
.chat-scroll { width: 100%; flex: 1; overflow-y: auto; padding: clamp(26px, 5vh, 58px) clamp(18px, 5vw, 74px) 220px; }
.welcome, .messages { width: min(100%, 780px); margin: 0 auto; }
.welcome { padding: 8px 0 30px; }
.welcome-orbit { position: relative; display: grid; width: 62px; height: 62px; margin-bottom: 20px; place-items: center; }
.orbit-core { position: relative; z-index: 2; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(16, 23, 46, .12); border-radius: 12px; color: var(--ink); background: #fff; font-family: Manrope, sans-serif; font-size: 17px; font-weight: 800; box-shadow: var(--shadow); }
.orbit-line { position: absolute; inset: 0; border: 1px solid rgba(143, 181, 255, .45); border-radius: 50%; transform: rotate(24deg); }
.orbit-line::after { content: ''; position: absolute; top: 7px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); }
.orbit-line-a { transform: rotate(24deg) scaleX(.56); }
.orbit-line-b { transform: rotate(-38deg) scaleY(.56); border-color: rgba(200, 243, 139, .78); }
.orbit-line-b::after { top: auto; right: auto; bottom: 8px; left: 11px; background: var(--acid); }
.welcome-kicker { margin: 0 0 13px; color: var(--coral); font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.welcome h1 { max-width: 620px; margin: 0; color: var(--ink); font-family: Manrope, sans-serif; font-size: clamp(32px, 4.8vw, 52px); font-weight: 800; letter-spacing: -.07em; line-height: 1.02; }
.welcome h1 em { color: #7084b7; font-style: normal; }
.welcome-copy { max-width: 520px; margin: 18px 0 28px; color: #71809e; font-size: 14px; line-height: 1.6; }
.starter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-width: 680px; }
.starter-card { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; min-height: 62px; border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; color: var(--ink); background: rgba(255, 255, 255, .70); text-align: left; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.starter-card:hover { border-color: #b4c2df; box-shadow: 0 9px 24px rgba(16, 23, 46, .07); transform: translateY(-2px); }
.starter-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: var(--ink); background: #e6f6c8; font-size: 16px; }
.starter-card:nth-child(2) .starter-icon { background: #ffe0d8; }
.starter-card:nth-child(3) .starter-icon { background: #e0ebff; }
.starter-card:nth-child(4) .starter-icon { background: #ece4ff; }
.starter-card strong, .starter-card small { display: block; }
.starter-card strong { font-size: 12px; font-weight: 700; }
.starter-card small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.25; }
.arrow { color: #90a0c0; font-size: 16px; }

.messages { display: grid; gap: 18px; }
.message-row { display: flex; gap: 10px; align-items: flex-start; animation: enter .24s ease both; }
.message-row.user { justify-content: flex-end; }
.message-avatar { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-family: Manrope, sans-serif; font-size: 10px; font-weight: 800; }
.message-row.user .message-avatar { order: 2; color: #fff; border-color: var(--ink); background: var(--ink); }
.message-content { max-width: min(88%, 690px); }
.message-label { margin: 2px 0 6px; color: #92a0bb; font-family: 'DM Mono', monospace; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.message-row.user .message-label { text-align: right; }
.message-bubble { border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 13px 15px; color: #2b3755; background: var(--card); box-shadow: 0 5px 16px rgba(16, 23, 46, .035); font-size: 14px; line-height: 1.58; }
.message-row.user .message-bubble { border: 0; border-radius: 16px 4px 16px 16px; color: #f6f7ff; background: var(--ink-2); box-shadow: none; }
.message-bubble p { margin: 0 0 10px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble strong { color: var(--ink); font-weight: 700; }
.message-row.user .message-bubble strong { color: #fff; }
.typing-bubble { display: inline-flex; align-items: center; gap: 4px; min-width: 65px; }
.typing-bubble span { width: 5px; height: 5px; border-radius: 50%; background: #9ba9c2; animation: blink 1s infinite ease-in-out; }
.typing-bubble span:nth-child(2) { animation-delay: .12s; }.typing-bubble span:nth-child(3) { animation-delay: .24s; }
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.suggestion { border: 1px solid #d4dced; border-radius: 999px; padding: 8px 11px; color: #536586; background: transparent; font-size: 11px; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.suggestion:hover { border-color: var(--coral); color: var(--ink); background: #fff; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.product-card { display: grid; grid-template-columns: 68px 1fr; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 13px; padding: 8px; background: #fbfcff; }
.product-image { width: 68px; height: 68px; overflow: hidden; border-radius: 9px; background: #edf1f8; }
.product-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-image.no-image { display: grid; place-items: center; color: #99a6bc; font-family: 'DM Mono', monospace; font-size: 9px; }
.product-details { min-width: 0; padding: 2px 2px 1px 0; }
.product-sku { margin-bottom: 4px; color: var(--coral); font-family: 'DM Mono', monospace; font-size: 9px; font-weight: 500; }
.product-name { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 700; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: #7d8aa5; font-size: 10px; }
.product-price { color: var(--ink); font-family: Manrope, sans-serif; font-size: 11px; font-weight: 800; }
.product-promo { color: #5c8f2a; font-size: 9px; font-weight: 700; }
.product-select { margin-top: 8px; border: 1px solid #cfd8e8; border-radius: 7px; padding: 5px 8px; color: #536586; background: #fff; font-size: 10px; font-weight: 700; }
.product-select:hover { border-color: var(--coral); color: var(--ink); }
.quote-card { margin-top: 14px; overflow: hidden; border: 1px solid var(--ink); border-radius: 16px; color: #fff; background: var(--ink); }
.quote-heading { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.quote-heading strong { color: #fff; font-family: Manrope, sans-serif; font-size: 13px; }
.quote-heading span { color: var(--acid); font-family: 'DM Mono', monospace; font-size: 9px; text-transform: uppercase; }
.quote-table { padding: 12px 16px 4px; }
.quote-line, .quote-total { display: flex; justify-content: space-between; gap: 15px; padding: 7px 0; font-size: 11px; }
.quote-line { color: #acb9d4; }.quote-line strong { color: #eff3ff; font-weight: 500; }.quote-total { margin-top: 5px; border-top: 1px solid rgba(255,255,255,.13); padding-top: 12px; color: #fff; font-family: Manrope, sans-serif; font-size: 16px; font-weight: 800; }.quote-total small { display: block; margin-top: 3px; color: #92a0bb; font-family: 'DM Sans', sans-serif; font-size: 9px; font-weight: 400; }.quote-note { margin: 7px 16px 16px; color: #8997b6; font-size: 10px; line-height: 1.45; }
.lead-panel { display: grid; gap: 10px; margin-top: 13px; padding: 15px; border: 1px solid #d8dfec; border-radius: 15px; background: #f8faff; }
.lead-panel p { margin: 0 0 2px; color: #6e7c98; font-size: 11px; line-height: 1.45; }
.lead-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lead-fields input { min-width: 0; border: 1px solid #d3dbea; border-radius: 9px; padding: 9px 10px; color: var(--ink); background: #fff; font-size: 11px; }
.lead-submit { justify-self: start; border: 0; border-radius: 9px; padding: 10px 13px; color: var(--ink); background: var(--acid); font-size: 11px; font-weight: 800; }

.composer-wrap { position: absolute; right: 0; bottom: 28px; left: 0; padding: 0 clamp(18px, 5vw, 74px); background: linear-gradient(180deg, rgba(247,247,248,0), rgba(247,247,248,.95) 24%, var(--paper) 62%); }
.composer-hint { display: flex; align-items: center; gap: 7px; width: min(100%, 780px); margin: 0 auto 7px; color: #8896b2; font-family: 'DM Mono', monospace; font-size: 9px; }
.hint-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--coral); }
.composer { width: min(100%, 780px); margin: 0 auto; border: 1px solid #cbd3e2; border-radius: 19px; padding: 11px 11px 9px 15px; background: rgba(255,255,255,.96); box-shadow: 0 10px 28px rgba(16,23,46,.08); }
.composer textarea { display: block; width: 100%; max-height: 130px; min-height: 25px; resize: none; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; line-height: 1.5; }
.composer textarea::placeholder { color: #9aa6bc; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 7px; }
.composer-help { color: #adb7c9; font-size: 10px; }
.send-button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 10px; color: var(--ink); background: var(--coral); font-size: 21px; line-height: 1; transition: transform .18s ease, opacity .18s ease; }
.send-button:not(:disabled):hover { transform: translateY(-2px) rotate(-3deg); }
.send-button:disabled { cursor: default; opacity: .38; }
.legal-line { width: min(100%, 780px); margin: 8px auto 0; color: #a2aec2; text-align: center; font-size: 9px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 4; max-width: 320px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; color: var(--ink); background: #fff; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }

@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

@media (max-width: 900px) {
    .sidebar { width: 240px; flex-basis: 240px; }
    .chat-scroll { padding-right: 28px; padding-left: 28px; }
    .topbar { padding-right: 28px; padding-left: 28px; }
    .composer-wrap { padding-right: 28px; padding-left: 28px; }
}
@media (max-width: 700px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; z-index: 11; top: 0; bottom: 0; left: 0; width: min(86vw, 300px); transform: translateX(-102%); transition: transform .24s ease; box-shadow: 14px 0 40px rgba(16, 23, 46, .2); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-scrim { position: fixed; z-index: 10; inset: 0; display: block; border: 0; padding: 0; background: rgba(16, 23, 46, .28); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
    .sidebar-scrim.visible { opacity: 1; visibility: visible; pointer-events: auto; }
    .mobile-menu { display: grid; }
    .topbar { gap: 12px; padding: 14px 18px; }
    .topbar-title { margin-right: auto; }
    .topbar-chip { display: none; }
    .chat-area { min-height: 100vh; height: 100dvh; }
    .chat-scroll { padding: 26px 17px 220px; }
    .welcome h1 { font-size: clamp(34px, 11vw, 52px); }
    .welcome-copy { font-size: 14px; }
    .starter-grid, .product-grid { grid-template-columns: 1fr; }
    .composer-wrap { bottom: 16px; padding: 0 14px; }
    .composer-hint { margin-bottom: 6px; }
    .composer-help { display: none; }
    .legal-line { line-height: 1.4; }
    .message-content { max-width: 88%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
