/* Shakarim brand. Gold is decorative on white; gold text only on brand blue. */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-secondary); outline-offset: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
button:disabled { cursor: not-allowed; opacity: .55; }
.app-shell { display: block; }
.app-header { position: fixed; inset: 0 auto 0 0; width: 238px; height: 100dvh; padding: 32px 18px 20px; background: var(--brand-blue); color: white; display: flex; flex-direction: column; align-items: stretch; gap: 0; margin: 0; border: 0; border-radius: 0; }
.header-left { flex-direction: row; align-items: center; gap: 10px; padding: 0 2px 22px; }
.brand-logo { width: 48px; height: 68px; padding: 0; border-radius: 0; background: transparent; box-shadow: none; object-fit: contain; flex-shrink: 0; }
.brand-name { color: white; letter-spacing: .08em; font-size: 16px; line-height: 1.4; }
.brand-name span { display: block; color: #E0E5ED; font-size: 9px; letter-spacing: .04em; margin-top: 3px; }
.app-nav { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; overflow: auto; flex: 1; padding: 0; gap: 5px; width: 100%; }
.app-nav .nav-item { color: #E0E5ED; border-radius: 8px; min-height: 43px; font-size: 12px; font-weight: 500; gap: 12px; padding: 10px 14px; }
.app-nav .nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.app-nav .nav-item:hover { color: white; background: #405174; }
.app-nav .nav-item.active { color: var(--brand-gold); background: #324266; box-shadow: inset 0 0 0 1px #829BB3; border-left: 3px solid var(--brand-gold); padding-left: 11px; }
.nav-new { margin-left: auto; font-size: 10px; letter-spacing: .04em; }
.nav-group-label { color: #D0D0CE; font-size: 9px; letter-spacing: .13em; padding: 28px 14px 8px; }
.header-actions { flex-direction: column; gap: 8px; padding: 20px 8px; border-bottom: 1px solid #6A829C; }
.header-actions .header-btn { width: 100%; justify-content: flex-start; font-size: 12px; border-color: #6A829C; border-radius: 8px; color: white; background: transparent; gap: 10px; }
.header-actions .primary { background: #405174; }
.app-main { display: block; margin-left: 238px; width: calc(100% - 238px); max-width: none; padding: 0 36px 36px; }
.workspace-topbar { height: 72px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary); font-size: 10px; letter-spacing: .14em; margin-bottom: 30px; }
.workspace-label { display: flex; align-items: center; gap: 8px; letter-spacing: 0; font-size: 11px; }
.workspace-label svg { width: 15px; height: 15px; }
.agent-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 28px; }
.eyebrow { font-size: 9px; font-weight: 600; letter-spacing: .16em; color: var(--text-secondary); }
.agent-heading h1 { font-size: clamp(25px, 2.6vw, 38px); letter-spacing: -.055em; font-weight: 600; line-height: 1.3; margin: 8px 0; }
.agent-heading h1 > span { color: var(--brand-blue); border-bottom: 3px solid var(--brand-gold); }
.agent-heading p { font-size: 12px; color: var(--text-secondary); }
.agent-heading > .btn { background: white; border-color: var(--border-strong); font-size: 11px; flex-shrink: 0; }
.btn { border-radius: 8px; }
.agent-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 24px; align-items: start; }
.agent-workspace { min-width: 0; border: 1px solid var(--border-strong); border-radius: 14px; background: white; box-shadow: 0 6px 24px #32426605; overflow: hidden; }
.agent-workspace-bar { border-bottom: 1px solid var(--border); padding: 17px 22px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.agent-workspace-bar > span:first-child { display: flex; gap: 8px; align-items: center; font-weight: 600; }
#agent-provider { font-size: 10px; color: var(--text-secondary); max-width: 45%; text-align: right; overflow-wrap: anywhere; }
.agent-dot { width: 6px; height: 6px; background: var(--brand-gold); border-radius: 50%; display: inline-block; flex-shrink: 0; }
.agent-setup { margin: 16px 22px 0; border: 1px solid var(--brand-gray); border-left: 3px solid var(--brand-gold); border-radius: 6px; padding: 12px; display: flex; gap: 10px; background: #FAF9F4; font-size: 11px; }
.agent-setup svg { width: 16px; flex-shrink: 0; }
.agent-setup p { color: var(--text-secondary); font-size: 10px; margin: 4px 0 0; line-height: 1.65; }
.agent-messages { padding: 28px; max-height: 640px; overflow-y: auto; scroll-behavior: smooth; min-height: 360px; }
.agent-welcome { text-align: center; padding: 8px 0 6px; }
.agent-symbol { width: 54px; height: 54px; border-radius: 15px; background: var(--brand-blue); color: var(--brand-gold); display: grid; place-items: center; margin: 0 auto 22px; transform: rotate(-6deg); }
.agent-symbol svg { width: 25px; height: 25px; transform: rotate(6deg); }
.agent-welcome h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.17; letter-spacing: -.035em; font-weight: 400; margin: 12px 0; }
.agent-welcome > p { font-size: 11px; color: var(--text-secondary); line-height: 1.8; }
.agent-prompts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 28px auto 0; max-width: 580px; }
.agent-prompts button { position: relative; padding: 16px 30px 15px 16px; border: 1px solid var(--border); border-radius: 9px; background: white; text-align: left; color: var(--text); transition: border-color .15s, background .15s; }
.agent-prompts button:hover { border-color: var(--brand-secondary); background: #F8F9FA; }
.agent-prompts svg { width: 17px; height: 17px; color: var(--brand-secondary); margin-bottom: 10px; display: block; }
.agent-prompts strong { display: block; font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.agent-prompts span { font-size: 9px; color: var(--text-secondary); display: block; }
.agent-prompts b { position: absolute; right: 14px; top: 15px; color: var(--brand-secondary); font-weight: 400; }
.agent-composer { margin: 10px 22px 0; border: 1px solid var(--brand-gray); border-radius: 10px; background: #FDFDFC; padding: 14px; }
.agent-composer:focus-within { border-color: var(--brand-secondary); box-shadow: 0 0 0 2px #4B688512; }
.agent-composer textarea { width: 100%; display: block; border: 0; outline: none; resize: vertical; max-height: 180px; min-height: 52px; background: transparent; font-size: 12px; line-height: 1.6; padding: 0; }
.agent-composer textarea::placeholder { color: var(--brand-secondary); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; }
.composer-actions > div { display: flex; gap: 6px; }
.composer-actions .btn { padding: 8px 12px; font-size: 11px; }
.composer-actions .btn svg { width: 15px; height: 15px; }
.web-toggle { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-secondary); cursor: pointer; }
.web-toggle svg { width: 13px; height: 13px; }
.web-toggle input { accent-color: var(--brand-blue); }
.agent-footnote { text-align: center; color: var(--text-secondary); font-size: 9px; padding: 12px 18px 16px; }
.research-rail { display: flex; flex-direction: column; gap: 20px; }
.rail-block { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 19px; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.rail-heading h2 { font-size: 12px; font-weight: 600; }
.rail-heading > span { font-size: 10px; background: var(--accent-soft); padding: 2px 7px; border-radius: 4px; }
.rail-heading > svg { width: 14px; height: 14px; color: var(--text-secondary); }
.rail-empty { text-align: center; padding: 30px 6px 16px; }
.rail-empty > svg { width: 26px; height: 26px; color: var(--brand-secondary); stroke-width: 1.2; margin-bottom: 12px; }
.rail-empty p { font-size: 11px; font-weight: 500; margin-bottom: 7px; }
.rail-empty span, .rail-note { color: var(--text-secondary); font-size: 10px; line-height: 1.8; }
.rail-note { padding-top: 16px; }
.research-note { padding: 22px 20px; border-radius: 10px; background: var(--brand-beige); }
.research-note > span { font-size: 8px; letter-spacing: .12em; font-weight: 600; }
.research-note p { font-family: Georgia, serif; font-size: 20px; line-height: 1.45; margin: 14px 0; }
.note-line { width: 32px; height: 3px; background: var(--brand-blue); }
.export-button { width: 100%; background: transparent; font-size: 11px; }
.export-button svg { width: 14px; }
.agent-message { text-align: left; padding: 0 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.agent-message:last-child { margin-bottom: 0; }
.agent-message-label { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 600; margin-bottom: 12px; letter-spacing: .04em; }
.agent-message-label > span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; background: var(--brand-blue); color: var(--brand-gold); }
.agent-message.user .agent-message-label > span { background: var(--accent-soft); color: var(--brand-blue); }
.agent-message-content { font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.agent-message-content p { margin: 0 0 10px; white-space: pre-wrap; }
.agent-message-content h3 { font-size: 15px; margin: 18px 0 8px; }
.agent-message-content li { margin: 5px 0 5px 20px; }
.agent-message-content a { text-decoration: underline; }
.citation-button { display: inline; padding: 0 4px; border-radius: 3px; border: 0; color: var(--brand-blue); background: var(--accent-soft); font-size: 10px; }
.agent-steps { background: #F7F8FA; border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; margin: 10px 0; font-size: 11px; }
.agent-steps summary { cursor: pointer; font-weight: 500; }
.agent-steps ol { padding: 8px 0 0 18px; color: var(--text-secondary); font-size: 10px; }
.agent-steps li { padding: 4px 0; }
.agent-progress { display: flex; align-items: center; gap: 8px; margin: 0 24px 8px; font-size: 11px; color: var(--text-secondary); }
.agent-progress .agent-dot { animation: agent-pulse 1.2s infinite alternate; }
@keyframes agent-pulse { to { opacity: .3; } }
.source-card { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 11px; overflow-wrap: anywhere; }
.source-card:last-child { border: 0; padding-bottom: 0; }
.source-card:target { border-left: 3px solid var(--brand-gold); padding-left: 8px; }
.source-ref { color: var(--text-secondary); font-size: 9px; display: block; margin-bottom: 6px; }
.source-card strong { display: block; font-weight: 500; line-height: 1.6; }
.source-card a { text-decoration: underline; text-underline-offset: 3px; }
.source-card small { display: block; font-size: 9px; color: var(--text-secondary); margin-top: 6px; }
#agent-sources { max-height: 530px; overflow: auto; }
.history-item { display: block; background: transparent; border: 0; border-bottom: 1px solid var(--border); padding: 12px 0; width: 100%; color: var(--text-secondary); font-size: 11px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item[aria-current=true] { color: var(--text); font-weight: 600; }
.agent-error { padding: 12px; background: #FAF9F4; border-left: 3px solid var(--brand-gold); border-radius: 5px; font-size: 12px; }
.agent-usage { font-size: 10px; color: var(--text-secondary); padding-top: 12px; }
.panel, .stat-card { border: 1px solid var(--border); }
.stat-icon { color: var(--brand-blue) !important; background: var(--accent-soft) !important; }
@media (min-width: 1600px) { .app-main { padding-left: 60px; padding-right: 60px; } .agent-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; } .agent-messages { padding: 40px; } .agent-welcome { padding: 20px 0; } }
@media (max-width: 1200px) { .app-header { width: 205px; padding-left: 12px; padding-right: 12px; } .app-main { margin-left: 205px; width: calc(100% - 205px); padding-left: 24px; padding-right: 24px; } .agent-layout { grid-template-columns: minmax(0,1fr) 220px; gap: 16px; } .agent-messages { padding: 22px; } .agent-heading h1 { font-size: 29px; } .agent-heading > .btn { padding: 9px; } }
@media (max-width: 1000px) { .agent-layout { grid-template-columns: minmax(0,1fr); } .research-rail { display: grid; grid-template-columns: 1fr 1fr; } .research-note { display: none; } .export-button { grid-column: 1 / -1; } }
@media (max-width: 700px) {
    .app-header { position: relative; width: 100%; height: auto; padding: 18px 16px 10px; }
    .header-left { padding: 0 0 16px; }.brand-name { display: block; font-size: 15px; }.brand-name span { font-size: 9px; }
    .app-nav { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }.app-nav .nav-item { min-height: 36px; font-size: 11px; flex-shrink: 0; }
    .nav-group-label, .nav-new { display: none; }
    .header-actions { position: absolute; right: 14px; top: 16px; padding: 0; border: 0; flex-direction: row; }
    .header-actions .header-btn { width: 34px; height: 34px; padding: 8px; }.header-actions .btn-label { display: none; }
    .app-main { margin: 0; width: 100%; padding: 0 14px 24px; }.workspace-topbar { height: 45px; margin-bottom: 22px; font-size: 8px; }.workspace-label { font-size: 9px; }
    .agent-heading { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 18px; }.agent-heading h1 { font-size: 30px; }.agent-heading p { font-size: 11px; }
    .agent-heading > .btn { font-size: 10px; }.agent-workspace-bar { padding: 14px; }.agent-messages { padding: 22px 14px; max-height: 560px; }
    .agent-welcome h2 { font-size: 30px; }.agent-prompts { gap: 8px; margin-top: 24px; }.agent-prompts button { padding: 14px 18px 14px 12px; }.agent-prompts strong { font-size: 10px; }.agent-prompts span { font-size: 9px; }
    .agent-composer { margin: 8px 12px 0; padding: 10px; }.composer-actions { align-items: flex-end; }.web-toggle { font-size: 9px; gap: 4px; }.web-toggle svg { display: none; }.composer-actions .btn { font-size: 10px; padding: 8px; }.agent-footnote { font-size: 8px; }
    .agent-setup { margin: 12px; }.research-rail { grid-template-columns: 1fr; gap: 12px; }.rail-block { padding: 16px; }.agent-progress { margin-left: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
