body { font-size: var(--font-size-ui); }
.header-container { max-width: 1304px; padding: 19px 32px; }
.brand-text h1 { font-size: 0.9375rem; letter-spacing: .055em; }
.brand-text .pali-sub { font-size: 0.875rem; letter-spacing: .1em; }
.wheel-icon { width: 37px; height: 37px; }
.theme-btn { font-size: 0.875rem; min-height: 44px; height: auto; padding-inline: 10px; }
.bell-btn { font-size: 0.875rem; min-height: 44px; }
.noble-nav-bar { background: var(--header-bg); position: sticky; top: 0; z-index: 90; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 1px solid var(--border-gold); box-shadow: 0 4px 16px rgba(0,0,0,0.03); }
.nav-tabs-container { max-width: 100%; flex: 1; min-width: 0; gap: 20px; display: flex; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; -ms-overflow-style: none; padding: 0 16px; margin: 0 auto; }
.nav-tabs-container::-webkit-scrollbar { display: none; }
.nav-tab, .nav-more { font-size: 0.875rem; white-space: nowrap; flex-shrink: 0; }
.nav-tab { min-height: 52px; font-weight: 500; transition: all 0.2s; }
.nav-tab.active { color: var(--accent); border-bottom: 3px solid var(--gold-pure); font-weight: 600; }
.nav-more.has-active summary { color: var(--accent); font-weight: 600; border-bottom: 3px solid var(--gold-pure); }
.nav-more-menu { z-index: 100; width: min(310px,calc(100vw - 32px)); max-height: min(70dvh,520px); overflow-y: auto; right: 0; top: 100%; }
.main-wrapper { max-width: 1304px; padding: 32px 32px 72px; }
.r-button, .r-primary { min-height: 44px; font-size: 0.875rem; border-radius: 9px; padding: 10px 16px; }
.r-primary:hover { filter: brightness(.94); }
.eyebrow { font-size: 0.875rem; letter-spacing: .15em; font-weight: 600; }
.sanctuary-hero { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); gap: 24px; align-items: center; min-height: 0; background: var(--bg-surface); border: 1px solid var(--border-gold); border-radius: 16px; padding: 36px; margin-bottom: 32px; box-shadow: 0 6px 24px rgba(212, 175, 55, 0.08); position: relative; overflow: hidden; }
.sanctuary-hero::before { content: ''; position: absolute; top: -80px; left: 35%; width: 280px; height: 280px; background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%); pointer-events: none; }
.hero-copy { padding: 0; position: relative; min-width: 0; }
.hero-copy .eyebrow { color: var(--gold-dark); font-size: 0.875rem; }
.hero-copy h2 { font-size: clamp(32px, 3.2vw, 44px); line-height: 1.35; margin: 12px 0; color: var(--text-primary); letter-spacing: -.025em; font-family: var(--font-serif); }
.hero-copy h2 em { color: var(--accent); font-style: italic; }
.hero-copy p { max-width: 420px; color: var(--text-secondary); font-size: 1rem; line-height: 1.75; margin-bottom: 16px; }
.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.hero-actions .r-primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-size: 0.875rem; border-radius: 8px; font-weight: 600; box-shadow: 0 2px 8px rgba(40, 99, 78, 0.2); }
.hero-actions .r-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hero-secondary { color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; cursor: pointer; background: none; border: 0; padding: 6px 10px; transition: color 0.15s; }
.hero-secondary:hover { color: var(--accent); }
.hero-signature { display: none; align-items: center; gap: 8px; margin-top: 18px; font-size: 0.875rem; letter-spacing: .2em; color: var(--gold-dark); font-weight: 600; }
.signature-line { width: 24px; height: 1px; background: var(--gold-dark); opacity: .6; }

.hero-art { display: flex; color: var(--gold-pure); width: 72px; position: absolute; right: 0; bottom: 0; padding: 0; border: 0; }
.lotus-art { width: 96px; height: 72px; animation: none; filter: none; margin: 0; }
@keyframes zen-pulse { 0%, 100% { transform: translateY(0) scale(1); opacity: 0.95; } 50% { transform: translateY(-3px) scale(1.02); opacity: 1; } }
.art-caption { font-family: var(--font-serif); color: var(--gold-dark); font-size: 0.875rem; letter-spacing: .28em; font-weight: 700; }
.art-subcaption { color: var(--text-muted); font-size: 0.875rem; margin-top: 3px; letter-spacing: .06em; }

.home-discovery { margin: 0; padding: 20px 22px; border: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); border-radius: 14px; box-shadow: var(--shadow-soft); min-width: 0; }
.home-discovery .section-heading { margin-bottom: 12px; }
.home-discovery .section-heading > span { display: none; }
.section-heading h2 { font-size: 1.75rem; line-height: 1.4; font-family: var(--font-serif); }
.section-heading > span { font-size: 0.875rem; color: var(--text-muted); }
.home-discovery h2 { font-size: 1.5rem; color: var(--text-primary); }
.search-input { font-size: 1rem; height: 52px; padding-right: 46px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 10px; transition: border-color 0.2s, box-shadow 0.2s; }
.search-input:focus { border-color: var(--gold-pure); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15); }
.search-clear { position: absolute; right: 7px; top: 2px; width: 42px; height: 44px; border: 0; background: transparent; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-input:placeholder-shown + .search-clear { visibility: hidden; }
.home-search-filters { gap: 12px; margin-top: 12px; }
.home-search-filters label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; flex: 1; font-size: 0.875rem; min-width: 0; color: var(--text-secondary); }
.home-search-filters select { min-height: 44px; font-size: 0.875rem; width: 100%; padding: 6px 8px; border-radius: 6px; }
.search-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 0.875rem; color: var(--text-muted); }
.suggestion-chip { color: var(--text-secondary); background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 4px 11px; border-radius: 20px; font-size: 0.875rem; min-height: 44px; cursor: pointer; transition: all 0.15s; }
.suggestion-chip:hover { border-color: var(--gold-pure); color: var(--gold-dark); background: var(--saffron-50); transform: translateY(-1px); }

