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

:root {
    /* Try these for a lighter "Medium Slate/Brown" feel: */
  --bg: #2c313a;       /* Lightened by another ~10% */
  --surface: #353b45;  /* The sidebar and chat container */
  --surface2: #3e4451; /* The input area box */
  --border: #373e47; 
  --accent: #e8a44a; 
  --accent2: #c47f25;
  --text: #adbac7; 
  --text-bright: #f0f6fc;
  --muted: #768390; 
  --user-bg: #214478;
  --bot-bg: #2d333b; 
  --radius: 12px;
}

body { 
    font-family: 'DM Sans', sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    /* Increased base font size by ~10% */
    font-size: 17px; 
    min-height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden;
}

/* Subtle grain texture */
body::before { 
    content: ''; position: fixed; inset: 0; pointer-events: none; opacity: 0.03; z-index: 0; 
    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'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

header { 
    padding: 1.5rem 2.5rem; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    border-bottom: 1px solid var(--border); 
    background: rgba(26,31,38,0.9); 
    backdrop-filter: blur(10px); 
    position: relative; 
    z-index: 10; 
}

.logo { display: flex; align-items: center; gap: 0.8rem; }
.logo-icon { 
    width: 42px; height: 42px; 
    background: linear-gradient(135deg, var(--accent), var(--accent2)); 
    border-radius: 10px; 
    display: flex; align-items: center; justify-content: center; 
    font-weight: 700; color: #0d1117; font-size: 1.2rem;
}
.logo-text { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--text-bright); }
.logo-text span { color: var(--accent); }

/* Grid Layout to fill screen and reduce whitespace */
main { 
    max-width: 1400px; 
    width: 100%;
    margin: 1.5rem auto; 
    padding: 0 2rem; 
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem; 
    position: relative; 
    z-index: 1; 
    flex: 1; 
}

.panel-left { display: flex; flex-direction: column; gap: 1.5rem; }
.panel-card { 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    padding: 1.5rem; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.panel-card h3 { 
    font-size: 0.85rem; 
    color: var(--text-bright); 
    text-transform: uppercase; 
    letter-spacing: 1.2px; 
    margin-bottom: 1.2rem; 
}

.drop-zone { 
    border: 2px dashed var(--border); 
    border-radius: 10px; 
    padding: 2.5rem 1rem; 
    text-align: center; 
    cursor: pointer; 
    transition: 0.2s; 
    position: relative;
    background: rgba(255,255,255,0.01);
}
.drop-zone:hover { border-color: var(--accent); background: rgba(232,164,74,0.03); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.example-list { list-style: none; }
.example-list li { 
    margin-bottom: 12px; 
    color: var(--muted); 
    cursor: pointer; 
    transition: 0.2s; 
    font-size: 0.95rem; 
}
.example-list li:hover { color: var(--accent); transform: translateX(8px); }

.btn-process { 
    width: 100%; 
    margin-top: 1rem; 
    padding: 1rem; 
    background: linear-gradient(135deg, var(--accent), var(--accent2)); 
    color: #000; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 700; 
    font-size: 1rem; 
}

.panel-right { 
    background: var(--surface); 
    border: 1px solid var(--border); 
    border-radius: var(--radius); 
    display: flex; 
    flex-direction: column; 
    min-height: 700px; 
    box-shadow: 0 4px 25px rgba(0,0,0,0.3);
}

#chat-log { flex: 1; overflow-y: auto; padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }

.msg { display: flex; gap: 1rem; max-width: 90%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-bubble { 
    padding: 1.2rem 1.5rem; 
    border-radius: 14px; 
    font-size: 1.05rem; 
    line-height: 1.6; 
    word-wrap: break-word; 
    color: var(--text-bright); 
}
.msg.bot .msg-bubble { background: var(--bot-bg); border: 1px solid var(--border); }
.msg.user .msg-bubble { background: var(--user-bg); }

.chat-input-area { padding: 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 1rem; }
#questionInput { 
    flex: 1; 
    background: var(--surface2); 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    color: var(--text-bright); 
    padding: 1rem; 
    resize: none; 
    outline: none; 
    font-size: 1rem; 
    height: 60px; 
}
.btn-ask { 
    background: linear-gradient(135deg, var(--accent), var(--accent2)); 
    color: #000; 
    border: none; 
    border-radius: 10px; 
    padding: 0 2rem; 
    cursor: pointer; 
    font-weight: 700; 
    font-size: 1rem; 
}

/* Mobile responsive optimization */
@media (max-width: 900px) {
    main { grid-template-columns: 1fr; padding: 0 1rem; }
    .panel-left { width: 100%; }
    header { padding: 1rem; }
}