/* Shared colour system for every Ein neues Kapitel surface. */
body:is(.chapter-theme,.chapter-page,.chapter){
 --chapter-paper:#f8f7f4;--chapter-surface:#fffdf9;--chapter-soft:#ece1d4;
 --chapter-ink:#463b33;--chapter-muted:#6c625a;--chapter-accent:#8b513b;
 --chapter-hover:#713f2d;--chapter-line:#d9ccbd;--chapter-dark:#463b33;
 --chapter-on-dark:#fffaf3;--chapter-shadow:#463b3333;--chapter-focus:#8b513b;
 --paper:var(--chapter-paper);--ink:var(--chapter-ink);--text:var(--chapter-ink);
 --muted:var(--chapter-muted);--accent:var(--chapter-accent);--line:var(--chapter-line);--soft:var(--chapter-soft);
 background:var(--chapter-paper);color:var(--chapter-ink);accent-color:var(--chapter-accent);
}
body:is(.chapter-theme,.chapter-page,.chapter) :focus-visible{outline-color:var(--chapter-focus)}
body.chapter-theme .chapter-room{--ink:var(--chapter-ink);--paper:var(--chapter-paper);--muted:var(--chapter-muted);--accent:var(--chapter-accent);--line:var(--chapter-line)}
body.chapter-theme :is(.main,.main-content,.topbar,.mobile-topbar,.mobile-menu,.mobile-bottom-nav,.buddy-dock){background:var(--chapter-paper);color:var(--chapter-ink);border-color:var(--chapter-line)}
body.chapter-theme :is(.sidebar,.scene-messages){background:var(--chapter-dark);color:var(--chapter-on-dark)}
body.chapter-theme .sidebar :is(.brand,.lab,.nav button,.nav-group>summary,.pwa-menu-link,.sidebar-note,.profile){color:var(--chapter-on-dark);border-color:#786555}
body.chapter-theme .sidebar :is(.nav button.active,.nav button:hover,.nav-group>summary:hover){background:#685345;color:var(--chapter-on-dark)}
body.chapter-theme :is(.form-card,.discovery-card,.discovery-feedback,.discovery-choice,.discovery-editor,.discovery-result,.workshop-card,.workshop-panel,.billing-card,.buddy-message,.buddy-layout textarea,.buddy-dock,dialog,input,select,textarea,.flow-panel,.flow-choice,.privacy-section,.privacy-card){background:var(--chapter-surface);color:var(--chapter-ink);border-color:var(--chapter-line)}
body.chapter-theme :is(.discovery,.discovery-header em,.discovery-card b,.buddy-message,.buddy-human,.workshop,.billing,.privacy-center,.mobile-menu nav h3,.mobile-bottom-nav button,.mobile-topbar button){color:var(--chapter-ink)}
body.chapter-theme :is(.muted,.tab-description,.flow-note,.quota-note,.session-notice,.privacy-inline,.discovery-header p,.discovery-card small,.discovery-card span,.discovery-session-note,.discovery-result p,.workshop p,.billing p,.buddy-status,.buddy-starter,.buddy-dock-header small,.dialog-close,input::placeholder,textarea::placeholder){color:var(--chapter-muted)}
body.chapter-theme :is(h1 em,h2 em,.eyebrow,.text-button,.block-title,.discovery-card small,a,.buddy-layout blockquote){color:var(--chapter-accent)}
body.chapter-theme :is(.primary,.buddy-launcher,.mobile-buddy-button){background:var(--chapter-accent);border-color:var(--chapter-accent);color:var(--chapter-on-dark)}
body.chapter-theme :is(.primary:hover,.buddy-launcher:hover){background:var(--chapter-hover);color:var(--chapter-on-dark)}
body.chapter-theme :is(.secondary,.chip,.auth-tabs button,.mode-choice button,.discovery-card:hover,.buddy-suggestions button){background:var(--chapter-surface);color:var(--chapter-accent);border-color:var(--chapter-line)}
body.chapter-theme :is(.secondary:hover,.flow-choice.selected,.flow-choice[aria-pressed=true],.auth-tabs button.active,.mode-choice button.active,.buddy-human,.buddy-entry-paths .form-card,.voice-bar,.discovery-session-note,.discovery-choice[aria-pressed=true],.mobile-bottom-nav button.active,#recovery-code){background:var(--chapter-soft);color:var(--chapter-ink);border-color:var(--chapter-accent)}
body.chapter-theme :is(.buddy-dock-header,.buddy-layout blockquote,.nav-group,.profile){border-color:var(--chapter-line)}
body.chapter-theme .dot{background:var(--chapter-accent)}
body.chapter-theme .buddy-launcher{box-shadow:0 5px 25px #463b3333}
body.chapter-theme dialog::backdrop{background:#463b3399}
body.chapter-theme .chapter-reading-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:32px 0}
body.chapter-theme .chapter-reading-card{display:flex;flex-direction:column;gap:14px;text-align:left;padding:28px;border:1px solid var(--chapter-line);border-radius:16px;background:var(--chapter-surface);color:var(--chapter-ink);font:inherit;cursor:pointer}
body.chapter-theme .chapter-reading-card:hover{border-color:var(--chapter-accent);background:var(--chapter-soft)}
body.chapter-theme .chapter-reading-card h2{font:400 29px/1.25 Georgia,serif;letter-spacing:-.5px;margin:0}
body.chapter-theme .chapter-reading-card p{margin:0;line-height:1.7;color:var(--chapter-muted)}
body.chapter-theme .chapter-reading-card .chapter-eyebrow{font-size:12px;margin:0;color:var(--chapter-accent)}
body.chapter-theme .chapter-reading-card>span:last-child{margin-top:auto;font-size:16px;color:var(--chapter-accent)}
body.chapter-theme .chapter-learning-access{max-width:75ch;margin-top:28px}
body.chapter-theme .chapter-learning .chapter-lesson{margin-top:22px}
@media(max-width:620px){body.chapter-theme .chapter-reading-grid{grid-template-columns:1fr;gap:14px}body.chapter-theme .chapter-reading-card{padding:24px}body.chapter-theme .chapter-reading-card h2{font-size:27px}}
/* Shared components keep their chapter colours on mobile and in dialogs. */
body.chapter-theme .sidebar a.chapter-switch{color:var(--chapter-on-dark)}
body.chapter-theme :is(.pwa-topbar-link,.profile .avatar,.mode-choice,.buddy-credit-summary>summary,.buddy-credit-details,.discovery-note,.discovery-panel,.discovery-example,.discovery-feature,.discovery-next,.work-module,.work-module-card,.work-lesson,.work-example,.work-feedback,.work-note,.work-todo,.work-stage,.work-visual,.billing-product,.billing-credit,.billing-order,.privacy-group,.privacy-record,.buddy-entry-hero,.buddy-entry-paths button){background:var(--chapter-surface);color:var(--chapter-ink);border-color:var(--chapter-line)}
body.chapter-theme :is(.discovery-small,.discovery-note,.discovery-panel p,.discovery-example p,.discovery-next p,.work-small,.work-hint,.work-note,.work-heading p,.work-module p,.work-module-card p,.work-lesson p,.billing-group-note,.billing-price-note,.privacy-note,.privacy-record p,.buddy-credit-summary strong,.buddy-credit-details dd){color:var(--chapter-muted)}
body.chapter-theme :is(.discovery-card.selected,.discovery-card[aria-pressed=true],.work-module-card[aria-pressed=true],.work-stage[aria-current],.work-todo,.work-example){background:var(--chapter-soft);border-color:var(--chapter-accent)}
body.chapter-theme.mobile-shell-active .mobile-tabs{--buddy-color:var(--chapter-accent);--buddy-label:var(--chapter-accent);--buddy-active:var(--chapter-hover);--buddy-soft:var(--chapter-soft);--buddy-focus:var(--chapter-focus);background:var(--chapter-surface);border-color:var(--chapter-line)}
body.chapter-theme.mobile-shell-active .mobile-tabs button{color:var(--chapter-muted)}
body.chapter-theme.mobile-shell-active .mobile-tabs button:is([aria-current],[aria-expanded=true]){color:var(--chapter-accent);background:var(--chapter-soft)}
body.chapter-theme.mobile-shell-active .mobile-tabs .mobile-buddy-button{background:transparent;color:var(--chapter-accent)}
body.chapter-theme.mobile-shell-active .mobile-menu :is(header span,nav h3){color:var(--chapter-muted)}
body.chapter-theme.mobile-shell-active .mobile-menu nav :is(button,a){background:var(--chapter-surface);color:var(--chapter-ink)}
body.chapter-theme.mobile-shell-active .mobile-menu nav button[aria-current],body.chapter-theme .mobile-menu-close{background:var(--chapter-soft);color:var(--chapter-accent)}
@media(max-width:850px){
 body.chapter-theme.mobile-shell-active .chapter-mobile-brand{display:none}
 body.chapter-theme.mobile-shell-active .topbar{height:auto;min-height:74px;flex-wrap:nowrap;padding:14px 16px;gap:10px;background:var(--chapter-paper)}
 body.chapter-theme.mobile-shell-active .mobile-brand{font:400 23px/1.2 Georgia,serif;letter-spacing:-.7px;color:var(--chapter-ink);white-space:normal;max-width:180px}
 body.chapter-theme.mobile-shell-active .header-actions{width:auto;flex:0 0 auto;margin-left:auto;justify-content:flex-end}
}
/* Everyday topics share the same warm palette on the entry and in the reader. */
body:is(.chapter-page,.chapter) .chapter-hurdle-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
body:is(.chapter-page,.chapter) .chapter-hurdle-grid article{display:flex;flex-direction:column;gap:16px;padding:28px;border:1px solid var(--chapter-line);border-radius:16px;background:var(--chapter-surface)}
body:is(.chapter-page,.chapter) .chapter-hurdle-grid h3{font:400 28px/1.25 Georgia,serif;letter-spacing:-.5px}
body:is(.chapter-page,.chapter) .chapter-hurdle-grid p{color:var(--chapter-muted);font-size:17px;line-height:1.7}
body:is(.chapter-page,.chapter) .chapter-hurdle-grid a{margin-top:auto;color:var(--chapter-accent);font-size:16px;line-height:1.7;min-height:44px;display:flex;align-items:center}
body.chapter-theme .chapter-topics{margin:34px 0}
body.chapter-theme .chapter-topics>h2,body.chapter-theme .chapter-reading-help h2{font:400 32px/1.25 Georgia,serif;letter-spacing:-.5px;margin-bottom:16px}
body.chapter-theme .chapter-topics>p{max-width:70ch;color:var(--chapter-muted)}
body.chapter-theme .chapter-reading-card h3{font:400 27px/1.25 Georgia,serif;margin:0}
body.chapter-theme :is(.chapter-more-impulses,.chapter-reading-help){margin:32px 0;padding:24px;border:1px solid var(--chapter-line);border-radius:16px;background:var(--chapter-surface)}
body.chapter-theme :is(.chapter-more-impulses,.chapter-reading-sources)>summary{cursor:pointer;min-height:48px;line-height:1.7;font-size:17px;color:var(--chapter-accent)}
body.chapter-theme .chapter-reading-sources{margin-top:28px;border-top:1px solid var(--chapter-line);padding-top:16px}
body.chapter-theme .chapter-reading-sources li{margin:10px 0}
body.chapter-theme .chapter-learning .chapter-lesson li{margin:10px 0;line-height:1.75}
body.chapter-theme .chapter-reading-help p{font-size:17px;line-height:1.75;margin-bottom:18px}
body.chapter-theme .chapter-reading-help a{font-size:17px;line-height:1.7;overflow-wrap:anywhere}
@media(max-width:620px){body:is(.chapter-page,.chapter) .chapter-hurdle-grid{grid-template-columns:1fr}body:is(.chapter-page,.chapter) .chapter-hurdle-grid article{padding:24px}body.chapter-theme :is(.chapter-more-impulses,.chapter-reading-help){padding:20px}}
body.chapter-theme .chapter-learning .chapter-lesson>h1{font:400 clamp(30px,3.2vw,44px)/1.2 Georgia,serif;letter-spacing:-.8px;margin:16px 0}
body.chapter-theme .chapter-learning .chapter-lesson>p{margin:16px 0}
body.chapter-theme .chapter-learning .chapter-lesson>h3{margin:28px 0 12px}
body.chapter-theme .chapter-learning .chapter-lesson>.chapter-lead{font-family:system-ui,sans-serif;font-size:19px!important;line-height:1.6;color:var(--chapter-muted)}

.chapter-shared-entry{display:flex;flex-wrap:wrap;gap:1rem;padding:1rem 5%;background:var(--chapter-paper,#f8f7f4)}.chapter-shared-entry a{color:var(--chapter-accent,#8b513b)}.chapter-topic-group{margin-block:2rem}.chapter-exercises-link{display:block;padding:12px 16px;color:inherit}

.chapter-theme .sidebar .chapter-exercises-link{color:#f7f2ea;text-decoration:none;font:inherit;border-radius:8px}.chapter-theme .sidebar .chapter-exercises-link:hover{background:#594b40}.chapter-topic-group:first-child{margin-top:0}

/* Photo-led chapter discovery shares existing editorial imagery. */
body.chapter-theme .chapter-photo {
 margin: 24px 0 36px;
}
body.chapter-theme .chapter-photo img {
 display: block;
 width: 100%;
 height: auto;
 max-height: 360px;
 object-fit: cover;
 border-radius: 18px;
}
body.chapter-theme .chapter-photo figcaption {
 margin-top: 8px;
 font-size: 12px;
 color: var(--chapter-muted);
}
body.chapter-theme .chapter-photo-card {
 padding: 0;
 overflow: hidden;
 gap: 0;
}
body.chapter-theme .chapter-card-photo {
 display: block;
 width: 100%;
 aspect-ratio: 16 / 9;
 overflow: hidden;
}
body.chapter-theme .chapter-card-photo img {
 display: block;
 width: 100%;
 height: 100%;
 object-fit: cover;
}
body.chapter-theme .chapter-reading-card .chapter-card-copy {
 display: flex;
 flex: 1;
 flex-direction: column;
 gap: 14px;
 padding: 24px;
 margin: 0;
 color: var(--chapter-ink);
}
body.chapter-theme .chapter-card-copy > span {
 margin-top: auto;
 color: var(--chapter-accent);
}
body.chapter-theme .chapter-situation {
 padding: 24px;
 margin: 28px 0;
 background: var(--chapter-soft);
 border-radius: 14px;
}
body.chapter-theme .chapter-situation h2 {
 font: 400 24px/1.3 Georgia, serif;
 margin: 0 0 12px;
}
body.chapter-theme .chapter-situation small {
 color: var(--chapter-muted);
}
body.chapter-theme .chapter-room .session-actions > a {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 min-height: 44px;
 padding: 12px 18px;
 border-radius: 8px;
 text-decoration: none;
}
@media (max-width: 620px) {
 body.chapter-theme .chapter-photo img {max-height: 240px;}
 body.chapter-theme .chapter-reading-card .chapter-card-copy {padding: 20px;}
 body.chapter-theme .chapter-situation {padding: 20px;}
 body.chapter-theme .chapter-room .session-actions {align-items: stretch;}
 body.chapter-theme .chapter-room .session-actions > * {max-width: 100%;white-space: normal;}
}
body.chapter-theme .chapter-heading .session-actions > a.primary {
 color: var(--chapter-on-dark);
}