.archive-facts { padding: 18px 0; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-gold); border-bottom: 1px solid var(--border-subtle); font-size: 0.875rem; color: var(--text-secondary); }
.archive-facts strong { font-size: 1.25rem; font-family: var(--font-serif); color: var(--text-primary); margin-right: 4px; }
.home-section { margin-top: 40px; }
.featured-books { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.featured-book { min-width: 0; background: var(--bg-surface); padding: 14px; border: 1px solid var(--border-gold); border-radius: 14px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); transition: transform 0.2s, box-shadow 0.2s; }
.featured-book:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(212, 175, 55, 0.15); border-color: var(--gold-pure); }
.book-cover { display: flex; flex-direction: column; align-items: center; text-align: center; min-height: 280px; position: relative; border-radius: 6px 12px 12px 6px; padding: 20px 16px 24px; color: var(--cover-ink); background: var(--cover-green); box-shadow: inset 6px 0 #ffffff18, inset 10px 0 #00000018, 0 4px 12px rgba(0,0,0,0.1); }
.cover-1 { background: var(--cover-clay); } .cover-2 { background: var(--cover-blue); } .cover-3 { background: var(--cover-plum); }
.book-cover > span:first-child { font-size: 0.875rem; letter-spacing: .2em; opacity: .85; }
.book-cover .cover-wheel { width: 86px; height: 66px; margin: 16px 0 12px; color: #E0C99C; }
.book-cover h3 { font: 600 1.5rem/1.5 var(--font-serif); color: inherit; margin: 0 0 12px; }
.book-cover small { font-size: 0.875rem; margin-top: auto; opacity: .9; }
.featured-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; margin-top: 14px; }
.featured-actions button { padding: 9px 8px; font-size: 0.875rem; border-radius: 8px; font-weight: 500; }
.shelf-empty { font-size: 0.875rem; line-height: 1.9; padding: 23px; }
.shelf-book h3 { font-size: 1.125rem; }.shelf-book small { font-size: 0.875rem; }.shelf-book button { font-size: 0.875rem; }
.collection-grid p, .listening-invitation p { font-size: 0.875rem; }
.collection-grid button > span:last-child { font-size: 0.875rem; }
.listening-invitation { border-radius: 14px; }
.search-result-row { display: flex; align-items: center; gap: 15px; padding: 8px 18px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface); margin-bottom: 10px; }
.global-result { display: grid; flex: 1; gap: 5px; min-width: 0; border: 0; padding: 12px 0; background: none; }
.global-result small { font-size: 0.875rem; color: var(--text-muted); }.global-result strong { font: 500 1.125rem/1.65 var(--font-serif); }.global-result span { font-size: 0.875rem; color: var(--accent); }
.search-listen { flex-shrink: 0; }
#home-search-results { margin: 12px 0 28px; }
.catalog-layout-controls { margin: 12px 0 24px; font-size: 0.875rem; }
.catalog-select { display: flex; align-items: center; gap: 15px; margin: 15px 0 24px; font-size: 0.875rem; color: var(--text-secondary); }
.catalog-select select { min-height: 46px; min-width: 260px; font-size: 0.875rem; }
.catalog-browse { margin: 10px 0 25px; padding: 12px 16px; border: 1px solid var(--border-subtle); border-radius: 10px; }
.catalog-browse > summary { padding: 5px 0; font-size: 0.875rem; cursor: pointer; }.catalog-browse[open] > summary { margin-bottom: 20px; }
.filter-tag { font-size: 0.875rem; min-height: 44px; padding: 8px 14px; }
.daithua-card { padding: 24px; border: 1px solid var(--border-subtle); border-top: 2px solid var(--border-gold); border-radius: 14px; gap: 18px; box-shadow: 0 2px 10px rgba(0,0,0,0.02); transition: transform 0.2s, box-shadow 0.2s; }
.daithua-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212, 175, 55, 0.12); border-color: var(--gold-pure); }
.daithua-title { font-size: 1.375rem; line-height: 1.65; margin: 17px 0 12px; }
.daithua-desc { font-size: 0.875rem; line-height: 1.9; margin-top: 15px; }
.taisho-badge, .cat-badge { font-size: 0.875rem; }.daithua-han { font-size: 0.9375rem; line-height: 1.8; }
.daithua-action-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn-read-viet, .btn-read-han, .btn-file-pdf { min-height: 44px; font-size: 0.875rem; padding: 10px 16px; border-radius: 8px; }
.book-editions { position: relative; flex: 1 1 100%; }
.book-editions summary { color: var(--text-secondary); font-size: 0.875rem; cursor: pointer; padding: 12px 5px; }
.book-editions > div { display: flex; flex-wrap: wrap; gap: 8px; position: relative; min-width: 0; width: 100%; padding: 12px; background: var(--bg-surface); box-shadow: var(--shadow-hover); border: 1px solid var(--border-subtle); border-radius: 10px; z-index: 10; }
.daithua-card:has(.book-editions[open]) { z-index: 12; }
.card-personal-tools { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border-subtle); }
.card-personal-tools .r-button { font-size: 0.875rem; min-height: 44px; padding: 8px 10px; }
.card-personal-tools .book-listen { color: var(--accent); background: var(--zen-emerald-light); border-radius: 8px; font-weight: 600; }
.taisho-viet-title { font-size: 1.188rem; }.taisho-text-item { gap: 18px; border-radius: 12px; border: 1px solid var(--border-subtle); border-left: 3px solid var(--border-gold); transition: transform 0.15s, box-shadow 0.15s; }
.taisho-text-item:hover { transform: translateX(3px); box-shadow: 0 4px 16px rgba(212, 175, 55, 0.1); border-left-color: var(--gold-pure); }
.catalog-card-view .taisho-text-item > div:nth-child(2) { flex-wrap: wrap; }
.reader-topbar { padding: 14px 24px; }.reader-book-info h2 { font-size: 1.125rem; }.reader-book-info small { font-size: 0.875rem; }
.reader-mode-switch button { min-height: 44px; font-size: 0.875rem; }
#reader-listen-toggle { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.reader-toolstrip { padding: 8px 24px; background: var(--bg-surface); gap: 10px; }
.reader-toolstrip .r-button { min-height: 44px; font-size: 0.875rem; }
.reader-font-quick { display: flex; border: 1px solid var(--border-subtle); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.reader-font-quick .r-button { border: 0; border-radius: 0; min-width: 42px; padding-inline: 9px; }
.reader-font-quick .r-button + .r-button { border-left: 1px solid var(--border-subtle); }
.reader-sidebar { background: var(--bg-surface); padding-top: 23px; } #reader-resizer { width: 3px; }
.reader-drawer-backdrop { display: none; }
#toc-search { font-size: 0.875rem; min-height: 44px; }.toc-options { font-size: 0.875rem; }.toc-options button { font-size: 0.875rem; }
.toc-entry, .toc-entry.level-3 { font-size: 0.875rem; line-height: 1.75; min-height: 44px; padding: 12px 10px; }.toc-entry.level-3 { padding-left: 19px; }
.toc-number { font-size: 0.875rem; }#reader-toc-list summary { font-size: 0.875rem; line-height: 1.8; }
.reader-paper { margin: 16px auto 36px; min-height: calc(100% - 40px); padding: 36px 52px 80px; border: 1px solid var(--border-gold); border-radius: 12px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(212, 175, 55, 0.15); position: relative; }
.reader-paper::before { content: ''; position: absolute; top: 0; left: 24px; right: 24px; height: 3px; background: var(--gold-gradient); border-radius: 0 0 3px 3px; }
.section-caption { font-size: 0.875rem; margin-bottom: 28px; padding-bottom: 17px; }
.reading-section + .reading-section { padding-top: 32px; margin-top: 40px; border-top: 1px solid var(--border-subtle); }
.reading-section::after { content: ''; display: block; width: min(240px,100%); height: 30px; margin: 32px auto 0; background: var(--gold-pure); mask: url('../design/lotus-divider.svg') center / contain no-repeat; -webkit-mask: url('../design/lotus-divider.svg') center / contain no-repeat; pointer-events: none; }
.reader-paper .source-prose { font: inherit; line-height: inherit; text-align: inherit; margin: 0 0 var(--reading-spacing); text-indent: 0; white-space: normal; }
.reader-paper .source-verse { white-space: pre-line; text-align: left; width: fit-content; max-width: 100%; margin: 1.4em auto 1.8em; padding: .5em 1.2em; border-left: 2px solid var(--border-gold); }
.reader-paper .source-dialogue { padding-left: .8em; border-left: 2px solid var(--border-subtle); }
.source-block { padding: 0 4px; overflow-wrap: break-word; }.source-block.selected-block { box-shadow: -2px 0 var(--border-gold); }
.source-heading { font-size: 1.3em; line-height: 1.65; margin: 28px 0 36px; text-wrap: balance; }
.source-information { border: 1px solid var(--border-subtle); border-radius: 9px; margin: 12px 0 28px; padding: 12px 16px; background: var(--bg-app); }
.source-information > summary { font: 0.875rem/1.8 var(--font-body); color: var(--text-secondary); cursor: pointer; }
.source-information[open] > summary { margin-bottom: 15px; }.source-information .source-prose { font: 0.875rem/1.9 var(--font-body); }
.source-metadata { font-size: 0.875rem; border: 0; padding: 4px 0; }
.reader-inspector { width: 330px; padding: 22px; }.reader-inspector label { font-size: 0.875rem; }.reader-inspector input:not([type="checkbox"]), .reader-inspector select, .reader-inspector textarea { font-size: 0.875rem; }.reader-inspector .r-button { font-size: 0.875rem; }
.reader-bottombar { padding: 12px 24px; }.reader-bottombar .r-button { font-size: 0.875rem; }.reader-progress-info { font-size: 0.875rem; }
.audio-panel { padding: 16px 24px; box-shadow: 0 -5px 24px #253d3508; max-height: 36dvh; overflow-y: auto; }
.audio-heading .eyebrow { font-size: 0.875rem; }.audio-heading strong { font-size: 0.875rem; }.audio-controls { gap: 12px; }
.audio-controls .r-button,.audio-controls .r-primary { font-size: 0.875rem; min-height: 44px; }
.audio-voice-label select { font-size: 0.875rem; min-height: 44px; }.audio-options { font-size: 0.875rem; }.audio-options select { font-size: 0.875rem; min-height: 44px; }
.audio-feedback { display: flex; align-items: center; gap: 16px; }#audio-status { font-size: 0.875rem; color: var(--text-secondary); }#audio-service-note { font-size: 0.875rem; }
.audio-panel[data-status="error"] #audio-status { color: var(--zen-crimson); }
.audio-panel[data-status="loading"] #audio-play { opacity: .75; }
.audio-transcript { margin-top: 10px; font: 0.875rem/1.8 var(--font-body); }.audio-transcript summary { cursor: pointer; color: var(--text-secondary); }.audio-transcript p { padding: 14px; margin-top: 10px; background: var(--bg-app); border-radius: 8px; font: 1rem/1.9 var(--font-serif); }
/* Navigation menu lives outside the clipped horizontal navigation. */
.noble-nav-bar { display: flex; align-items: center; gap: 24px; padding-inline: max(24px,calc((100% - 1240px)/2)); }
.nav-more { flex-shrink: 0; margin: 0; }
.nav-more summary { min-height: 52px; display: flex; align-items: center; gap: 8px; font-size: 0.875rem; padding: 10px 0; white-space: normal; max-width: 230px; }
.nav-more summary::before { content: '▸'; }
.nav-more[open] summary::before { content: '▾'; }
.nav-more-menu .nav-tab { white-space: normal; line-height: 1.6; font-size: 0.875rem; border: 0; border-radius: 6px; }
.nav-more-menu .nav-tab:hover { background: var(--bg-surface-elevated); }
.mobile-menu-toggle { display: none; }
.library-menu { position: fixed; inset: 12px 12px 12px auto; margin: 0; width: min(390px,calc(100% - 24px)); max-width: none; max-height: calc(100dvh - 24px); height: fit-content; overflow-y: auto; overscroll-behavior: contain; padding: 20px; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; }
.library-menu::backdrop { background: #101a14a6; }
.menu-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.menu-heading h2 { font: 600 1.375rem/1.5 var(--font-serif); }
.menu-heading button { min-width: 44px; font-size: 1.5rem; }
.library-menu .nav-tabs-container { display: grid; margin: 0; padding: 0; gap: 4px; overflow: visible; }
.library-menu .nav-tab { width: 100%; text-align: left; padding: 12px; font-size: 1rem; white-space: normal; min-height: 48px; border: 0; border-radius: 8px; }
.library-menu .nav-tab.active { background: var(--zen-emerald-light); }
.library-menu .nav-more { display: block; margin-top: 12px; border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.library-menu .nav-more > summary { display: none; }
.library-menu .nav-more-menu { position: static; width: 100%; max-height: none; overflow: visible; box-shadow: none; border: 0; padding: 0; }
.mobile-settings { border-top: 1px solid var(--border-subtle); margin-top: 16px; padding-top: 16px; }
.mobile-settings h3 { font-size: 1rem; margin-bottom: 12px; }
.library-menu .header-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; width: 100%; }
.library-menu .bell-btn span { display: inline; }
.library-menu .theme-selector { display: flex; flex-wrap: wrap; width: 100%; }
.library-menu .theme-btn { flex: 1; min-height: 44px; height: auto; font-size: 0.875rem; padding: 8px; }
.library-menu .bell-btn { min-height: 44px; font-size: 0.875rem; padding: 10px; }
.nav-scroll-btn, .nav-scroll-fade { display: none !important; }
.library-art { display: inline-block; width: 24px; height: 24px; flex-shrink: 0; pointer-events: none; }
.brand-wrapper .wheel-icon { width: 40px; height: 40px; }
.hero-art .lotus-art { width: 72px; height: 54px; }
.hero-actions { padding-right: 80px; flex-wrap: wrap; }
.cover-corner { position: absolute; top: 8px; left: 8px; width: 46px; height: 46px; color: #E0C99C; opacity: .6; }
.book-cover::after { content: ''; position: absolute; inset: 8px; border: 1px solid #E0C99C66; border-radius: 3px 8px 8px 3px; pointer-events: none; }
.book-cover > span:first-of-type { font-size: 0.875rem; letter-spacing: .04em; }
.lotus-divider { display: flex; align-items: center; justify-content: center; gap: 20px; color: var(--gold-pure); margin: 8px auto 24px; max-width: 520px; }
.lotus-divider::before, .lotus-divider::after { content: ''; height: 1px; background: currentColor; flex: 1; }
.lotus-divider .library-art { width: 60px; height: 45px; }
.collection-symbol .library-art, .listening-seal .library-art { width: 40px; height: 40px; }
.shelf-empty { display: flex; align-items: center; gap: 20px; }
.shelf-empty .library-art { width: 60px; height: 45px; color: var(--gold-pure); }
.home-filter-options { margin-top: 12px; }
.home-filter-options summary, .collection-discovery > summary { min-height: 44px; padding: 10px 0; cursor: pointer; font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.collection-discovery { margin-bottom: 16px; border-block: 1px solid var(--border-subtle); }
.collection-discovery .collection-launcher-card { margin: 12px 0; }
.section-heading { flex-wrap: wrap; }
.section-heading > div, .taisho-left, .daithua-card { min-width: 0; }
.search-input::placeholder, input::placeholder, textarea::placeholder { color: var(--text-secondary); opacity: 1; }
.r-button, .r-primary, .btn-read-viet, .btn-read-han, .btn-file-pdf { min-width: 44px; }
.reader-mode-switch .r-button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.reader-toolstrip #reader-focus[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.audio-heading-actions { display: flex; align-items: center; gap: 8px; }
.audio-heading .r-button { min-height: 44px; min-width: 44px; padding: 8px; font-size: 0.875rem; }
.audio-panel.is-compact .audio-voice-label, .audio-panel.is-compact #audio-sample, .audio-panel.is-compact .audio-options, .audio-panel.is-compact .audio-transcript, .audio-panel.is-compact #audio-service-note { display: none; }
.audio-panel.is-compact .audio-feedback { font-size: 0.875rem; }
.audio-panel.is-compact .audio-heading { margin-bottom: 4px; }
.audio-panel.is-compact #audio-status:empty { display: none; }
.audio-panel.is-compact .audio-controls { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; }
.audio-controls #audio-play { min-height: 48px; }
.audio-heading strong { display: block; overflow-wrap: anywhere; }
.reader-inspector input:not([type="checkbox"]), .reader-inspector select, .reader-inspector textarea { font-size: 1rem; }
.reader-inspector .r-button, .toc-options button { min-height: 44px; }
.reader-paper::before { display: block; height: 1px; background: var(--gold-pure); }
.source-heading { border-left: 0; }
.reader-mobile-tools:empty { display: none; }
.collection-player.is-compact .cp-clock-row, .collection-player.is-compact .cp-time-grid, .collection-player.is-compact .cp-sutra-timing, .collection-player.is-compact .cp-playlist, .collection-player.is-compact #cp-toggle-list { display: none; }
.collection-player .cp-header { flex-wrap: wrap; }
.cp-title-row { flex-wrap: wrap; }
.cp-title-row strong, .cp-now-left strong { white-space: normal; }
.cp-time-grid { flex-wrap: wrap; }
.cp-now-playing { flex-wrap: wrap; }
.cp-controls .r-button, .cp-controls .r-primary { min-height: 44px; }

@media (max-width: 1100px) {
  .featured-books { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reader-paper { padding-inline: 32px; }
  .reader-breadcrumb { display: none; }
}
@media (max-width: 899px) {
  .reader-view-container:not(.toc-hidden):not(.focus-reading) .reader-drawer-backdrop,
  .reader-view-container:has(.reader-inspector:not([hidden])) .reader-drawer-backdrop { display: block; position: absolute; inset: 0; z-index: 4; border: 0; border-radius: 0; background: #00000040; cursor: pointer; }
}
@media (max-width: 800px) {
  .header-container { padding: 12px 20px; flex-wrap: nowrap; gap: 12px; }
  .brand-wrapper { min-width: 0; gap: 10px; }
  .brand-text h1 { font-size: 0.875rem; letter-spacing: 0; }
  .brand-text .pali-sub { display: none; }
  .wheel-icon { width: 32px; height: 32px; flex-shrink: 0; }
  .noble-nav-bar { display: none; }
  .header-container .mobile-menu-toggle { display: inline-flex; flex-shrink: 0; margin-left: auto; }
  .main-wrapper { padding: 24px; }
  .sanctuary-hero { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
  .hero-copy { padding: 0; }
  .hero-copy h2 { font-size: 2rem; line-height: 1.35; margin: 0; }
  .hero-copy p, .hero-copy .eyebrow, .hero-actions, .hero-signature { display: none; }
  .hero-art { display: none; }
  .home-discovery { padding: 0; border: 0; box-shadow: none; background: transparent; }
  .home-discovery .section-heading { display: none; }
  .home-search-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .home-search-filters label, .home-search-filters select { width: 100%; }
  .archive-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .reader-topbar { padding: 10px 16px; flex-wrap: nowrap; gap: 10px; }
  .reader-book-info h2 { display: block; -webkit-line-clamp: unset; font-size: 1rem; line-height: 1.5; max-height: 4.5em; overflow: auto; overflow-wrap: anywhere; }
  .reader-book-info small { display: none; }
  .reader-topbar #reader-close span { display: none; }
  .reader-topbar #reader-close { min-width: 44px; }
  .reader-toolstrip { padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .reader-toolstrip .r-button { flex: initial; font-size: 0.875rem; min-height: 44px; padding: 8px 10px; }
  .reader-font-quick .r-button { min-width: 44px; }
  .reader-toolstrip [data-panel="settings"] { margin-left: auto; }
  .reader-mode-switch { flex-wrap: wrap; order: initial; margin: 0 0 16px; width: 100%; }
  .reader-mode-switch .r-button { flex: 1 1 40%; font-size: 0.875rem; min-height: 44px; }
  .reader-mobile-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .reader-paper { margin: 0; padding: 24px 22px 60px; border: 0; border-radius: 0; min-height: 100%; }
  .reader-paper.reader-dual { padding: 22px; }
  .reader-dual-grid { grid-template-columns: 1fr; }
  .reader-inspector { width: min(360px,100%); padding: 18px; }
  .reader-bottombar { padding: 8px 10px max(8px,env(safe-area-inset-bottom)); gap: 8px; }
  .reader-progress-info { font-size: 0.875rem; gap: 4px; }
  .reader-bottombar .r-button { font-size: 0.875rem; padding: 8px; min-height: 44px; }
  .audio-panel { padding: 10px 12px; }
  .audio-heading { gap: 8px; }
  .audio-heading > div { min-width: 0; }
  .audio-heading .eyebrow { display: none; }
  .audio-controls { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 8px; }
  .audio-voice-label { grid-column: 1 / 3; }
  #audio-sample { grid-column: 3; padding: 4px; overflow-wrap: anywhere; }
  .audio-options { flex-direction: column; align-items: stretch; gap: 12px; }
  .audio-options label { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .header-container { padding: 10px 16px; }
  .header-container .mobile-menu-toggle { padding: 8px 10px; }
  .mobile-menu-toggle .library-art { display: none; }
  .main-wrapper { padding: 20px 16px 40px; }
  .sanctuary-hero { padding: 20px; gap: 18px; margin-bottom: 24px; }
  .hero-copy h2 { font-size: clamp(26px,7vw,32px); }
  .home-search-filters { grid-template-columns: 1fr; }
  .search-suggestions { gap: 8px; }
  .search-suggestions > span { display: none; }
  .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .section-heading h2 { font-size: 1.5rem; }
  .featured-books { gap: 12px; }
  .featured-book { padding: 8px; border-radius: 10px; }
  .book-cover { min-height: 290px; padding: 20px 12px; }
  .book-cover h3 { font-size: 1.25rem; overflow-wrap: break-word; }
  .featured-actions { grid-template-columns: 1fr; }
  .daithua-grid, .catalog-card-view { grid-template-columns: 1fr; }
  .daithua-card { padding: 20px; }
  .daithua-title { font-size: 1.375rem; }
  .catalog-select { flex-direction: column; align-items: stretch; gap: 8px; }
  .catalog-select select { min-width: 0; width: 100%; }
  #tab-daithua > div:first-child, #tab-daitanghan > div:first-child { flex-wrap: wrap; gap: 12px; }
  .search-result-row { flex-wrap: wrap; padding: 12px; }
  .global-result { flex-basis: 100%; }
  .global-result strong { font-size: 1.25rem; }
  .card-personal-tools { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 360px) {
  .featured-books { grid-template-columns: 1fr; }
  .book-cover { min-height: 260px; }
  .reader-topbar { padding: 8px; gap: 8px; }
  .reader-toolstrip { padding: 8px; gap: 6px; }
}

/* ══════════════════════════════════════════════════
   P1: Sutra Context Card (Thẻ Ngữ Cảnh Kinh Điển)
   ══════════════════════════════════════════════════ */
.sutra-context-card { margin: 0 0 28px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-surface-elevated, var(--bg-app)); overflow: hidden; }
.context-summary { display: flex; align-items: center; gap: 10px; padding: 14px 20px; cursor: pointer; font: 600 0.875rem/1.6 var(--font-body); color: var(--text-secondary); list-style: none; user-select: none; }
.context-summary::-webkit-details-marker { display: none; }
.context-summary::before { content: '▸'; font-size: 0.875rem; transition: transform .2s; }
.sutra-context-card[open] .context-summary::before { transform: rotate(90deg); }
.context-icon { font-size: 1rem; }
.context-time { margin-left: auto; font-weight: 400; font-size: 0.875rem; color: var(--text-muted); white-space: nowrap; }
.context-body { padding: 0 20px 20px; display: grid; gap: 10px; font-size: 0.875rem; line-height: 1.85; }
.context-row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: baseline; }
.context-label { font-weight: 600; color: var(--text-secondary); font-size: 0.875rem; letter-spacing: .03em; }
.context-themes { display: flex; flex-wrap: wrap; gap: 6px; }
.context-theme-tag { display: inline-block; padding: 4px 10px; border-radius: 20px; background: var(--zen-emerald-light, #e8f0e8); color: var(--accent); font-size: 0.875rem; font-weight: 500; }
.context-significance { padding: 14px 16px; margin-top: 6px; border-left: 3px solid var(--accent); background: var(--bg-app); border-radius: 0 8px 8px 0; font: italic 13px/1.9 var(--font-serif); color: var(--text-primary); }
.context-related { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.context-related-btn { background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--accent); padding: 6px 12px; border-radius: 8px; font-size: 0.875rem; cursor: pointer; transition: all .15s; }
.context-related-btn:hover { background: var(--accent); color: var(--on-accent, #fff); border-color: var(--accent); }
@media (max-width: 640px) {
  .context-row { grid-template-columns: 1fr; gap: 3px; }
  .context-time { display: none; }
  .context-body { padding: 0 14px 14px; }
  .context-summary { padding: 12px 14px; font-size: 0.875rem; }
}

/* ══════════════════════════════════════
   P4: Search Highlight
   ══════════════════════════════════════ */
.search-hl, mark.search-hl { background: #ffd54f40; color: inherit; padding: 1px 2px; border-radius: 3px; border-bottom: 2px solid var(--accent, #28634e); }
.search-hit .search-hl { background: #ffd54f55; font-weight: 600; }
[data-theme="night"] .search-hl, [data-theme="night"] mark.search-hl { background: #ffd54f25; border-bottom-color: #d4af37; }

/* ══════════════════════════════════════
   P8: Audio Chapter Selector
   ══════════════════════════════════════ */
#audio-chapter { min-height: 44px; font-size: 0.875rem; min-width: 150px; max-width: 280px; }

/* ══════════════════════════════════════
   P9: A-B Repeat Button
   ══════════════════════════════════════ */
#audio-repeat-ab { font-size: 0.875rem; min-height: 44px; white-space: nowrap; border-color: var(--accent); color: var(--accent); }
#audio-repeat-ab:hover { background: var(--zen-emerald-light); }
.audio-panel[data-status] #audio-repeat-ab { flex-shrink: 0; }

/* ══════════════════════════════════════
   Speaking Block Highlight (Audio Follow)
   ══════════════════════════════════════ */
.speaking-block { position: relative; }
.speaking-block::after { content: ''; position: absolute; left: -6px; top: 0; bottom: 0; width: 3px; background: var(--accent); border-radius: 3px; animation: speaking-pulse 1.5s ease-in-out infinite; }
@keyframes speaking-pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
:root.reduced-motion .speaking-block::after { animation: none; opacity: .7; }

/* ══════════════════════════════════════
   P7: Reading Roadmap Cards
   ══════════════════════════════════════ */
.reading-paths { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: start; gap: 18px; margin-top: 20px; }
.path-card { --path-tone: var(--accent); min-width: 0; overflow: hidden; border: 1px solid var(--border-subtle); border-radius: 16px; background: var(--bg-surface); box-shadow: 0 12px 35px rgba(35,61,50,.055); }
.path-card:nth-child(2) { --path-tone: var(--gold-dark); }
.path-card:nth-child(3) { --path-tone: var(--cover-blue); }
.path-card-header { position: relative; padding: 24px 24px 20px; border-bottom: 1px solid var(--border-subtle); background: linear-gradient(145deg,var(--bg-surface-elevated),var(--bg-surface) 72%); }
.path-card-header::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--path-tone); }
.path-heading { display: flex; align-items: center; gap: 13px; min-width: 0; }
.path-seal { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; border: 1px solid color-mix(in srgb,var(--path-tone) 50%,var(--border-subtle)); border-radius: 50%; color: var(--path-tone); background: var(--bg-surface); font: 500 1.125rem/1 var(--font-serif); }
.path-kicker { display: block; margin-bottom: 3px; color: var(--path-tone); font-size: 0.75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.path-card h3 { margin: 0; color: var(--text-primary); font: 500 1.25rem/1.45 var(--font-serif); letter-spacing: -.015em; }
.path-card-header > p { min-height: 3.2em; margin: 16px 0 17px; color: var(--text-secondary); font-size: 0.875rem; line-height: 1.65; }
.path-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.path-actions > span { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.path-listen-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 13px; border: 1px solid var(--path-tone); border-radius: 9px; color: var(--path-tone); background: transparent; font-size: 0.8125rem; font-weight: 650; cursor: pointer; transition: color .15s,background .15s,transform .15s; }
.path-listen-button:hover { color: var(--on-accent); background: var(--path-tone); transform: translateY(-1px); }
.path-steps { padding: 8px 16px 14px; }
.path-step { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 15px 8px; border-bottom: 1px solid var(--border-subtle); transition: background .15s; }
.path-step:last-child { border-bottom: 0; }
.path-step:hover { background: var(--bg-surface-elevated); }
.path-step-marker { position: relative; align-self: stretch; display: flex; justify-content: center; padding-top: 3px; }
.path-step-marker > span { position: relative; z-index: 1; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--path-tone); border-radius: 50%; color: var(--path-tone); background: var(--bg-surface); font-size: 0.75rem; font-weight: 700; }
.path-step:not(:last-child) .path-step-marker::after { content: ''; position: absolute; top: 35px; bottom: -19px; left: 50%; width: 1px; background: color-mix(in srgb,var(--path-tone) 35%,var(--border-subtle)); }
.path-step-info { min-width: 0; }
.path-step-info small { display: block; margin-bottom: 2px; color: var(--path-tone); font-size: 0.6875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.path-step-info strong { display: block; color: var(--text-primary); font: 500 0.9375rem/1.45 var(--font-serif); overflow-wrap: anywhere; }
.path-step-info span { display: block; margin-top: 3px; color: var(--text-muted); font-size: 0.8125rem; line-height: 1.55; overflow-wrap: anywhere; }
.path-step .path-read-button { flex-shrink: 0; min-height: 40px; padding: 7px 10px; border-color: transparent; color: var(--path-tone); background: transparent; font-size: 0.8125rem; font-weight: 650; }
.path-step .path-read-button:hover { border-color: var(--border-subtle); background: var(--bg-surface); }
@media (max-width: 1100px) {
  .reading-paths { grid-template-columns: 1fr; }
  .path-card-header > p { min-height: 0; }
}
@media (max-width: 640px) {
  .reading-paths { gap: 16px; }
  .path-card-header { padding: 20px 18px 18px; }
  .path-card h3 { font-size: 1.125rem; }
  .path-actions { align-items: stretch; flex-direction: column; }
  .path-actions > span { padding-left: 2px; }
  .path-listen-button { width: 100%; }
  .path-steps { padding: 6px 10px 10px; }
  .path-step { grid-template-columns: 34px minmax(0,1fr); gap: 9px; padding: 14px 6px; }
  .path-step .path-read-button { grid-column: 2; justify-self: start; min-height: 36px; margin-top: 2px; padding: 5px 9px; }
  .path-step:not(:last-child) .path-step-marker::after { bottom: -58px; }
}

/* ══════════════════════════════════════
   Collection Player — Nghe Trọn Bộ
   ══════════════════════════════════════ */
.collection-player { position: relative; flex-shrink: 0; max-height: 36dvh; overflow: auto; background: var(--bg-surface); border-top: 1px solid var(--border-gold); padding: 12px 24px; display: grid; gap: 10px; }
@keyframes cp-slide-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cp-header { display: flex; align-items: center; gap: 14px; }
.cp-icon { font-size: 1.625rem; }
.cp-info { flex: 1; min-width: 0; }
.cp-title-row { display: flex; align-items: center; gap: 10px; }
.cp-title-row strong { font: 600 1rem/1.4 var(--font-body); color: var(--text-primary); white-space: normal; overflow-wrap: anywhere; }
.cp-badge { font: 600 0.875rem/1 var(--font-mono, monospace); color: var(--accent); background: var(--zen-emerald-light, #e8f0e8); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--accent); }
.cp-clock-row { font-size: 0.875rem; color: var(--text-secondary); margin-top: 3px; }
.cp-time-grid { display: flex; gap: 8px; }
.cp-time-box { text-align: right; background: var(--zen-emerald-light, #e8f0e8); border-radius: 8px; padding: 6px 12px; border: 1px solid rgba(40,99,78,0.2); }
.cp-time-remain-box { background: rgba(212,175,55,0.15); border-color: rgba(212,175,55,0.35); }
.cp-time-label { font: 700 0.875rem/1 var(--font-body); color: var(--text-secondary); letter-spacing: .05em; margin-bottom: 2px; }
.cp-timer { font: 700 1.125rem/1 var(--font-mono, monospace); color: var(--accent); letter-spacing: .02em; }
.cp-remaining { font: 700 1.125rem/1 var(--font-mono, monospace); color: var(--gold-dark); letter-spacing: .02em; }

.cp-now-playing { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(0,0,0,0.03); padding: 6px 12px; border-radius: 6px; }
.cp-now-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.cp-live-indicator { font-size: 0.875rem; color: var(--accent); font-weight: 600; white-space: nowrap; animation: cp-pulse 1.5s ease infinite; }
.cp-now-left strong { font: 600 0.875rem/1.4 var(--font-serif); color: var(--text-primary); white-space: normal; overflow-wrap: anywhere; }
.cp-sutra-timing { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 0.875rem; }
#cp-sutra-chunk { font: 500 0.875rem/1 var(--font-mono, monospace); color: var(--text-secondary); }
.cp-sutra-time { font: 600 0.875rem/1 var(--font-mono, monospace); color: var(--accent); background: var(--zen-emerald-light, #e8f0e8); padding: 3px 8px; border-radius: 6px; }

.cp-progress-group { display: grid; gap: 4px; }
.cp-progress-bar { height: 4px; background: var(--border-subtle); border-radius: 2px; overflow: hidden; }
.cp-overall-bar { height: 5px; }
.cp-sutra-bar { height: 3px; opacity: .85; }
.cp-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .4s ease; }
.cp-sutra-bar .cp-progress-fill { background: #d4af37; }

.cp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cp-controls .r-button, .cp-controls .r-primary { min-height: 44px; font-size: 0.875rem; padding: 8px 14px; }
.cp-controls #cp-close { margin-left: auto; min-width: 40px; padding: 8px; }

.btn-listen-collection { font-size: 0.875rem; font-weight: 600; color: var(--on-accent); background: var(--accent); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 16px; min-height: 44px; cursor: pointer; white-space: normal; text-align: left; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 6px rgba(40,99,78,0.25); }
.btn-listen-collection:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(40,99,78,0.35); filter: brightness(1.08); }
.btn-listen-collection:disabled { opacity: 0.55; cursor: not-allowed; background: var(--bg-hover, #ccc); color: var(--text-secondary); border-color: var(--border-subtle); box-shadow: none; }

.cp-playlist { max-height: 240px; overflow-y: auto; border-top: 1px solid var(--border-subtle); padding-top: 8px; }
.cp-pl-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 0.875rem; transition: background .15s; }
.cp-pl-item:hover { background: var(--bg-hover, #f5f5f5); }
.cp-pl-active { background: var(--zen-emerald-light, #e8f0e8) !important; font-weight: 600; }
.cp-pl-done { opacity: .75; }
.cp-pl-num { min-width: 24px; text-align: center; font: 700 0.875rem/1 var(--font-mono, monospace); color: var(--text-secondary); }
.cp-pl-col { flex: 1; display: grid; gap: 2px; min-width: 0; }
.cp-pl-title { white-space: normal; overflow-wrap: anywhere; }
.cp-pl-status { font: 500 0.875rem/1 var(--font-mono, monospace); }
.cp-pl-status.is-done { color: var(--accent); }
.cp-pl-status.is-current { color: var(--accent); font-weight: 700; }
.cp-pl-status.is-pending { color: var(--text-secondary); }
.cp-pl-jump { background: none; border: 1px solid var(--accent); border-radius: 4px; padding: 3px 10px; font-size: 0.875rem; cursor: pointer; color: var(--accent); font-weight: 600; white-space: nowrap; }
.cp-pl-jump:hover { background: var(--accent); color: var(--on-accent); }
.cp-pl-playing { color: var(--accent); font-size: 1rem; animation: cp-pulse 1.5s ease infinite; }
@keyframes cp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Prominent Collection Launcher Section */
.collection-launcher-card { background: linear-gradient(135deg, rgba(40,99,78,0.08) 0%, rgba(212,175,55,0.12) 100%); border: 1px solid rgba(212,175,55,0.4); border-radius: 14px; padding: 20px 24px; margin-bottom: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
.cl-header { margin-bottom: 16px; }
.cl-badge { display: inline-flex; align-items: center; gap: 6px; font: 700 0.875rem/1 var(--font-mono, monospace); color: var(--accent); background: rgba(40,99,78,0.12); padding: 5px 10px; border-radius: 20px; letter-spacing: .05em; margin-bottom: 8px; }
.cl-title { font: 700 1.25rem/1.3 var(--font-serif); color: var(--text-primary); margin: 0 0 6px; }
.cl-desc { font-size: 0.875rem; line-height: 1.6; color: var(--text-secondary); margin: 0; max-width: 820px; }
.cl-quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cl-pill-card { display: flex; align-items: center; gap: 14px; background: var(--bg-surface); border: 1px solid var(--border-gold); border-radius: 12px; padding: 14px 16px; text-align: left; cursor: pointer; transition: all .24s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.cl-pill-card:hover { border-color: var(--gold-pure); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(212,175,55,0.18); background: var(--bg-surface-elevated); }
.cl-pill-icon { font-size: 1.5rem; flex-shrink: 0; }
.cl-pill-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cl-pill-text strong { font: 600 0.875rem/1.35 var(--font-body); color: var(--text-primary); white-space: normal; }
.cl-pill-text span { font-size: 0.875rem; line-height: 1.4; color: var(--text-secondary); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cl-pill-btn { font: 600 0.875rem/1 var(--font-body); color: var(--on-accent); background: var(--gold-gradient); padding: 8px 12px; border-radius: 8px; white-space: nowrap; flex-shrink: 0; box-shadow: 0 2px 6px rgba(180,83,9,0.25); transition: all 0.2s; }
.cl-pill-card:hover .cl-pill-btn { filter: brightness(1.1); transform: scale(1.02); }

/* Mindful Breathing Halo Animation & Ambient Sound */
.breathing-circle-outer { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 240px; height: 240px; margin: 0 auto 24px; border-radius: 50%; border: 3px solid var(--border-gold); background: var(--bg-surface); box-shadow: 0 4px 30px rgba(212, 175, 55, 0.12); transition: all 1s ease-in-out; }
.breathing-halo { position: absolute; inset: -12px; border-radius: 50%; border: 2px dashed var(--gold-pure); opacity: 0.35; transition: transform 3s ease-in-out, opacity 3s ease-in-out; pointer-events: none; }
.breathing-prompt { font-size: 0.875rem; color: var(--gold-dark); font-weight: 600; letter-spacing: 0.04em; margin-top: 8px; max-width: 190px; text-align: center; min-height: 32px; display: flex; align-items: center; justify-content: center; transition: color 0.5s; }
.breathing-circle-outer[data-phase="inhale"] { transform: scale(1.08); border-color: var(--gold-pure); box-shadow: 0 0 35px rgba(212, 175, 55, 0.35); }
.breathing-circle-outer[data-phase="inhale"] .breathing-halo { transform: scale(1.15) rotate(45deg); opacity: 0.8; }
.breathing-circle-outer[data-phase="hold"] { transform: scale(1.08); border-color: var(--accent); box-shadow: 0 0 40px rgba(40, 99, 78, 0.3); }
.breathing-circle-outer[data-phase="hold"] .breathing-halo { transform: scale(1.15) rotate(90deg); opacity: 0.6; }
.breathing-circle-outer[data-phase="exhale"] { transform: scale(0.96); border-color: var(--gold-dark); box-shadow: 0 0 20px rgba(212, 175, 55, 0.15); }
.breathing-circle-outer[data-phase="exhale"] .breathing-halo { transform: scale(1.0) rotate(180deg); opacity: 0.4; }
.breathing-circle-outer[data-phase="rest"] { transform: scale(1.0); border-color: var(--border-gold); }
.breathing-circle-outer[data-phase="rest"] .breathing-halo { transform: scale(1.02) rotate(270deg); opacity: 0.3; }

.timer-ambient-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 18px 0 24px; font-size: 0.875rem; color: var(--text-secondary); }
.ambient-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ambient-btn { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 20px; padding: 6px 14px; font-size: 0.875rem; cursor: pointer; color: var(--text-secondary); transition: all 0.2s; }
.ambient-btn:hover { border-color: var(--gold-pure); color: var(--gold-dark); }
.ambient-btn.active { background: var(--gold-gradient); color: var(--on-accent); border-color: transparent; font-weight: 600; box-shadow: 0 2px 8px rgba(180, 83, 9, 0.25); }

@media (max-width: 640px) {
  .collection-player { padding: 10px 14px; gap: 8px; }
  .cp-header { flex-wrap: wrap; }
  .cp-time-grid { width: 100%; justify-content: space-between; }
  .cp-timer, .cp-remaining { font-size: 0.9375rem; }
  .cp-title-row strong { font-size: 0.875rem; }
  .cp-controls .r-button, .cp-controls .r-primary { min-height: 44px; font-size: 0.875rem; padding: 6px 10px; }
  .cp-playlist { max-height: 160px; }
  .cl-quick-grid { grid-template-columns: 1fr; }
}

[data-theme="night"] .collection-player { background: #1a2220; border-top-color: #388e6c; box-shadow: 0 -10px 40px rgba(0,0,0,0.6); }
[data-theme="night"] .cp-time-box { background: #28634e30; border-color: #28634e50; }
[data-theme="night"] .cp-time-remain-box { background: #d4af3720; border-color: #d4af3740; }
[data-theme="night"] .cp-remaining { color: #f0c050; }
[data-theme="night"] .cp-sutra-time { background: #28634e30; }
[data-theme="night"] .cp-pl-active { background: #28634e30 !important; }
[data-theme="night"] .cp-pl-item:hover { background: #ffffff10; }
[data-theme="night"] .collection-launcher-card { background: linear-gradient(135deg, rgba(40,99,78,0.15) 0%, rgba(212,175,55,0.1) 100%); border-color: rgba(212,175,55,0.25); }
[data-theme="night"] .cl-pill-card { background: #1c2623; border-color: #2e3d38; }

.collection-active:has(#audio-panel:not([hidden])) .collection-player { display: none; }
