.ambc-entry{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#f1f6fc;border:1px solid #dce7f3;border-radius:12px;padding:15px 18px;margin:18px 0 28px;font:14px/1.5 system-ui,sans-serif;color:#39516e}.ambc-open:not(.ambc-inline){background:#163e70!important;color:#fff!important;border:0!important;border-radius:10px!important;padding:12px 17px!important;cursor:pointer;font:600 14px/1.4 system-ui,sans-serif!important;letter-spacing:0!important;text-transform:none!important}.ambc-open:not(.ambc-inline):hover{background:#225a99!important}
#ambc-root{font:14px/1.55 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172d46}#ambc-root *{box-sizing:border-box}#ambc-root [hidden]{display:none!important}#ambc-root .ambc-float{position:fixed;bottom:24px!important;left:24px!important;right:auto!important;z-index:99990;box-shadow:0 7px 24px #132b5133;display:inline-flex;align-items:center;gap:10px}#ambc-root .ambc-float span{color:#f4d491;font-size:20px}
#ambc-root #ambc-panel{position:fixed;left:24px!important;right:auto!important;top:auto!important;bottom:86px!important;width:420px;max-width:calc(100vw - 32px);height:min(690px,calc(100dvh - 110px));display:flex;flex-direction:column;background:#fbfcfe;box-shadow:0 20px 70px #102a4b35;border:1px solid #d9e4ef;border-radius:20px;overflow:hidden;z-index:2147483000;text-align:left}
#ambc-root #ambc-panel button{font-family:inherit;text-transform:none;letter-spacing:0;cursor:pointer}#ambc-root #ambc-panel button:disabled{opacity:.4;cursor:default}#ambc-root #ambc-panel svg{display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;width:18px;height:18px}
#ambc-root .ambc-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:18px 18px 16px;background:linear-gradient(120deg,#102e55,#1c487a);color:white}#ambc-root .ambc-heading-group{min-width:0}#ambc-root .ambc-eyebrow{display:flex;align-items:center;gap:6px;font-size:9px;letter-spacing:1.3px;color:#d4e4f6;line-height:1.4}#ambc-root .ambc-eyebrow i{display:inline-block;width:5px;height:5px;border-radius:50%;background:#edc96e}#ambc-root .ambc-head h2{margin:6px 0 0!important;font:600 18px/1.3 system-ui,sans-serif!important;color:#fff!important}#ambc-root .ambc-tools{display:flex;gap:3px;flex:none}#ambc-root .ambc-tool{display:grid;place-items:center;width:32px;height:34px;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:#f1f6ff;transition:background .15s,transform .15s,border-color .15s}#ambc-root .ambc-tool:hover:not(:disabled){background:#ffffff24;border-color:#ffffff38;transform:translateY(-1px)}#ambc-root #ambc-close:hover{background:#ffffff!important;color:#102e55!important;transform:rotate(6deg)}
#ambc-root .ambc-book{flex:none;padding:12px 20px;background:#f1f5fa;border-bottom:1px solid #e0e7ef}#ambc-root .ambc-book-label{display:block;color:#71839a;font-size:8px;letter-spacing:1.4px;font-weight:700;margin-bottom:3px}#ambc-root #ambc-book-title{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font:600 12px/1.5 system-ui,sans-serif;color:#274463}
#ambc-root #ambc-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:20px;scrollbar-width:thin;scrollbar-color:#cbd8e6 transparent}#ambc-root .ambc-welcome{text-align:center;padding:4px 2px 18px}#ambc-root .ambc-spark{display:inline-grid;place-items:center;width:44px;height:44px;background:#e9f0fa;color:#3b6295;border-radius:14px;font-size:28px}#ambc-root .ambc-welcome h3{font:600 20px/1.35 system-ui,sans-serif!important;color:#163454!important;margin:12px 0 7px!important}#ambc-root .ambc-welcome p{font:13px/1.6 system-ui,sans-serif!important;color:#718197!important;margin:0!important}#ambc-root .ambc-prompts{display:grid;gap:7px}#ambc-root .ambc-prompt-label{font-size:8px;letter-spacing:1.3px;font-weight:700;color:#8090a4;margin:0 0 2px}#ambc-root .ambc-prompts button{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:35px;padding:8px 11px;background:white;border:1px solid #dae4ef;border-radius:9px;font:500 12px/1.4 system-ui,sans-serif;color:#365471;text-align:left;transition:background .15s,border-color .15s}#ambc-root .ambc-prompts button span{font-size:15px;color:#9aabc0}#ambc-root .ambc-prompts button:hover{background:#eef4fc;border-color:#a5bddb}
#ambc-root .ambc-compose{flex:none;padding:12px 16px 13px;background:white;border-top:1px solid #e6ecf3}#ambc-root #ambc-form{display:grid;grid-template-columns:minmax(0,1fr) 78px;gap:8px;margin:0;padding:0;align-items:stretch}#ambc-root #ambc-question{box-sizing:border-box;display:block;min-width:0;width:100%;height:48px!important;min-height:48px!important;max-height:48px!important;margin:0!important;padding:13px 12px!important;border:1px solid #ccd9e7!important;border-radius:10px!important;background:#fafcfe!important;color:#173554!important;font:14px/20px system-ui,sans-serif!important;resize:none!important;overflow-y:auto;box-shadow:none}#ambc-root #ambc-send{display:flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;height:48px!important;min-height:48px!important;margin:0!important;padding:0 10px!important;border:1px solid #163e70!important;border-radius:10px!important;background:#163e70!important;color:white!important;font:600 13px/1.4 system-ui,sans-serif!important}#ambc-root #ambc-send:hover:not(:disabled){background:#245b95!important}#ambc-root #ambc-send svg{width:16px;height:16px;flex:none}
#ambc-root .ambc-bottom{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-top:8px;color:#8190a3;font:10px/1.4 system-ui,sans-serif}#ambc-root #ambc-remaining{color:#526b89}#ambc-root #ambc-status{font:12px/1.5 system-ui,sans-serif!important;color:#8d4c2d;margin:7px 0 0!important}#ambc-root #ambc-status:empty{display:none}#ambc-root .ambc-message{margin:0 0 16px;padding:14px 15px;background:white;border:1px solid #e0e8f2;border-radius:13px;box-shadow:0 2px 4px #163e7003}#ambc-root .ambc-message strong{display:block;font:600 10px/1.4 system-ui,sans-serif;letter-spacing:.2px;color:#547293}#ambc-root .ambc-message p{white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.7 system-ui,sans-serif!important;color:#223d5a!important;margin:6px 0 0!important}#ambc-root .ambc-user{margin-left:32px;background:#eaf2fd;border-color:#d8e6f7}#ambc-root .ambc-assistant{margin-right:8px}#ambc-root .ambc-started #ambc-messages{padding-top:18px}
#ambc-root #ambc-panel.ambc-fullscreen{inset:0!important;left:0!important;right:0!important;top:0!important;bottom:0!important;width:100vw!important;max-width:none!important;height:100dvh!important;border-radius:0!important;border:0!important}#ambc-root .ambc-fullscreen #ambc-messages{padding-left:max(20px,calc((100vw - 880px)/2));padding-right:max(20px,calc((100vw - 880px)/2))}#ambc-root .ambc-fullscreen .ambc-compose{padding-left:max(20px,calc((100vw - 880px)/2));padding-right:max(20px,calc((100vw - 880px)/2))}#ambc-root .ambc-fullscreen #ambc-intro{max-width:460px;margin:25px auto}
#ambc-root .ambc-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}#ambc-root button:focus-visible,#ambc-root #ambc-question:focus-visible{outline:2px solid #cda440!important;outline-offset:2px!important}
@media(max-width:600px){.ambc-entry{align-items:flex-start;flex-direction:column}#ambc-root .ambc-float{left:14px!important;bottom:16px!important}#ambc-root #ambc-panel{left:8px!important;bottom:8px!important;width:calc(100vw - 16px);max-width:none;height:min(720px,calc(100dvh - 16px));border-radius:16px;padding-bottom:env(safe-area-inset-bottom)}#ambc-root .ambc-head{padding:14px 12px}#ambc-root .ambc-head h2{font-size:16px!important}#ambc-root .ambc-eyebrow{font-size:8px;letter-spacing:1px}#ambc-root .ambc-tool{width:30px;height:32px}#ambc-root .ambc-tools{gap:0}#ambc-root #ambc-question{font-size:16px!important}#ambc-root #ambc-form{grid-template-columns:minmax(0,1fr) 72px}#ambc-root .ambc-compose{padding:10px 12px}#ambc-root #ambc-messages{padding:16px}#ambc-root .ambc-bottom{font-size:9px}#ambc-root .ambc-fullscreen #ambc-intro{margin:0 auto}}
@media(prefers-reduced-motion:reduce){#ambc-root *{animation:none!important;transition:none!important}}
/* 1.2: compact invitation and portrait conversation. Inline article actions keep their existing styles. */
#ambc-root .ambc-float{width:60px!important;height:60px!important;min-width:60px!important;padding:0!important;border:1px solid #b9955738!important;border-radius:50%!important;justify-content:center;background:linear-gradient(145deg,#244967,#102b48)!important;box-shadow:0 8px 26px #122d4938,inset 0 1px 0 #ffffff25;transition:transform .2s,box-shadow .2s}
#ambc-root .ambc-float:hover{transform:translateY(-3px);box-shadow:0 12px 30px #122d4950}
#ambc-root .ambc-float svg{display:block;width:33px;height:33px;fill:none;stroke:#f0ce83;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;margin:0}
#ambc-root #ambc-nudge{position:fixed;left:24px;bottom:98px;width:262px;max-width:calc(100vw - 32px);z-index:99991;border:1px solid #e7e7e6;border-radius:18px;background:#fff;box-shadow:0 10px 36px #233a5120;animation:ambc-appear .25s ease-out}
#ambc-root #ambc-nudge:after{content:'';position:absolute;bottom:-6px;left:24px;width:12px;height:12px;transform:rotate(45deg);background:#fff;border-right:1px solid #e7e7e6;border-bottom:1px solid #e7e7e6}
#ambc-root .ambc-nudge-open{display:flex;align-items:center;gap:10px;width:100%;min-height:76px;padding:15px 30px 15px 14px!important;background:transparent!important;color:#203a53!important;text-align:left;border-radius:18px!important;font:600 13px/1.5 system-ui,sans-serif!important;box-shadow:none}
#ambc-root .ambc-nudge-open small{display:block;color:#85909b;font:11px/1.5 system-ui,sans-serif;margin-top:3px}
#ambc-root .ambc-nudge-spark{display:grid;place-items:center;flex:none;width:32px;height:36px;background:#fcf5e5;border-radius:11px;color:#b48b3f;font-size:25px}
#ambc-root #ambc-nudge-close{position:absolute;right:5px;top:5px;display:grid;place-items:center;width:26px;height:26px;padding:0;border:0;border-radius:50%;background:transparent;color:#87939f;font:20px/1 system-ui;cursor:pointer}
#ambc-root #ambc-nudge-close:hover{background:#eef2f5;color:#203a53}
#ambc-root #ambc-panel{bottom:98px!important;height:min(710px,calc(100dvh - 122px));border-color:#e1e7ed;border-radius:24px;background:#fff;box-shadow:0 20px 70px #17324b30}
#ambc-root .ambc-head{padding:17px 14px;gap:10px;background:linear-gradient(125deg,#173550,#254f6e)}
#ambc-root .ambc-head-avatar{display:block;flex:none;width:38px;height:38px;border-radius:14px;border:1px solid #f8dd9d55}
#ambc-root .ambc-heading-group{flex:1}
#ambc-root .ambc-head h2{font-size:16px!important;margin-top:4px!important}
#ambc-root .ambc-eyebrow{font-size:8px;letter-spacing:1px}
#ambc-root .ambc-book{padding:10px 17px;background:#fff;border-bottom:1px solid #edf0f3}
#ambc-root #ambc-messages{background:radial-gradient(ellipse at top left,#f6f4efaa,transparent 65%),#fafbfd;padding:20px 16px}
#ambc-root .ambc-message{display:flex;align-items:flex-start;gap:9px;margin:0 0 22px;padding:0;background:none;border:0;border-radius:0;box-shadow:none;animation:ambc-appear .22s ease-out}
#ambc-root .ambc-avatar{display:block;flex:0 0 32px;width:32px;height:32px;margin-top:23px;border-radius:12px;box-shadow:0 2px 5px #17324b10}
#ambc-root .ambc-message-content{min-width:0;max-width:calc(100% - 41px);flex:1}
#ambc-root .ambc-message .ambc-message-label{display:block;margin:0 0 6px 3px;color:#81909e;font:500 10px/1.5 system-ui,sans-serif;letter-spacing:0}
#ambc-root .ambc-message p.ambc-bubble{padding:13px 15px;margin:0!important;border-radius:4px 18px 18px 18px;border:1px solid #e7ebf0;background:#fff;color:#33465a!important;box-shadow:0 3px 9px #233a5105;font:14px/1.75 system-ui,sans-serif!important;white-space:pre-wrap;overflow-wrap:anywhere}
#ambc-root .ambc-user{flex-direction:row-reverse;margin-left:24px}
#ambc-root .ambc-user .ambc-message-content{flex:0 1 auto}
#ambc-root .ambc-user .ambc-message-label{text-align:right;margin-right:3px}
#ambc-root .ambc-user p.ambc-bubble{border:0;border-radius:18px 4px 18px 18px;background:linear-gradient(125deg,#254b6a,#19364f);color:#fff!important;box-shadow:0 4px 12px #1a3c5815}
#ambc-root .ambc-ratings{display:flex;align-items:center;gap:3px;margin:6px 0 0}
#ambc-root .ambc-rating{display:grid;place-items:center;width:29px;height:28px;min-height:0;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;color:#91a0ad;box-shadow:none;transition:background .15s,color .15s}
#ambc-root #ambc-panel .ambc-rating svg{width:14px;height:14px;stroke-width:1.6}
#ambc-root .ambc-dislike svg{transform:rotate(180deg)}
#ambc-root .ambc-rating:hover{background:#edf0f5;color:#345772}
#ambc-root .ambc-rating[aria-pressed=true]{background:#f9efda;color:#936b24;border-color:#edd9b0}
#ambc-root .ambc-rating-note{font:10px/1.3 system-ui;color:#8a98a5;margin-left:5px}
#ambc-root .ambc-compose{padding:14px 16px 12px;border-top:1px solid #edf0f3}
#ambc-root #ambc-question{border-color:#e0e6ec!important;background:#f8fafc!important;border-radius:14px!important}
#ambc-root #ambc-send{border-radius:14px!important;background:#1c405e!important;border-color:#1c405e!important;line-height:1!important}
#ambc-root #ambc-send span{display:block;line-height:1;margin:0;padding:0}
#ambc-root #ambc-send svg{display:block!important;position:static!important;transform:none!important;width:17px!important;height:17px!important;margin:0!important;padding:0!important;vertical-align:middle;flex:0 0 17px}
#ambc-root .ambc-bottom{align-items:center;gap:5px;font-size:9px}
#ambc-root #ambc-sound{display:inline-flex;gap:4px;align-items:center;justify-content:center;padding:3px 4px;min-height:24px;margin:0 -4px 0 0;background:transparent;color:#7890a2;border:0;border-radius:6px;font:10px/1.3 system-ui;box-shadow:none}
#ambc-root #ambc-sound:hover{background:#f1f4f7;color:#234762}
#ambc-root .ambc-prompts button{border-radius:12px;box-shadow:0 2px 4px #17324b03}
#ambc-root .ambc-spark{background:linear-gradient(135deg,#fff3d6,#f2dfb4);color:#a9853c;box-shadow:0 4px 16px #b3945420}
#ambc-root .ambc-fullscreen #ambc-messages{padding-left:max(16px,calc((100vw - 800px)/2));padding-right:max(16px,calc((100vw - 800px)/2))}
#ambc-root .ambc-fullscreen .ambc-compose{padding-left:max(16px,calc((100vw - 800px)/2));padding-right:max(16px,calc((100vw - 800px)/2))}
@keyframes ambc-appear{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:600px){#ambc-root #ambc-panel{bottom:8px!important;height:min(740px,calc(100dvh - 16px));border-radius:20px}#ambc-root #ambc-nudge{left:14px;bottom:90px}#ambc-root .ambc-head{gap:7px;padding:14px 11px}#ambc-root .ambc-head-avatar{width:32px;height:32px;border-radius:11px}#ambc-root .ambc-head h2{font-size:14px!important}#ambc-root .ambc-eyebrow{font-size:7px;letter-spacing:.65px}#ambc-root .ambc-tools .ambc-tool{width:28px}#ambc-root #ambc-messages{padding:17px 12px}#ambc-root .ambc-compose{padding:12px}#ambc-root .ambc-user{margin-left:14px}#ambc-root .ambc-message p.ambc-bubble{padding:11px 12px;font-size:13px!important}#ambc-root .ambc-avatar{width:28px;height:28px;flex-basis:28px;border-radius:10px}#ambc-root .ambc-message-content{max-width:calc(100% - 37px)}}
@media(prefers-reduced-motion:reduce){#ambc-root *{animation:none!important;transition:none!important}}
/* 1.3: readable black text, progress feedback and optional desktop launcher. */
#ambc-root #ambc-panel{color:#000}
#ambc-root .ambc-welcome h3,#ambc-root .ambc-welcome p,#ambc-root .ambc-prompts button,#ambc-root .ambc-prompt-label,#ambc-root #ambc-book-title,#ambc-root .ambc-book-label,#ambc-root .ambc-message .ambc-message-label,#ambc-root .ambc-message p.ambc-bubble,#ambc-root #ambc-question,#ambc-root .ambc-bottom,#ambc-root #ambc-remaining,#ambc-root #ambc-sound,#ambc-root .ambc-rating-note,#ambc-root #ambc-status{color:#000!important}
#ambc-root .ambc-user p.ambc-bubble{background:linear-gradient(125deg,#f8efd9,#f0e1bd);color:#000!important}
#ambc-root #ambc-question::placeholder{color:#545454;opacity:1}
#ambc-root .ambc-typing{align-items:center}
#ambc-root .ambc-typing .ambc-avatar{margin-top:0}
#ambc-root .ambc-typing-bubble{display:flex;align-items:center;flex-wrap:wrap;gap:9px;padding:12px 14px;background:#fff;border:1px solid #e7ebf0;border-radius:4px 16px 16px 16px;font:12px/1.5 system-ui;color:#000}
#ambc-root .ambc-typing-dots{display:inline-flex;gap:4px;align-items:center;height:14px}
#ambc-root .ambc-typing-dots i{display:block;width:5px;height:5px;border-radius:50%;background:#b08b40;animation:ambc-typing 1.1s infinite ease-in-out}
#ambc-root .ambc-typing-dots i:nth-child(2){animation-delay:.15s}
#ambc-root .ambc-typing-dots i:nth-child(3){animation-delay:.3s}
@keyframes ambc-typing{0%,65%,100%{transform:translateY(0);opacity:.4}30%{transform:translateY(-4px);opacity:1}}
#ambc-root[data-floating="0"] .ambc-float,#ambc-root[data-floating="0"] #ambc-nudge{display:none!important}
@media(max-width:767px){#ambc-root .ambc-float,#ambc-root #ambc-nudge{display:none!important}}
@media(prefers-reduced-motion:reduce){#ambc-root .ambc-typing-dots i{animation:none!important;opacity:1}}

/* Persistent progress is outside the scrollable conversation. */
#ambc-root #ambc-progress{display:flex;align-items:center;gap:9px;min-height:34px;padding:7px 10px;margin:0 0 9px;border:1px solid #e5d5ad;border-radius:10px;background:#fff7e5;color:#000;font:500 12px/1.5 system-ui,sans-serif}
#ambc-root .ambc-progress-ring{display:block;flex:0 0 16px;width:16px;height:16px;border:2px solid #e4d3a9;border-top-color:#876321;border-radius:50%;animation:ambc-progress-spin .8s linear infinite!important}
#ambc-root .ambc-typing-dots i{animation:ambc-typing 1.1s infinite ease-in-out!important}
#ambc-root .ambc-typing-dots i:nth-child(2){animation-delay:.15s!important}
#ambc-root .ambc-typing-dots i:nth-child(3){animation-delay:.3s!important}
@keyframes ambc-progress-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#ambc-root .ambc-progress-ring,#ambc-root .ambc-typing-dots i{animation:none!important}}
/* Book identity, library action placement, and export isolation. */
#ambc-root #ambc-book-author{display:block;margin-top:4px;color:#000;font:12px/1.5 system-ui,sans-serif}
#ambc-root .ambc-source-note{display:block;margin-top:6px;color:#526477;font:10px/1.5 system-ui,sans-serif}
#ambc-entry{display:block;margin:14px 0;padding:0;border:0;background:none}
/* Use the library's own outline button rules when placed beside its actions. */
#ambc-entry.ambc-in-actions{display:flex;align-items:stretch;margin:0;flex:1;min-width:0}
#ambc-entry .ambc-inline{display:inline-flex;align-items:center;justify-content:center;gap:11px;box-sizing:border-box;width:100%;margin:0;cursor:pointer;text-transform:none;letter-spacing:normal;white-space:normal}
#ambc-entry .ambc-inline svg{display:block;width:24px;height:24px;flex:0 0 24px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#ambc-entry .ambc-inline span{color:inherit}
#ambc-entry:not(.ambc-in-actions) .ambc-inline{width:auto;min-height:46px;padding:11px 16px;border:1px solid #bdd1e6;border-radius:9px;background:linear-gradient(135deg,#fff,#f0f6fe);color:#000;font:600 14px/1.4 Arial,sans-serif;box-shadow:0 4px 0 #bdd1e644}
#ambc-entry:not(.ambc-in-actions) .ambc-inline:hover{background:#eaf3ff}
#ambc-entry .ambc-inline:focus-visible{outline:3px solid #3684ca;outline-offset:4px}
#ambc-root #ambc-entry{padding:0 20px}
@media(max-width:767px){#ambc-entry.ambc-in-actions{flex:1 1 100%;width:100%}}
@media print{#ambc-root,#ambc-entry,.ambc-open{display:none!important}}
