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

:root { --ink:#17211b; --muted:#647067; --paper:#f7f8f4; --panel:#fff; --line:#dfe5dc; --accent:#2f6b4f; }
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:'DM Sans',sans-serif; }
.topbar { display:flex; justify-content:space-between; align-items:center; max-width:1240px; margin:auto; padding:16px 24px; border-bottom:1px solid var(--line); }
.brand { color:var(--ink); font:700 14px 'Space Grotesk',sans-serif; letter-spacing:.04em; text-decoration:none; }
nav { display:flex; gap:8px; align-items:center; }
button, .nav-link { border:1px solid var(--line); border-radius:8px; background:var(--panel); color:var(--ink); padding:10px 16px; cursor:pointer; font:600 14px 'DM Sans',sans-serif; text-decoration:none; }
.icon-link { display:inline-flex; align-items:center; gap:7px; }
.icon-link svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.8; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button:hover, .nav-link:hover { border-color:var(--accent); }
.workspace { display:grid; grid-template-columns:240px minmax(0, 1fr); max-width:1240px; margin:auto; }
.sidebar { min-height:calc(100vh - 61px); padding:24px 16px; border-right:1px solid var(--line); }
.sidebar-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; font:700 13px 'Space Grotesk',sans-serif; text-transform:uppercase; letter-spacing:.08em; }
.sidebar-empty { color:var(--muted); font-size:13px; line-height:1.5; }
.sidebar-login { display:inline-block; margin-top:16px; color:var(--accent); font-size:13px; font-weight:700; text-decoration:none; }
.new-chat { width:100%; margin-bottom:18px; background:var(--accent); border-color:var(--accent); color:#fff; }
.history-list { display:flex; flex-direction:column; gap:5px; max-height:calc(100vh - 190px); overflow:auto; }
.history-row { display:flex; align-items:center; gap:3px; }
.history-item { width:100%; padding:10px; border:0; border-radius:8px; background:transparent; color:var(--ink); text-align:left; font-size:13px; font-weight:500; line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.history-item:hover { background:#e7f0e8; border-color:transparent; }
.delete-history { flex:0 0 26px; padding:5px; border:0; background:transparent; color:var(--muted); font-size:18px; line-height:1; }
.delete-history:hover { color:#a33a32; border-color:transparent; }
main { min-width:0; max-width:1180px; margin:auto; padding:0 24px 72px; }
.hero { max-width:820px; margin:84px auto 44px; text-align:center; }
.chat-header { display:flex; justify-content:space-between; align-items:center; max-width:820px; margin:28px auto 0; padding-bottom:18px; border-bottom:1px solid var(--line); }
.chat-header h2 { margin:2px 0 0; font:600 22px 'Space Grotesk',sans-serif; }
.chat-header .eyebrow { margin:0; text-align:left; }
.online-status { color:var(--muted); font-size:12px; }
.online-status i { display:inline-block; width:7px; height:7px; margin-right:6px; border-radius:50%; background:#3d9b67; }
.welcome { max-width:700px; margin:92px auto 52px; text-align:center; }
.welcome-mark { display:grid; place-items:center; width:46px; height:46px; margin:0 auto 18px; border-radius:14px; background:#e7f0e8; color:var(--accent); font-size:24px; }
.welcome h1 { margin:0 0 12px; font:600 clamp(34px,5vw,58px)/1.02 'Space Grotesk',sans-serif; }
.welcome p { max-width:600px; margin:auto; color:var(--muted); font-size:16px; line-height:1.55; }
.eyebrow { margin-bottom:14px; color:var(--accent); font-size:12px; font-weight:700; letter-spacing:.14em; }
.hero h1 { margin:0 0 16px; font:600 clamp(42px,6vw,80px)/.98 'Space Grotesk',sans-serif; }
.hero h1 span { color:var(--accent); }
.hero p { margin:auto; max-width:700px; color:var(--muted); font-size:18px; line-height:1.5; }
.composer { position:sticky; bottom:18px; z-index:3; max-width:820px; margin:34px auto 48px; padding:15px 16px 12px; border:1px solid #cbd8cd; border-radius:14px; background:rgba(255,255,255,.96); box-shadow:0 14px 34px rgba(23,33,27,.12); }
.composer-label { display:flex; justify-content:space-between; margin-bottom:8px; color:var(--muted); font-size:12px; font-weight:700; }
.toggle { display:inline-flex; align-items:center; gap:6px; cursor:pointer; font-weight:600; }
.toggle input { width:auto; accent-color:var(--accent); }
textarea, input { width:100%; border:1px solid var(--line); border-radius:10px; background:var(--panel); color:var(--ink); padding:14px; font:16px 'DM Sans',sans-serif; }
textarea { min-height:120px; resize:vertical; }
.composer textarea { min-height:56px; max-height:180px; resize:vertical; border:0; padding:8px 2px; outline:0; }
.composer-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:5px; color:var(--muted); font-size:12px; }
.composer-footer button { display:flex; align-items:center; gap:10px; padding:9px 12px 9px 15px; }
.composer-footer button b { display:grid; place-items:center; width:21px; height:21px; border-radius:6px; background:rgba(255,255,255,.2); font-size:16px; }
.login-panel { max-width:430px; margin:0 auto; padding:24px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
.login-panel label { display:block; margin:14px 0 6px; font-weight:600; }
.login-panel button { width:100%; margin-top:18px; }
.conversation { max-width:820px; margin:auto; padding-bottom:220px; }
.message:last-child { scroll-margin-bottom:220px; }
.message { display:flex; gap:13px; padding:22px 0; border-bottom:1px solid var(--line); }
.avatar { flex:0 0 32px; display:grid; place-items:center; width:32px; height:32px; border-radius:9px; font-size:10px; font-weight:700; }
.assistant-avatar { background:var(--accent); color:#fff; }
.user-avatar { background:#e5ebe6; color:var(--ink); }
.message-body { min-width:0; flex:1; }
.message-meta { display:flex; align-items:center; gap:9px; margin:2px 0 8px; font-size:14px; }
.message-meta span { color:var(--muted); font-size:11px; font-weight:400; }
.message-content { line-height:1.65; }
.message-content h2, .message-content h3 { margin:16px 0 8px; font-family:'Space Grotesk',sans-serif; }
.message-content ul { margin:8px 0; padding-left:22px; }
.message-content li { margin:5px 0; }
.message-content em { color:var(--muted); }
.sources { margin-top:12px; color:var(--muted); font-size:14px; }
.sources a { color:var(--accent); display:block; margin-top:5px; }
.cards, .admin-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; max-width:820px; margin:40px auto; }
.card, .admin-panel { padding:20px; border:1px solid var(--line); border-radius:12px; background:var(--panel); box-shadow:0 8px 24px rgba(23,33,27,.04); }
.card small { color:var(--accent); font-weight:700; text-transform:uppercase; }
.card p { line-height:1.45; }
.card .suggestion { padding:7px 0; border:0; background:transparent; color:var(--accent); font-size:12px; }
.card .suggestion span { margin-left:5px; font-size:15px; }
.admin-grid { grid-template-columns:1fr 1fr; }
.admin-panel h2 { margin-top:0; font-family:'Space Grotesk',sans-serif; }
.panel-copy { color:var(--muted); font-size:14px; line-height:1.45; }
.panel-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.count-badge, .role-badge { display:inline-flex; align-items:center; justify-content:center; min-width:28px; padding:4px 8px; border-radius:999px; background:#e7f0e8; color:var(--accent); font-size:12px; font-weight:700; }
.user-row { display:flex; align-items:center; justify-content:space-between; gap:12px; border-top:1px solid var(--line); padding:13px 0; }
.user-row strong, .user-row small { display:block; }
.user-row small { margin-top:4px; color:var(--muted); font-size:12px; }
.delete-user { padding:6px 10px; color:#a33a32; font-size:12px; }
.user-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.reset-user { padding:6px 10px; color:var(--accent); font-size:12px; }
.message-area { min-height:20px; margin-top:12px; }
.error { color:#a33a32; margin-top:12px; }
.success { color:var(--accent); margin-top:12px; }
.notice { max-width:820px; margin:20px auto; padding:14px; border:1px solid var(--line); border-radius:8px; color:var(--muted); background:var(--panel); }
@media (max-width:700px) { .topbar, main { padding-left:16px; padding-right:16px; } .workspace { display:block; } .sidebar { min-height:0; border-right:0; border-bottom:1px solid var(--line); padding:14px 16px; } .history-list { max-height:150px; } .hero { margin-top:52px; } .cards, .admin-grid { grid-template-columns:1fr; } .composer-footer { align-items:stretch; flex-direction:column; } .composer-footer button { width:100%; } }
