:root {
    --ink: #123f45; --teal: #07545a; --teal-dark: #063c42; --paper: #fbfaf6;
    --line: #e5e4dc; --shadow: 0 12px 34px rgba(12,55,58,.08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; font-family: "Nirmala UI", "Mangal", Arial, sans-serif; color: #203d40; background: var(--paper); }
body { font-size: 16px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.foundation-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; min-height: 64px; padding: 10px 20px; background: #fff; border-bottom: 1px solid #e7dccb; }
.foundation-brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 280px; }
.foundation-logo { display: block; width: 48px; height: 42px; object-fit: contain; flex-shrink: 0; }
.foundation-name { color: #604126; font-weight: 700; }
.chatbot-home-menu { display: flex; align-items: center; justify-content: flex-end; }
.chatbot-home-menu a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 20px; border: 1px solid #d7b98d; border-radius: 8px; background: #7a3e18; color: #fff7e8; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.chatbot-home-menu a:hover, .chatbot-home-menu a:focus { background: #5e2d12; outline: 2px solid #d7b98d; outline-offset: 2px; }
.hero { text-align: center; padding: 24px 18px 22px; background: linear-gradient(120deg,#06474d,#0a666a); color: #fff; }
.hero-invocation { color: #f4d792; font-size: 19px; }
.hero h1 { margin: 1px 0 2px; font-size: clamp(25px,4vw,34px); line-height: 1.4; }
.hero p { margin: 2px auto 5px; max-width: 800px; color: #e7f1e9; }
.hero span { font-size: 13px; color: #f4d792; }
.app-shell { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 22px; max-width: 1460px; min-height: calc(100vh - 270px); margin: 22px auto; padding: 0 22px; }
.sidebar, .workspace { border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow); }
.sidebar { position: sticky; top: 14px; align-self: start; max-height: calc(100vh - 28px); overflow-y: auto; padding: 18px 17px; }
.mobile-sidebar-head { display: none; }
.sidebar-actions { display: grid; gap: 8px; }
.mobile-conversation-actions { display: none; }
.button { min-height: 44px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; padding: 8px 13px; }
.full-width { width: 100%; }
.button-primary { background: var(--teal); color: #fff; }
.button-primary:hover { background: var(--teal-dark); }
.button-quiet { background: #f6f4ef; color: #5b5143; border-color: #e9e0d2; }
.side-section { margin-top: 22px; padding-top: 16px; border-top: 1px solid #eeeae2; }
.side-section h2 { margin: 0; font-size: 16px; color: var(--ink); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.text-button { border: 0; background: none; color: var(--teal); font-weight: 700; padding: 3px 4px; }
.radio-row { display: flex; align-items: center; gap: 9px; padding: 6px 1px; font-size: 14px; }
.radio-row input, .granth-check input { accent-color: var(--teal); width: 17px; height: 17px; }
.scope-note { margin: 6px 0 8px; font-size: 12px; color: #7a8583; }
.granth-list { display: grid; gap: 2px; max-height: 210px; overflow: auto; padding: 4px 0; }
.granth-check { display: flex; align-items: center; gap: 9px; padding: 5px 1px; font-size: 14px; }
.granth-check input { flex: 0 0 auto; }
.granth-check input:checked + span { color: var(--teal); font-weight: 700; }
.granth-status { display: block; color: #89918d; font-size: 11px; line-height: 1.35; margin-left: auto; text-align: right; }
.compact-section { margin-top: 16px; }
.advanced-options > summary { cursor: pointer; font-size: 16px; font-weight: 700; color: var(--ink); }
.select-control { width: 100%; min-height: 42px; margin-top: 7px; padding: 7px 10px; border: 1px solid #d8dfda; border-radius: 8px; background: #fff; color: #304d4f; }
.switch-row { display: flex; align-items: center; gap: 9px; margin-top: 8px; font-size: 13px; }
.switch-row input { position: absolute; opacity: 0; }
.switch-ui { width: 35px; height: 20px; border-radius: 20px; background: #c7ceca; position: relative; flex: none; }
.switch-ui:after { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: #fff; }
.switch-row input:checked + .switch-ui { background: var(--teal); }
.switch-row input:checked + .switch-ui:after { left: 18px; }
.switch-row input:disabled + .switch-ui { opacity: .65; }
.side-link { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 4px; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; text-align: left; color: #3d5658; }
.side-link:hover, .side-link.active { background: #edf3ef; color: var(--teal-dark); font-weight: 700; }
.count-badge { min-width: 23px; height: 22px; padding: 0 6px; border-radius: 11px; background: #e8eeea; text-align: center; font-size: 12px; }
.clear-history { margin-top: 17px; font-size: 13px; }
.workspace { display: flex; flex-direction: column; min-height: 650px; overflow: hidden; }
.workspace-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid #efeee9; }
.workspace-tools { display: flex; align-items: center; gap: 8px; }
.mobile-control-trigger, .scroll-top-button { display: none; }
.eyebrow { font-size: 12px; color: #8b6b3e; font-weight: 700; }
.workspace-topline h2 { margin: 0; font-size: 21px; color: var(--ink); }
.included-pill { border: 1px solid #dce8df; border-radius: 18px; padding: 5px 11px; background: #f6faf6; color: #416458; font-size: 12px; }
.view-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow: auto; padding: 26px clamp(18px,5vw,70px); }
.welcome-card { max-width: 680px; margin: 7vh auto 30px; text-align: center; }
.welcome-symbol { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; margin: auto; border-radius: 50%; background: #e7f0e8; color: #947139; font-size: 29px; }
.welcome-card h3 { margin: 16px 0 5px; font-size: 23px; color: var(--ink); }
.welcome-card > p { margin: 0 auto 18px; max-width: 590px; color: #627577; }
.build-notice { padding: 12px 14px; border: 1px solid #e6d5ad; border-radius: 9px; background: #fff9e8; color: #6a5838; font-size: 13px; text-align: left; }
.message { max-width: 790px; margin: 0 auto 18px; }
.message-question { margin-left: auto; width: fit-content; max-width: 85%; padding: 11px 15px; border-radius: 14px 14px 3px 14px; background: #eaf2ec; color: #234a49; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-answer { padding: 16px; border: 1px solid #e9e8e0; border-radius: 3px 14px 14px 14px; background: #fff; box-shadow: 0 4px 14px rgba(23,57,58,.04); }
.message-answer .multi-answer-item { margin: 12px 0 0; padding: 13px 14px; border: 1px solid #e3e8e5; border-left: 5px solid var(--granth-accent); border-radius: 9px; background: var(--granth-tint); }
.message-answer .multi-answer-title { display: inline-block; margin: 0 0 10px; padding: 3px 10px; border-radius: 14px; background: var(--granth-accent); color: #fff; font-size: 16px; }
.message-answer .granth-color-1 { --granth-accent: #1f6b70; --granth-tint: #eff8f8; }
.message-answer .granth-color-2 { --granth-accent: #5d5794; --granth-tint: #f5f3fb; }
.message-answer .granth-color-3 { --granth-accent: #92551f; --granth-tint: #fcf6ee; }
.message-answer .multi-answer-error { color: #9a352e; }
.message-answer p { margin: 0 0 10px; }
.message-answer p:last-child { margin-bottom: 0; }
.message-answer .eknath-answer-text > p { margin: 0 0 10px; }
.message-answer .eknath-answer-subheading { margin: 12px 0 5px; color: var(--ink); font-size: 16px; }
.message-answer .answer-bullet { margin: 5px 0; }
.message-answer .reference-heading, .message-answer .source-heading { margin-top: 14px; font-weight: 700; color: var(--ink); }
.message-answer .reference-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 7px 0; }
.message-answer .reference-link { color: var(--teal); text-decoration: underline; }
.message-answer .source-shlok { margin-top: 9px; padding: 10px; border: 1px solid #e7e5dc; border-radius: 8px; background: #fcfbf8; }
.message-answer .source-number { margin-bottom: 5px; color: #78613c; font-size: 12px; font-weight: 700; }
.message-answer .source-text { color: #293e3f; line-height: 1.85; }
.message-answer .refs { display: flex; flex-wrap: wrap; gap: 7px; margin: 7px 0 12px; }
.message-answer .ref { color: var(--teal); text-decoration: underline; }
.message-answer .source { margin: 9px 0; padding: 10px; border: 1px solid #e7e5dc; border-radius: 8px; background: #fcfbf8; }
.message-answer .source-item { margin: 9px 0; padding: 10px; border: 1px solid #e7e5dc; border-radius: 8px; background: #fcfbf8; }
.message-answer .otherworks-reference-item { margin: 9px 0; padding: 10px; border: 1px solid #e7e5dc; border-radius: 8px; background: #fcfbf8; }
.message-answer .source-card { margin-top: 7px; padding: 9px; border: 1px solid #ece9df; border-radius: 7px; background: #fff; }
.message-answer .answer-inline-reference { color: var(--teal); font-size: .9em; font-weight: 700; }
.message-answer .answer-verse-quote { margin-top: 9px; padding: 8px 11px; border-left: 3px solid #c9ae71; background: #fbf8ef; }
.message-answer .answer-verse-reference { color: #687674; font-size: 12px; }
.message-answer .source-meta { margin-bottom: 5px; color: #78613c; font-size: 12px; font-weight: 700; }
.message-answer .reference-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 7px 0 12px; }
.message-answer .reference-link, .message-answer .inline-reference { color: var(--teal); text-decoration: underline; }
.message-answer .answer-card { margin: 10px 0; padding: 12px; border: 1px solid #e7e5dc; border-radius: 10px; background: #fcfbf8; }
.message-answer .answer-title, .message-answer .reference-heading { margin-top: 12px; color: var(--ink); font-weight: 700; }
.demo-label { display: inline-block; margin-bottom: 9px; padding: 3px 8px; border-radius: 12px; background: #fff4d7; color: #735b2d; font-size: 11px; font-weight: 700; }
.message-actions { display: flex; gap: 8px; margin-top: 9px; }
.small-action { border: 1px solid #e6e5de; border-radius: 6px; background: #fff; padding: 4px 9px; color: #53696b; font-size: 12px; }
.composer-wrap { padding: 14px clamp(14px,4vw,46px) 15px; border-top: 1px solid #eeece5; background: #fff; }
.composer { display: flex; align-items: flex-end; gap: 10px; max-width: 930px; margin: auto; padding: 9px 10px 9px 15px; border: 1px solid #cfdcd6; border-radius: 14px; box-shadow: 0 4px 16px rgba(24,74,69,.06); }
.composer:focus-within { border-color: #6b9b8d; box-shadow: 0 0 0 3px rgba(59,126,109,.12); }
.composer textarea { width: 100%; min-height: 46px; max-height: 160px; resize: vertical; border: 0; outline: 0; color: #203d40; background: transparent; }
.composer textarea::placeholder { color: #899795; }
.send-button { width: 41px; height: 41px; flex: none; border: 0; border-radius: 11px; background: var(--teal); color: #fff; font-size: 25px; line-height: 1; }
.send-button:hover { background: var(--teal-dark); }
.send-button:disabled { opacity: .62; cursor: wait; }
.composer-meta { display: flex; justify-content: space-between; max-width: 930px; margin: 5px auto 0; color: #7d8987; font-size: 11px; }
.notice { margin: 12px 20px 0; padding: 9px 12px; border-radius: 8px; background: #eef5ef; color: #345f4f; font-size: 13px; }
.error-notice { background: #fff0ed; color: #873d2e; }
.list-view { padding: 22px clamp(16px,4vw,40px); overflow: auto; }
.list-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 13px; }
.list-heading h3 { margin: 0; color: var(--ink); }
.empty-state { margin: auto; text-align: center; color: #74817d; padding: 48px 15px; }
.history-card, .saved-card { margin-bottom: 11px; padding: 15px; border: 1px solid #e8e7df; border-radius: 10px; background: #fff; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { margin: 0; color: #254a4a; font-weight: 700; }
.card-preview, .card-meta { margin: 5px 0 0; color: #76817d; font-size: 13px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.external-research { margin-top: 16px; padding: 13px; border-left: 3px solid #c79b55; background: #fbf8f1; border-radius: 7px; }
.external-research h3 { margin: 0 0 8px; color: #5f553e; font-size: 15px; }
.external-research a { color: #315c75; overflow-wrap: anywhere; }
.style-supplement { margin-top: 14px; padding: 12px; border-left: 3px solid #5c8878; background: #f3f8f5; border-radius: 7px; }
.style-supplement h3 { margin: 0 0 7px; color: #315c54; font-size: 14px; }
.card-button { min-height: 44px; border: 1px solid var(--teal); border-radius: 8px; background: var(--teal); padding: 8px 13px; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.card-button:hover { background: var(--teal-dark); }
.card-button.danger { border-color: #a96754; background: #fff; color: #8b4b39; }
.card-button.danger:hover { background: #faf0ec; }
.card-button:focus-visible { outline: 2px solid var(--teal-dark); outline-offset: 2px; }
.status-chip { display: inline-block; padding: 2px 8px; border-radius: 11px; background: #f3f0e6; color: #806c42; font-size: 11px; }
.site-footer { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; padding: 16px 10px; border-top: 1px solid #ddd; background: #fafafa; color: #666; font-size: 13px; }
.site-footer a { color: #7a421f; font-weight: 700; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.sidebar-backdrop[hidden] { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 900px) { .app-shell { grid-template-columns: 255px minmax(0,1fr); gap: 13px; padding: 0 14px; } .sidebar { padding: 15px 12px; } .workspace { min-height: 620px; } }
@media (max-width: 680px) {
    .workspace { overflow: clip; }
    .sidebar .sidebar-actions { display: none; }
    .workspace-topline { flex-wrap: wrap; }
    .mobile-conversation-actions { display: grid; flex: 0 0 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .mobile-conversation-actions .button { font-size: 13px; padding-inline: 6px; }
    .mobile-history-button { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; }
    .mobile-history-button.active { border-color: var(--teal); }
    .foundation-header { padding: 9px 14px; gap: 8px; } .foundation-brand { flex-basis: 210px; gap: 9px; } .foundation-logo { width: 42px; height: 36px; } .foundation-name { font-size: 13px; }
    .chatbot-home-menu a { min-height: 40px; padding: 7px 12px; } .hero { padding: 19px 15px; } .hero p { font-size: 14px; }
    .app-shell { display: flex; flex-direction: column; margin: 13px auto; padding: 0 11px; } .sidebar { display: none; position: fixed; z-index: 62; top: 12px; right: 12px; bottom: 12px; left: 12px; width: auto; max-height: none; overflow-y: auto; padding: 13px; box-shadow: 0 18px 55px rgba(0,0,0,.25); } .app-shell.mobile-controls-open .sidebar { display: block; } .mobile-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: -13px; z-index: 2; margin: -13px -13px 8px; padding: 12px 13px; background: #fff; border-bottom: 1px solid #eeeae2; color: var(--ink); } .sidebar-backdrop:not([hidden]) { display: block; position: fixed; z-index: 61; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(16,34,35,.48); } body.sidebar-drawer-open { overflow: hidden; } .sidebar-actions { grid-template-columns: 1fr 1fr; }
    .side-section { margin-top: 14px; padding-top: 12px; } .advanced-options > .side-section { display: inline-block; vertical-align: top; width: 49%; padding-right: 8px; }
    .advanced-options + .side-section { margin-top: 12px; } .granth-list { max-height: 150px; } .workspace { min-height: 560px; }
    .workspace-topline { position: sticky; top: 0; z-index: 5; align-items: flex-start; padding: 12px 14px; background: #fff; } .workspace-topline h2 { font-size: 18px; } .workspace-tools { flex-wrap: wrap; justify-content: flex-end; } .mobile-control-trigger, .scroll-top-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 5px 9px; border: 1px solid #d8e3dc; border-radius: 8px; background: #f7faf7; color: #315c54; font-size: 12px; font-weight: 700; } .scroll-top-button[hidden] { display: none; } .included-pill { max-width: 48%; text-align: center; }
    .messages { padding: 17px 13px; } .welcome-card { margin: 5vh auto 24px; } .welcome-card h3 { font-size: 20px; }
    .site-footer { gap: 5px; flex-direction: column; }
}
@media (max-width: 390px) {
    .foundation-name { max-width: 160px; font-size: 12px; } .chatbot-home-menu a { font-size: 12px; padding: 6px 9px; }
    .sidebar-actions { grid-template-columns: 1fr; } .advanced-options > .side-section { width: 100%; display: block; }
    .workspace-topline { flex-direction: row; } .workspace-tools { max-width: 58%; } .included-pill { max-width: 100%; } .composer-meta { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
