:root{--navy:#182d58;--teal:#1ebcae;--mint:#a5e4df;--pale:#edf8f7;--ink:#202736;--muted:#6b7382;--line:#e5e9ee;--paper:#f7f9fb;--reader-font:'Noto Naskh Arabic',serif;--reader-size:22px;color-scheme:light;font-family:'Readex Pro',sans-serif;color:var(--ink);font-size:14px;font-weight:400;line-height:1.8}
*{box-sizing:border-box}body{margin:0;background:var(--paper)}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}a{color:var(--navy);text-decoration:none}button{color:inherit}h1,h2,h3,p{margin-top:0}h1,h2,h3{color:var(--navy);font-weight:500;line-height:1.5}h1{font-size:32px}h2{font-size:21px}h3{font-size:17px}p{margin-bottom:14px}svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}input,select,textarea{color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:9px;padding:11px 13px;outline:none;min-width:0}input:focus,textarea:focus,select:focus{border-color:#73979e;box-shadow:0 0 0 3px #1ebcae13}:focus-visible{outline:3px solid #4b75a3;outline-offset:3px}button:focus-visible,a:focus-visible{border-radius:6px}input::placeholder,textarea::placeholder{color:#8f96a2;font-weight:300}button{border:0}select{max-width:100%}[hidden]{display:none!important}.muted{color:var(--muted)}.eyebrow{font-size:12px;color:#468b87;letter-spacing:.01em;display:block;margin-bottom:12px}.field-note{font-size:11px;color:var(--muted);line-height:1.9}.button{display:inline-flex;justify-content:center;align-items:center;gap:10px;border-radius:9px;padding:11px 19px;min-height:43px;border:1px solid transparent;font-weight:400;font-size:13px;transition:background .15s,box-shadow .15s}.primary{background:var(--navy);color:white}.primary:hover{background:#244373;box-shadow:0 3px 12px #182d5814}.secondary{background:white;border-color:var(--line);color:var(--navy)}.secondary:hover{background:var(--paper)}.full{width:100%}.compact{font-size:11px;padding:7px 12px;min-height:34px}.icon-button{padding:8px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;background:transparent;color:var(--muted);min-width:36px;min-height:36px}.icon-button:hover{background:#eaf0f3;color:var(--navy)}.brand{display:flex;align-items:center;gap:11px;color:var(--navy);white-space:nowrap}.brand>span{font-size:26px;font-weight:500;letter-spacing:-1px}.brand small{font-size:12px;font-weight:400;letter-spacing:0;display:inline-block;vertical-align:middle;margin-inline-start:4px}.brand img{display:block}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.skip-link{position:fixed;top:-100px;background:var(--navy);color:white;padding:12px;z-index:100}.skip-link:focus{top:8px}.text-link{color:#3b7878;background:none;font-size:12px;padding:4px}.text-link:hover{text-decoration:underline}
/* Entrance */
.auth-shell{min-height:100dvh;display:grid;grid-template-columns:1fr 1fr;background:#fff}.auth-form-side{display:flex;flex-direction:column;padding:42px clamp(28px,6.3vw,112px) 24px;min-width:0}.auth-form-side>.brand{align-self:flex-start}.auth-form-wrap{width:100%;max-width:390px;margin:auto;padding:50px 0}.auth-form-wrap h2{font-size:26px;margin-bottom:10px}.auth-form-wrap>.muted{font-size:12px;margin-bottom:30px;line-height:2}.auth-form{display:flex;flex-direction:column;gap:8px}.auth-form label{font-size:12px;margin-top:7px}.auth-form input{width:100%;min-height:46px}.auth-form button{margin-top:16px}.auth-form p{margin:4px 0}.auth-form p label{display:block;margin-bottom:8px}.auth-switch{text-align:center;font-size:12px;margin:24px 0 0;color:var(--muted)}.auth-switch a{font-weight:500;margin-inline-start:4px}.auth-note{text-align:center;font-size:10px;color:var(--muted);margin:24px 0 0;line-height:2}.auth-footer{display:flex;justify-content:space-between;color:#8991a0;font-size:10px;gap:15px}.auth-art{position:relative;overflow:hidden;background:linear-gradient(145deg,#142c49 0%,#1c535f 62%,#419b97 150%);color:#fff;padding:64px;display:flex;flex-direction:column;justify-content:center;isolation:isolate}.art-copy{position:relative;z-index:1}.art-copy .overline{color:#a5e4df;font-size:12px}.art-copy h1{font-family:'Noto Naskh Arabic',serif;font-size:clamp(45px,4.5vw,72px);color:white;line-height:1.55;font-weight:400;margin:30px 0 24px}.art-copy p{color:#c8dddd;font-size:13px;font-weight:300;line-height:2.3}.art-rule{width:55px;height:2px;background:#5ebbb0;margin:38px 0 22px}.art-features{display:flex;align-items:center;gap:16px;font-size:10px;color:#c8dddd}.art-features i{width:3px;height:3px;background:#78b6ae;border-radius:50%}.art-foot{position:absolute;bottom:30px;font-size:10px;color:#81a5ab}.art-pattern{position:absolute;width:660px;height:660px;left:-280px;top:-160px;opacity:.11;transform:rotate(22.5deg);border:1px solid #a5e4df;border-radius:80px}.art-pattern:before,.art-pattern:after{content:'';position:absolute;inset:45px;border:1px solid #a5e4df;transform:rotate(45deg);border-radius:55px}.art-pattern:after{inset:100px;transform:rotate(90deg)}.errorlist,.form-error{list-style:none;margin:3px 0;padding:8px 12px;color:#9d3f3f;background:#fff2f1;border-radius:6px;font-size:11px}.back-link{display:block;margin-top:24px;font-size:12px}.auth-form .helptext{font-size:10px;color:var(--muted)}.auth-form .helptext ul{padding-inline-start:20px}
/* Workspace */
.app-shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100dvh}.sidebar{position:sticky;top:0;height:100dvh;border-inline-end:1px solid var(--line);background:#fff;display:flex;flex-direction:column;padding:29px 18px 15px;z-index:20}.sidebar>.brand{padding:0 9px 28px}.sidebar .brand>span{font-size:25px}.new-research{background:var(--navy);color:#fff;width:100%;justify-content:flex-start;padding:11px 13px;margin-bottom:0;box-shadow:0 3px 6px #182d5810}.new-chat-plus{margin-inline-start:auto;display:inline-flex;align-items:center;justify-content:center;flex:none;width:28px;height:28px;color:#fff;background:#ffffff14;border:1px solid #ffffff30;border-radius:8px}.new-chat-plus svg{display:block;width:20px;height:20px;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}.nav-item{display:flex;align-items:center;gap:11px;width:100%;background:none;text-align:start;padding:11px 13px;margin-bottom:6px;border-radius:8px;color:#626d7d;font-size:12px;min-height:43px}.nav-item svg{width:19px;height:19px}.nav-item:hover{background:var(--paper)}.nav-item.active{background:var(--pale);color:var(--navy);font-weight:500}.nav-item.active svg{color:#309b92}.nav-badge{margin-inline-start:auto;font-size:10px;color:#77858c;background:#eff2f5;border-radius:5px;padding:0 6px}.history-head{display:flex;align-items:center;justify-content:space-between;margin:20px 11px 7px;color:#959da9;font-size:10px}.history-head .icon-button{min-height:28px;padding:5px}.history-head svg{width:15px;height:15px}.history{overflow:auto;flex:1;min-height:70px}.history-item{width:100%;background:none;padding:9px 12px;text-align:start;border-radius:7px;color:#6a7380;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-item:hover,.history-item.current{background:var(--paper);color:var(--navy)}.sidebar-empty{font-size:10px;color:#a3aab4;padding:10px 12px}.sidebar-bottom{padding-top:16px}.collection-note{display:flex;align-items:center;gap:7px;font-size:9px;color:#7a8493;padding:12px 8px 17px;border-bottom:1px solid var(--line);margin-bottom:12px}.status-dot{width:6px;height:6px;border-radius:50%;background:#4cad99}.profile-button{display:flex;gap:10px;align-items:center;width:100%;text-align:start;background:none;padding:5px 6px}.avatar{width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#edf2f5;color:var(--navy);font-size:14px;flex-shrink:0}.profile-button b{font-size:11px;font-weight:400;max-width:120px;overflow:hidden;text-overflow:ellipsis;display:block;white-space:nowrap}.profile-button small{font-size:9px;color:#929aa5;display:block}.profile-button>svg{margin-inline-start:auto;width:18px;height:18px}.app-main{min-width:0;display:flex;flex-direction:column}.topbar{height:75px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 36px;gap:15px;background:#ffffff9c}.topbar-title{display:flex;align-items:center;gap:15px;font-size:12px;color:#505c70}.subtle-divider{height:15px;border-right:1px solid #dae0e7}.version-tag{font-size:9px;color:#8a94a2}.top-library{display:flex;align-items:center;gap:9px;background:white;border:1px solid var(--line);padding:7px 12px;border-radius:8px;color:#6a7787;font-size:10px}.top-library svg{width:16px;height:16px}.top-library .small-icon{width:12px;height:12px;color:#a1a9b2}.menu-toggle{display:none}#main{flex:1;min-height:0;outline:none}.view{width:100%}.chat-view{max-width:1000px;margin:auto;min-height:calc(100dvh - 116px);padding:0 45px;display:flex;flex-direction:column}.welcome{text-align:center;margin:auto 0;padding:65px 0 50px}.welcome-mark{width:53px;height:53px;border:1px solid #dcece8;background:linear-gradient(140deg,#fff,#e9f5f3);border-radius:15px;display:flex;align-items:center;justify-content:center;margin:0 auto 25px;box-shadow:0 3px 7px #23404404}.welcome-mark svg{width:26px;height:26px;color:#2e8a80}.welcome .eyebrow{font-size:10px;margin-bottom:12px}.welcome h1{font-family:'Noto Naskh Arabic',serif;font-weight:500;font-size:42px;margin:0 0 12px;letter-spacing:-.6px}.welcome-description{color:#8a929f;line-height:2.1;font-size:12px;font-weight:300}.suggestions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin:40px auto 0;max-width:728px}.suggestions>button{position:relative;text-align:start;background:#fff;border:1px solid var(--line);border-radius:11px;padding:17px 16px;min-width:0;transition:transform .15s,border-color .15s}.suggestions>button:hover{transform:translateY(-3px);border-color:#a6c9c6}.suggestion-icon{display:flex;color:#597183;margin-bottom:15px}.suggestion-icon svg{width:20px;height:20px}.suggestions strong{display:block;font-size:12px;font-weight:400;color:#36445d;margin-bottom:4px}.suggestions button>span:not(.suggestion-icon){color:#929aa6;font-size:10px;font-weight:300}.suggestions button>svg{position:absolute;top:19px;left:12px;width:13px;height:13px;color:#b0b9c3}.composer-area{width:100%;max-width:780px;margin:0 auto;padding:0 0 22px;text-align:center}.composer{border:1px solid #dce4eb;background:#fff;border-radius:14px;padding:17px 17px 12px;box-shadow:0 5px 18px #182d5805;text-align:start}.composer:focus-within{border-color:#9bbab9}.composer textarea{display:block;width:100%;resize:none;border:0;box-shadow:none;padding:0 1px;font-size:13px;line-height:1.9;min-height:53px;max-height:160px;background:none}.composer-bottom{display:flex;align-items:center;gap:10px;margin-top:13px}.scope-chip{display:inline-flex;align-items:center;gap:7px;font-size:9px;border:1px solid #e8ecef;padding:4px 8px;border-radius:6px;color:#7a8594;background:#fafbfc}.scope-chip svg{width:13px;height:13px}.composer-spacer{flex:1}.composer-bottom>small{font-size:9px;color:#abb2bc;white-space:nowrap}.send-button{background:var(--navy);color:#fff;width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center}.send-button:hover{background:#36557c}.send-button svg{width:17px;height:17px}.composer-note{font-size:9px;color:#9ba3ad;margin:12px 0 0}.chat-status{font-size:11px;color:#728493;text-align:start;padding:0 5px 10px}.chat-status:empty{display:none}.app-footer{height:40px;display:flex;align-items:center;justify-content:space-between;padding:0 35px;font-size:9px;color:#a4acb6}.conversation-heading{display:flex;gap:4px;align-items:center;padding:35px 0 15px}.conversation-heading h1{font-size:18px;flex:1;margin:0;overflow-wrap:anywhere}.messages{padding:8px 0 30px}.message{padding:23px 0;border-bottom:1px solid var(--line)}.message:last-child{border:0}.message-label{display:flex;align-items:center;gap:9px;font-size:11px;font-weight:500;color:var(--navy);margin-bottom:12px}.message-label img{width:24px;height:24px}.user-question{background:#ebf0f5;border:1px solid #e4eaf0;border-radius:11px;padding:16px 20px;color:#3c4d67;font-size:13px;white-space:pre-wrap;overflow-wrap:anywhere;line-height:2}.answer-body{font-size:13px;line-height:2.2;overflow-wrap:anywhere;color:#354258}.answer-body p{margin:0 0 13px}.answer-body h3{font-size:15px;margin:15px 0 8px}.citation{display:inline-flex;align-items:center;justify-content:center;min-width:23px;height:24px;border-radius:5px;padding:1px 5px;margin:0 2px;background:#ddf0ec;color:#245a68;font-size:10px;vertical-align:baseline}.citation:hover{background:#bde5df}.message-sources{display:flex;gap:6px;flex-wrap:wrap;margin-top:15px}.source-chip{border:1px solid var(--line);border-radius:6px;background:#fff;color:#587380;font-size:10px;padding:5px 9px}.message-tools{display:flex;gap:12px;align-items:center;color:#99a2ad;font-size:9px;margin-top:13px}.message-status{font-size:12px;color:#7b8390;padding:14px;border-radius:9px;background:#f0f3f7}.message-status.failed{background:#fff3ec;color:#965c41}.processing-dot{display:inline-block;width:6px;height:6px;background:#4f9c91;border-radius:50%;margin-inline-end:8px;animation:pulse 1.6s infinite}@keyframes pulse{50%{opacity:.25}}
/* Sources and library */
.content-view{max-width:1110px;margin:auto;padding:46px 48px 70px}.page-intro{margin-bottom:30px}.page-intro h1{font-size:28px;margin-bottom:9px}.page-intro>p{color:#88919d;font-size:12px}.page-intro .eyebrow{font-size:10px;margin-bottom:7px}.search-box{border:1px solid var(--line);background:#fff;border-radius:12px;overflow:hidden}.search-line{display:flex;align-items:center;gap:14px;padding:15px}.search-line>svg{margin-inline-start:7px;color:#8995a4}.search-line input{border:0;flex:1;min-width:0;box-shadow:none;padding:8px 0}.search-line .button{min-width:80px}.search-filters{border-top:1px solid #edf0f3;background:#fafbfc;display:flex;gap:30px;padding:12px 20px}.search-filters label{display:flex;align-items:center;gap:10px;font-size:10px;color:#8d96a3}.search-filters select{font-size:10px;border:0;padding:4px 8px;color:#53687a;background:#f0f4f7;max-width:240px}.result-summary{display:flex;justify-content:space-between;font-size:11px;color:#8c96a3;margin:23px 2px 14px}.result-card{background:#fff;border:1px solid var(--line);border-radius:11px;padding:22px 24px;margin-bottom:12px}.result-meta{display:flex;gap:12px;color:#8a98a5;font-size:9px;margin-bottom:8px}.result-card h3{font-size:15px;margin-bottom:10px}.result-card>p{font-family:var(--reader-font);font-size:20px;color:#5a6677;line-height:1.85}.result-card .result-actions{display:flex;align-items:center;justify-content:space-between;margin-top:15px}.result-actions .text-link{font-size:10px}.result-actions code{font-size:10px;color:#a0a9b3;direction:ltr}.load-more{display:flex;margin:24px auto}.empty-state{border:1px dashed #d9e1e7;padding:40px 25px;text-align:center;border-radius:12px;color:#8b96a3;font-size:12px;line-height:2}.empty-state svg{display:block;margin:0 auto 12px;width:32px;height:32px;color:#93a6af}.book-overview{display:flex;gap:35px;padding:30px;border:1px solid var(--line);border-radius:13px;background:#fff;margin:0 0 35px}.book-cover{width:160px;height:215px;flex-shrink:0;padding:13px;background:linear-gradient(120deg,#275762,#183748);border-radius:3px 10px 10px 3px;border-inline-start:7px solid #32616c;color:#dfede2;box-shadow:-7px 8px 17px #1b3e5217}.book-cover-frame{border:1px solid #9caf8461;text-align:center;min-height:100%;padding:19px 5px 9px;position:relative}.book-cover small{font-size:8px;color:#b5c7b6}.book-cover b{display:block;font-family:'Noto Naskh Arabic',serif;font-size:25px;font-weight:500;line-height:1.7;margin:15px 0 0}.book-cover span{font-family:'Noto Naskh Arabic',serif;font-size:12px;color:#bdcebe}.cover-ornament{color:#b7c198;font-size:17px;margin-top:9px}.book-info{min-width:0;padding:5px 0}.book-info h2{font-size:23px;margin:8px 0 3px}.book-info>p{font-size:11px;color:#8b96a3;margin-bottom:12px}.book-info>.muted{max-width:430px;line-height:2}.pill{display:inline-block;background:#ecf7f2;color:#55927f;border:1px solid #dfefe5;font-size:9px;border-radius:5px;padding:2px 8px}.book-stats{display:flex;gap:24px;font-size:10px;color:#909aa7;margin:16px 0 21px}.book-stats b{font-size:16px;font-weight:500;color:#536678;margin-inline-end:4px}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:20px}.section-heading h2{font-size:18px;margin:0}.filter-input{font-size:11px;width:230px;padding:9px 12px}.lesson-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.lesson-card{display:flex;flex-direction:column;min-height:130px;border:1px solid var(--line);border-radius:10px;padding:17px 18px;background:#fff;text-align:start}.lesson-card:hover{border-color:#a6c9c6}.lesson-card .lesson-no{font-size:9px;color:#9ca5b0;margin-bottom:7px}.lesson-card h3{font-size:12px;line-height:1.8;font-weight:400;flex:1;margin-bottom:15px}.lesson-card footer{display:flex;align-items:center;justify-content:space-between;font-size:9px;color:#8ca0a7}.lesson-card footer svg{width:13px;height:13px}.settings-view{max-width:850px}.settings-card{border:1px solid var(--line);background:#fff;border-radius:12px;padding:25px 28px;margin-bottom:18px}.settings-card h2{font-size:16px;margin-bottom:19px}.settings-card>.muted{font-size:11px}.account-line{display:flex;gap:15px;align-items:center;margin-bottom:20px}.avatar.large{width:46px;height:46px;font-size:20px}.account-line b{font-size:13px;font-weight:400}.account-line p{font-size:11px;color:#8d98a6;margin:2px 0 0}.preference-fields{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin:20px 0}.preference-fields label{display:flex;flex-direction:column;gap:8px;color:#768393;font-size:11px}.preference-fields select{font-size:12px}.range-line{display:flex;align-items:center;gap:14px}.range-line input{width:100%;padding:9px 0;accent-color:#2e8881}.reading-sample{font-family:var(--reader-font);font-size:var(--reader-size);padding:20px;background:#f5f8fa;border-radius:8px;color:var(--navy);line-height:2.2}.usage-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin-bottom:15px}.usage-stat{padding:15px 0;border-inline-end:1px solid var(--line)}.usage-stat:last-child{border:0}.usage-stat strong{font-size:22px;font-weight:400;display:block;color:#4b667a}.usage-stat span{font-size:10px;color:#919caa}.about-footer{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#93a1ad}
/* Reader */
dialog{color:var(--ink);border:1px solid var(--line);padding:0;background:#fff;box-shadow:0 20px 80px #182d5830}dialog::backdrop{background:#172c494d;backdrop-filter:blur(2px)}.source-dialog{position:fixed;inset:0 auto 0 0;margin:0;width:min(650px,100vw);max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0 16px 16px 0;overflow:hidden}.source-dialog[open]{display:flex;flex-direction:column}.source-header{display:flex;align-items:flex-start;gap:15px;justify-content:space-between;padding:25px 28px 19px;border-bottom:1px solid var(--line)}.source-header h2{font-size:18px;line-height:1.8;margin:0 0 4px}.source-header .eyebrow{font-size:10px;margin-bottom:4px}.source-toolbar{display:flex;align-items:center;gap:12px;padding:12px 28px;border-bottom:1px solid var(--line);background:#fbfcfd}.source-toolbar svg{width:14px;height:14px}.source-legend{display:flex;align-items:center;gap:5px;font-size:9px;color:#8797a0;margin-inline-start:auto}.source-legend i{width:8px;height:8px;background:#b9e4dc;border-radius:2px}.source-content{overflow:auto;overscroll-behavior:contain;flex:1;min-height:0;padding:24px 28px;scroll-behavior:smooth}.source-unit{font-family:var(--reader-font);font-size:var(--reader-size);line-height:2.1;padding:10px 13px;margin:0 0 12px;white-space:pre-wrap;overflow-wrap:anywhere;color:#3b4c60;border-inline-start:2px solid #e8edef}.source-unit.core{background:#edf8f5;border-inline-start:3px solid #5aa89a;border-radius:7px;color:#234951}.unit-label{font-family:'Readex Pro',sans-serif;font-size:9px;display:block;color:#8a9ba6;margin-bottom:4px;line-height:1.8}.source-unit.core .unit-label{color:#5b998d}.unit-speech{font-family:'Readex Pro',sans-serif;display:block;font-size:10px;color:#808393}.source-table{width:100%;border-collapse:collapse;font-family:var(--reader-font);font-size:var(--reader-size);margin:12px 0}.source-table td{border:1px solid var(--line);padding:10px;vertical-align:top}.source-bottom{padding:16px 28px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:15px;font-size:10px;color:#8c9aa5}.source-bottom button{font-size:11px}.small-dialog{padding:26px;width:390px;max-width:calc(100vw - 32px);border-radius:12px}.small-dialog h2{font-size:18px}.small-dialog input{width:100%}.dialog-actions{display:flex;gap:9px;margin-top:20px}.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--navy);color:#fff;padding:11px 22px;border-radius:9px;box-shadow:0 7px 25px #182d5820;font-size:12px;z-index:100;max-width:calc(100vw - 32px);text-align:center}
@media(min-width:1450px){.chat-view{max-width:1080px;padding:0 75px}.welcome{padding-top:85px}.welcome h1{font-size:47px}.suggestions{margin-top:46px}.welcome-description{font-size:13px}.composer-area{padding-bottom:36px}}
@media(min-width:761px) and (max-height:820px){.welcome{padding:28px 0 26px}.welcome-mark{margin-bottom:15px;width:46px;height:46px}.welcome h1{font-size:37px}.welcome .eyebrow{margin-bottom:7px}.suggestions{margin-top:24px}.suggestions>button{padding:13px 15px}.suggestion-icon{margin-bottom:9px}.composer-area{padding-bottom:10px}}
@media(max-width:1100px){.app-shell{grid-template-columns:218px minmax(0,1fr)}.sidebar{padding:25px 13px 14px}.chat-view{padding:0 28px}.content-view{padding:35px 28px 60px}.topbar{padding:0 25px}.lesson-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.suggestions{gap:9px}.suggestions>button{padding:16px 12px}.suggestions strong{font-size:11px}.suggestions button>span:not(.suggestion-icon){font-size:9px}.auth-art{padding:45px}.auth-form-side{padding:35px 45px 24px}}
@media(max-width:760px){.app-shell{display:block}.sidebar{position:fixed;right:0;width:255px;transform:translateX(100%);transition:transform .2s;box-shadow:-10px 0 50px #182d581c}.sidebar.open{transform:translateX(0)}.sidebar-shade{position:fixed;inset:0;background:#182d5855;z-index:19}.menu-toggle{display:flex}.topbar{padding:0 15px;height:63px;gap:5px}.topbar-title{gap:8px}.subtle-divider{display:none}.top-library{font-size:9px;gap:6px;padding:6px 8px}.version-tag{display:none}.chat-view{padding:0 20px;min-height:calc(100dvh - 105px)}.welcome{padding:55px 0 35px}.welcome h1{font-size:36px}.welcome-description{font-size:11px}.welcome-mark{margin-bottom:20px}.suggestions{margin-top:28px;grid-template-columns:1fr;gap:8px}.suggestions>button{display:grid;grid-template-columns:32px 1fr 20px;gap:2px 8px;padding:12px 15px}.suggestion-icon{grid-row:1/3;margin:0;align-items:center}.suggestions strong{grid-column:2;font-size:12px;margin:0}.suggestions button>span:not(.suggestion-icon){grid-column:2;font-size:10px}.suggestions button>svg{position:static;grid-column:3;grid-row:1/3;align-self:center}.composer-area{padding-bottom:16px}.composer{padding:14px 13px 11px}.composer textarea{font-size:13px}.scope-chip{font-size:8px;padding:4px 6px}.composer-bottom>small{font-size:8px}.composer-bottom{gap:7px}.composer-note{font-size:8px}.app-footer{padding:0 21px;font-size:8px}.content-view{padding:32px 20px 45px}.page-intro h1{font-size:25px}.page-intro>p{font-size:11px}.search-line{gap:9px;padding:11px}.search-line>svg{width:17px;margin:0}.search-line input{font-size:12px}.search-line .button{font-size:11px;padding:8px 13px;min-width:57px}.search-filters{gap:14px;padding:11px 13px;flex-wrap:wrap}.search-filters label{gap:5px;font-size:9px}.search-filters select{max-width:185px;font-size:10px}.result-card{padding:18px}.book-overview{padding:20px;gap:22px;align-items:center}.book-cover{width:110px;height:162px;padding:9px;border-inline-start-width:5px}.book-cover-frame{padding:10px 4px 7px}.book-cover small{font-size:6px}.book-cover b{font-size:20px;margin-top:10px}.book-cover span{font-size:9px}.cover-ornament{font-size:11px;margin-top:2px}.book-info{padding:0}.book-info h2{font-size:17px}.book-info>p{font-size:9px}.book-info>.muted{display:none}.book-stats{gap:12px;font-size:8px;margin:10px 0}.book-stats b{font-size:14px}.book-info .button{font-size:9px;padding:7px 11px;min-height:34px}.book-info .button svg{width:14px;height:14px}.section-heading{flex-wrap:wrap}.section-heading h2{font-size:16px}.filter-input{width:190px;font-size:10px}.lesson-card{padding:14px;min-height:127px}.lesson-card h3{font-size:11px}.lesson-card .lesson-no{font-size:8px}.settings-card{padding:22px 20px}.preference-fields{gap:15px;grid-template-columns:1fr}.usage-stat strong{font-size:18px}.source-dialog{border-radius:0}.source-header{padding:20px}.source-toolbar{padding:12px 20px}.source-content{padding:20px}.source-bottom{padding:13px 20px}.source-legend{font-size:8px}.auth-shell{grid-template-columns:1fr}.auth-art{display:none}.auth-form-side{padding:30px 27px 24px;min-height:100dvh}.auth-form-wrap{padding:45px 0;max-width:400px}.auth-form-wrap h2{font-size:25px}.auth-form-side>.brand{margin-inline:auto}.auth-form-wrap>.eyebrow{text-align:center}.auth-form-wrap>h2{text-align:center}.auth-form-wrap>.muted{text-align:center}.auth-footer{max-width:400px;width:100%;margin-inline:auto}.conversation-heading{padding-top:25px}.conversation-heading h1{font-size:16px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
.source-paragraph{margin:0 0 12px;white-space:pre-wrap}.source-paragraph:last-child{margin-bottom:0}
@media(max-width:760px){.sidebar{box-shadow:none}.sidebar.open{box-shadow:-10px 0 50px #182d581c}}
/* Keep a single remaining suggestion centered after removing browsing shortcuts. */
.suggestions:has(> button:only-child){grid-template-columns:1fr;max-width:340px}

/* Profile controls share the site's typography; only source reading metrics vary. */
.settings-view{max-width:920px}.settings-card{padding:28px 32px}.settings-card h2{font-size:18px}
.account-line b{font-size:16px}.account-line p{font-size:14px;overflow-wrap:anywhere}.account-line>div{min-width:0}
.account-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.account-links .button{padding:10px 8px;min-width:0}
.preference-fields{gap:26px}.preference-fields label{font-size:14px;color:var(--ink)}.range-line input{min-height:44px;cursor:pointer}.range-line output{min-width:32px;color:var(--navy)}
.settings-view .button{min-height:48px;font-size:14px}.reading-preview{margin-top:24px;padding-top:24px;border-top:1px solid var(--line)}.reading-sample{margin:0}
.source-unit,.source-table,.reading-sample{line-height:var(--reader-line-height,2.1);font-family:'Noto Naskh Arabic',serif}
.account-actions{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap}.danger-outline{border-color:#e7b5b0;color:#a32920;background:#fff}.danger-outline:hover{background:#fff4f2}
#preferences-status{font-size:13px;margin:12px 0 0;color:#286e65}#preferences-status[data-state=failure]{color:#b42318}.settings-notice{padding:14px 18px;background:#edf8f5;color:#286e65;border-radius:8px}
.usage-stat span{font-size:12px;color:#657386}.usage-stat strong{font-size:23px}.usage-grid>.field-note{grid-column:1/-1}
@media(max-width:600px){.settings-card{padding:22px 18px}.account-links{gap:6px}.account-links .button{font-size:12px;padding:10px 5px}.preference-fields{grid-template-columns:1fr;gap:18px}.usage-grid{grid-template-columns:1fr}.usage-stat{border-inline-end:0;border-bottom:1px solid var(--line);padding:12px 0}.account-actions .button{font-size:13px}}

/* The same ornament and rotation used by the authentication page. */
.welcome-ornament{display:block;width:200px;aspect-ratio:250/258;margin:0 auto 32px;background-color:#afa67a;opacity:1;pointer-events:none;-webkit-mask:url('identity/manarat-ornament.svg') center/contain no-repeat;mask:url('identity/manarat-ornament.svg') center/contain no-repeat}
@keyframes manarat-ornament-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:no-preference){.welcome-ornament,.auth-page .art-pattern{animation:manarat-ornament-turn 15s linear infinite}}
@media(prefers-reduced-motion:no-preference){.welcome-ornament{animation-duration:12s}}
@media(max-width:760px){.welcome-ornament{width:140px;margin-bottom:28px}}
@media(max-height:650px) and (min-width:761px){.welcome-ornament{width:140px;margin-bottom:24px}}

/* One focus boundary around the whole question composer. */
.composer{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:12px;border:1px solid #dce2e9;border-radius:22px;padding:10px;background:#fff;box-shadow:0 4px 20px #182d5806;transition:border-color .18s,box-shadow .18s}
.composer:focus-within{border-color:var(--ui-focus);outline:3px solid var(--ui-focus);outline-offset:-3px;box-shadow:none}
.composer textarea{direction:rtl;text-align:right;width:100%;min-width:0;min-height:48px;max-height:200px;padding:10px 6px;font-size:16px;line-height:1.75;border:0;border-radius:0;outline:none;box-shadow:none;overflow-y:auto}
.composer textarea:focus,.composer textarea:focus-visible{outline:none;box-shadow:none}
/* Safari offsets native RTL textarea placeholders; position the visual hint ourselves. */
.question-input{position:relative;min-width:0}
.composer textarea::placeholder{color:transparent;opacity:0}
.question-placeholder{position:absolute;inset-inline-start:6px;top:10px;pointer-events:none;color:#8a93a2;font-size:16px;font-weight:300;line-height:1.75;text-align:right}
.composer textarea:not(:placeholder-shown)+.question-placeholder{display:none}
.composer-bottom{margin:0;gap:8px;align-items:center;min-height:48px}
.composer .send-button{width:44px;height:44px;border-radius:14px;flex-shrink:0;margin:2px;color:#fff;background:var(--navy)}
.composer .send-button svg{width:21px;height:21px;stroke-width:1.9}
.composer .send-button:hover{background:#29416d}
@media(max-width:760px){.composer{gap:6px;padding:8px;border-radius:20px}.composer textarea{padding-inline:6px}.composer-bottom{gap:4px}}

/* Keep chat history scrollable while the equally wide composer stays at the foot. */
.app-shell{height:100dvh;min-height:0;overflow:hidden}
.app-main{height:100%;min-height:0}
.app-main>.topbar,.app-main>.app-footer{flex-shrink:0}
.app-main>#main{display:flex;flex-direction:column;overflow:auto}
.chat-view{height:100%;min-height:0;overflow:hidden;flex:1}
.chat-content{flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;display:flex;flex-direction:column}
.chat-content>.welcome{flex-shrink:0}
.chat-content>.conversation-heading,.chat-content>.messages{flex-shrink:0}
.messages:empty{display:none}
.composer-area{max-width:none;flex-shrink:0;margin-top:auto;padding-top:12px;background:var(--paper)}
.composer .stop-button:disabled{opacity:.65;cursor:wait}
@media(max-width:760px){.composer-area{padding-bottom:max(16px,env(safe-area-inset-bottom))}}

/* Answer identity, timing and explicitly labelled source links. */
#rename-chat{width:40px;height:40px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--navy)}
#rename-chat:hover{background:#edf2f7}
#rename-chat svg{width:19px;height:19px}
.message-label{margin-top:24px;justify-content:space-between;gap:16px;flex-wrap:wrap}
.message-brand{display:inline-flex;align-items:center;gap:7px;font-size:12px;white-space:nowrap}
.response-time{margin-inline-start:auto;color:#7b8595;font-size:11px;font-weight:300;white-space:nowrap}
.answer-sources{margin-top:20px;padding-top:14px;border-top:1px solid var(--line)}
.sources-heading{display:flex;align-items:center;gap:7px;flex-wrap:wrap;color:var(--navy)}
.sources-heading svg{width:17px;height:17px}
.sources-heading h3{font-size:12px;font-weight:500;margin:0}
.sources-heading>span{color:#7b8595;font-size:10px;margin-inline-start:5px}
.answer-sources .message-sources{margin-top:10px;gap:8px}
.answer-sources .source-chip{min-height:36px;text-align:start;line-height:1.8}
.consulted-sources{margin-top:12px;color:#768292;font-size:10px}
.consulted-sources summary{cursor:pointer;padding:6px 0;width:fit-content}
@media(max-width:760px){.response-time{font-size:10px}.sources-heading>span{flex-basis:100%;margin-inline-start:24px}}

/* Shared reader content in a desktop column or a mobile bottom sheet. */
.copy-answer{display:inline-flex;align-items:center;gap:7px;min-height:40px}
.copy-answer svg{width:17px;height:17px;flex-shrink:0}
.source-slot{display:contents}
.source-dialog{--source-enter:translateY(100%)}
.source-header,.source-toolbar,.source-bottom{flex-shrink:0}
.source-header>div{min-width:0}
.source-header h2{overflow-wrap:anywhere}
#close-source{flex-shrink:0;width:44px;height:44px;border-radius:12px;background:var(--paper)}
.source-bottom{padding-bottom:max(16px,env(safe-area-inset-bottom))}
@keyframes source-reader-enter{from{transform:var(--source-enter);opacity:.5}to{transform:translate(0);opacity:1}}
@media(prefers-reduced-motion:no-preference){.source-dialog[open]{animation:source-reader-enter .4s cubic-bezier(.22,1,.36,1)}}
@media(max-width:1100px){
  .source-dialog{inset:auto 0 0;margin:0;width:100%;max-width:100%;height:88dvh;max-height:calc(100dvh - 24px);border-radius:24px 24px 0 0;--source-enter:translateY(100%)}
  .source-header{padding:20px 20px 16px}
  .source-toolbar{padding:12px 20px}
  .source-content{padding:20px}
  .source-bottom{padding-inline:20px;flex-wrap:wrap}
}

@media(min-width:1101px){
  .app-shell{--source-width:clamp(360px,34vw,600px);grid-template-columns:248px minmax(0,1fr) 0px}
  .app-shell.source-open{grid-template-columns:248px minmax(0,1fr) var(--source-width)}
  .source-slot{display:flex;grid-column:3;grid-row:1;min-width:0;min-height:0;overflow:hidden;justify-content:flex-start}
  .source-slot .source-dialog[open]{animation:none;transform:none;opacity:1}
  .source-dialog{position:static;inset:auto;margin:0;flex:none;width:var(--source-width);max-width:none;min-width:0;height:100%;max-height:none;border:0;border-inline-start:1px solid var(--line);border-radius:0;box-shadow:none;--source-enter:translateX(-24px)}
  .source-open .conversation-heading h1{overflow-wrap:anywhere}
  .source-slot .source-header{padding:22px}
  .source-slot .source-content{padding:22px}
}

/* Source labels and footnotes are reader aids, separate from the original prose. */
.source-legend{margin-inline-start:0;margin-inline-end:auto;font-size:11px}
#source-title:focus{outline:none}
.unit-speech{font-size:11px;color:#64758a;line-height:1.8;margin-block:6px 2px}
.source-footnotes{margin-block:20px 8px;white-space:normal}
.source-footnotes h3{font-family:'Readex Pro',sans-serif;font-size:13px;font-weight:500;color:var(--navy);margin:0 0 14px}
.source-footnote-row{display:grid;grid-template-columns:70px minmax(0,1fr);align-items:start;gap:12px;padding:12px 0;border-top:1px solid var(--line)}
.source-note-numbers{display:flex;flex-wrap:wrap;gap:4px;padding-top:5px}
.source-note-number{font-family:'Readex Pro',sans-serif;font-size:11px;line-height:1.8;color:var(--navy);background:#edf2f6;border-radius:5px;padding:2px 5px}
.source-footnote-row .source-paragraph{font-size:calc(var(--reader-size) - 2px);line-height:1.9;margin:0;min-width:0}
.source-note-warning{background:#fbf7ef;border:1px solid #e7decb;border-radius:12px;color:#76603b;padding:14px 16px;margin:16px 0;font-size:12px;line-height:1.9}
.source-note-warning strong{font-weight:500}.source-note-warning p{margin:6px 0 0}
@media(max-width:760px){.source-footnote-row{grid-template-columns:58px minmax(0,1fr);gap:9px}}

/* A quiet reading skeleton: text geometry, no fabricated completion percentage. */
.source-loading-label{font-family:'Readex Pro',sans-serif;font-size:12px;color:var(--muted);margin:2px 0 28px;line-height:1.9}
.source-skeleton-paragraph{display:flex;flex-direction:column;gap:14px;margin-bottom:34px}
.source-skeleton-line{display:block;height:12px;width:100%;border-radius:5px;background:#e8edf1;position:relative;overflow:hidden}
.source-skeleton-line:nth-child(2){width:94%}.source-skeleton-line:last-child{width:67%}
.source-skeleton-paragraph:first-child{padding:22px 18px;background:#f2f7f6;border-radius:10px}
.source-skeleton-line::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent,#ffffffb3,transparent);transform:translateX(100%)}
@keyframes source-skeleton-sweep{to{transform:translateX(-100%)}}
@media(prefers-reduced-motion:no-preference){.source-skeleton-line::after{animation:source-skeleton-sweep 1.8s ease-in-out infinite}}

/* Start with a neutral loading frame, never a false empty conversation. */
.app-main>#main{position:relative}
.workspace-booting .view{visibility:hidden;pointer-events:none}
.workspace-booting .sidebar{pointer-events:none}
.workspace-booting .sidebar-empty{visibility:hidden}
.workspace-loading{position:absolute;inset:30px 24px auto;max-width:900px;margin-inline:auto;color:#728493;font-size:13px;line-height:1.9;z-index:1}
.workspace-loading>p{margin:0 0 24px}
.workspace-skeleton-question{height:62px;border-radius:12px;background:#ebf0f5;margin-bottom:36px}
.workspace-skeleton .source-skeleton-paragraph{background:none;padding:0;gap:19px}
.workspace-loading.failed .workspace-skeleton{display:none}
.workspace-loading.failed>p{color:#965c41}
@media(max-width:760px){.workspace-loading{inset-inline:20px}}

/* Account/history bootstrap stays in the background for an empty new chat. */
html[data-workspace-start="new"] .workspace-booting #view-chat{visibility:visible;pointer-events:auto}
html[data-workspace-start="new"] .workspace-loading:not(.failed){display:none}
html[data-workspace-start="new"] .workspace-loading.failed{position:static;margin:18px 24px 0;flex-shrink:0}
html[data-workspace-start="new"] .workspace-loading.failed>p{margin-bottom:10px}

/* One reading size for answers and cited prose; preserve their font families. */
:root{--reader-size:13px;--source-gold:#afa67a}
.answer-body,.source-unit,.source-table,.reading-sample{font-size:var(--reader-size)}
.source-unit.core{background:#afa67a14;border-inline-start-color:var(--source-gold);color:#354258}
.source-unit.core .unit-label{color:#766d45}
.source-skeleton-paragraph:first-child{background:#afa67a10}
#source-original{gap:9px;line-height:1.8;white-space:normal}
#source-original svg{width:16px;height:16px;flex-shrink:0}
