:root {
    --bg: #fdfdfd;
    --surface: #fdfdfd;
    --surface-alt: #f4f1ea;
    --text: #3d281f;
    --muted: #8f8f8f;
    --primary: #563628;
    --primary-hover: #3d251b;
    --accent: #b89f65;
    --nude: #d4c59c;
    --border: #e5dec9;
    --shadow: 0 2px 10px rgba(86, 54, 40, 0.06);
    --font-size: 18px;
}
body.dark {
    --bg: #17120f;
    --surface: #231914;
    --surface-alt: #2d2019;
    --text: #fdfdfd;
    --muted: #b8afa6;
    --primary: #d4c59c;
    --primary-hover: #c2b07e;
    --accent: #b89f65;
    --nude: #d4c59c;
    --border: #3d2b22;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.42);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    -webkit-text-size-adjust: 100%;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background 0.2s, color 0.2s;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: #563628;
    color: #fdfdfd;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}
body.dark .topbar {
    background: #231914;
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0.65rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    justify-content: space-between;
}
.logo {
    color: #fdfdfd !important;
    text-decoration: none !important;
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.logo span { color: #d4c59c; }
.nav-controls { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.nav-controls select {
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    border: 1px solid #d4c59c;
    font-size: 0.92rem;
    background: #fdfdfd;
    color: #3d281f;
    font-weight: 600;
    cursor: pointer;
}

.search-wrapper { position: relative; flex: 1; min-width: 240px; max-width: 390px; }
.search-bar { display: flex; width: 100%; }
.search-bar input {
    flex: 1;
    padding: 0.48rem 0.75rem;
    border: none;
    border-radius: 6px 0 0 6px;
    font-size: 0.92rem;
    outline: none;
    background: #fdfdfd;
    color: #3d281f;
}
.search-bar button {
    background: #8f8f8f;
    color: #fdfdfd;
    border: none;
    padding: 0 0.9rem;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s;
}
.search-bar button:hover { background: #d4c59c; color: #3d281f; }

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 28px rgba(86, 54, 40, 0.22);
    max-height: 340px;
    overflow-y: auto;
    z-index: 250;
}
.autocomplete-dropdown[hidden] { display: none; }
.ac-item {
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: block;
    color: var(--text);
    font-size: 0.88rem;
}
.ac-item:hover { background: rgba(212, 197, 156, 0.28); text-decoration: none; }
.ac-item strong { color: var(--primary); }
.ac-tag {
    float: right;
    font-size: 0.72rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    color: var(--muted);
}

.tool-btns { display: flex; gap: 0.35rem; }
.tool-btns button {
    background: rgba(253, 253, 253, 0.14);
    color: #fdfdfd;
    border: 1px solid rgba(212, 197, 156, 0.35);
    padding: 0.45rem 0.65rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
}
.tool-btns button:hover { background: rgba(212, 197, 156, 0.3); }

.ad-container { max-width: 1260px; margin: 0.75rem auto; padding: 0 1rem; text-align: center; }
.ad-banner-slot {
    min-height: 90px;
    background: var(--surface-alt);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.78rem;
}
.ad-incontent-slot {
    min-height: 100px;
    margin: 1.5rem 0;
    background: var(--surface-alt);
    border: 1px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.78rem;
}

.page-wrapper {
    max-width: 1260px;
    margin: 1rem auto 2.5rem;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 255px 1fr 315px;
    gap: 1.25rem;
    align-items: start;
}
.sidebar-left {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.9rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
}
.testament-tabs { display: flex; gap: 4px; margin-bottom: 0.65rem; }
.t-tab {
    flex: 1;
    padding: 0.35rem 0.25rem;
    font-size: 0.76rem;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
}
.t-tab.active {
    background: #563628;
    color: #fdfdfd;
    border-color: #563628;
}
body.dark .t-tab.active {
    background: #d4c59c;
    color: #231914;
    border-color: #d4c59c;
}
.book-nav-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; }
.book-nav-list li a {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    text-decoration: none;
}
.book-nav-list li a:hover, .book-nav-list li a.active {
    background: rgba(212, 197, 156, 0.32);
    color: var(--primary);
    font-weight: 700;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
    box-shadow: var(--shadow);
}
.breadcrumbs { font-size: 0.84rem; color: var(--muted); margin-bottom: 0.6rem; }
.chapter-top { border-bottom: 2px solid var(--border); padding-bottom: 0.9rem; margin-bottom: 1.1rem; }
.chapter-top h1 { margin: 0 0 0.35rem 0; font-size: 1.75rem; color: var(--primary); }
.chapter-summary { margin: 0; font-size: 0.92rem; color: var(--muted); font-style: italic; }

.chap-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.chap-pill {
    min-width: 38px;
    height: 36px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none !important;
}
.chap-pill:hover, .chap-pill.active {
    background: #563628;
    color: #fdfdfd !important;
    border-color: #563628;
}
body.dark .chap-pill:hover, body.dark .chap-pill.active {
    background: #d4c59c;
    color: #231914 !important;
    border-color: #d4c59c;
}

.verse {
    -webkit-text-size-adjust: 100%;
    font-size: var(--font-size);
    line-height: 1.78;
    padding: 0.48rem 0.68rem;
    border-radius: 6px;
    margin-bottom: 0.35rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(143, 143, 143, 0.16);
    transition: background 0.15s;
    display: block;
}
.verse:hover { background: rgba(212, 197, 156, 0.18); }
.verse.selected {
    outline: 2px solid var(--accent);
    background: rgba(212, 197, 156, 0.25);
}
.v-num {
    font-weight: 800;
    color: var(--primary);
    font-size: 0.78em;
    margin-right: 0.5rem;
    vertical-align: super;
    user-select: none;
}
.hl-yellow { background: rgba(212, 197, 156, 0.52) !important; }
.hl-green { background: rgba(143, 143, 143, 0.24) !important; }
.hl-blue { background: rgba(86, 54, 40, 0.16) !important; }

.verse .inline-explain-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.55rem;
    padding: 0.14rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f4f1ea;
    color: #563628;
    border: 1px solid #d4c59c;
    border-radius: 20px;
    vertical-align: middle;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.verse .inline-explain-tag:hover,
.verse.selected .inline-explain-tag {
    background: #563628;
    color: #fdfdfd;
    border-color: #563628;
}
body.dark .verse .inline-explain-tag {
    background: #2d2019;
    color: #d4c59c;
    border-color: #563628;
}
body.dark .verse .inline-explain-tag:hover,
body.dark .verse.selected .inline-explain-tag {
    background: #d4c59c;
    color: #231914;
}

.chapter-nav-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}
.nav-btn {
    background: #563628;
    color: #fdfdfd !important;
    padding: 0.65rem 1.15rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-btn:hover { background: #3d251b; }
body.dark .nav-btn {
    background: #d4c59c;
    color: #231914 !important;
}

.sidebar-right { display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 72px; }
.widget-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.15rem;
    box-shadow: var(--shadow);
}
.widget-box h3 {
    margin: 0 0 0.65rem 0;
    font-size: 1.02rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.45rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.devotional-card {
    background: linear-gradient(145deg, rgba(212, 197, 156, 0.24) 0%, rgba(244, 241, 234, 0.85) 100%);
    border-left: 4px solid #563628;
}
body.dark .devotional-card {
    background: linear-gradient(145deg, rgba(212, 197, 156, 0.12) 0%, rgba(35, 25, 20, 0.95) 100%);
    border-left-color: #d4c59c;
}
.devo-badge {
    font-size: 0.72rem;
    background: #563628;
    color: #fdfdfd;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
}
body.dark .devo-badge {
    background: #d4c59c;
    color: #231914;
}
.devo-title { font-weight: 800; font-size: 1.05rem; margin: 0.25rem 0 0.45rem; color: var(--text); }
.devo-body { font-size: 0.9rem; color: var(--text); margin: 0 0 0.65rem 0; line-height: 1.55; }
.votd-quote { font-style: italic; font-size: 0.95rem; margin: 0 0 0.55rem 0; }
.votd-ref { font-weight: 700; font-size: 0.86rem; color: var(--muted); display: block; margin-bottom: 0.7rem; }
.widget-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-sm {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.38rem 0.68rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
}
.btn-sm:hover {
    background: #563628;
    color: #fdfdfd !important;
    border-color: #563628;
}
body.dark .btn-sm:hover {
    background: #d4c59c;
    color: #231914 !important;
    border-color: #d4c59c;
}
.quick-links { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.quick-links a { display: block; padding: 0.4rem 0.6rem; background: var(--surface-alt); border-radius: 6px; font-size: 0.86rem; font-weight: 600; }

.home-hero {
    background: linear-gradient(135deg, #563628 0%, #7a523e 100%);
    color: #fdfdfd;
    padding: 1.65rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}
.home-hero h1 { margin: 0 0 0.5rem 0; font-size: 1.65rem; color: #fdfdfd; }
.home-hero p { margin: 0 0 1rem 0; opacity: 0.94; font-size: 0.98rem; }
.home-devotional-box {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-left: 5px solid #563628;
    border-radius: 10px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.75rem;
}
body.dark .home-devotional-box {
    border-left-color: #d4c59c;
}
.home-devotional-box h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 0.55rem; margin: 0.85rem 0 1.75rem; }
.book-card-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.75rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    text-decoration: none !important;
}
.book-card-link:hover {
    border-color: var(--primary);
    background: rgba(212, 197, 156, 0.28);
    color: var(--primary);
}
.book-card-link span {
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--surface);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.scroll-top-btn {
    position: fixed;
    right: 1.35rem;
    bottom: 1.35rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #563628;
    color: #fdfdfd;
    border: 2px solid #d4c59c;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28);
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
    z-index: 260;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s, background 0.2s;
}
.scroll-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { background: #3d251b; transform: translateY(-3px); }
body.dark .scroll-top-btn {
    background: #d4c59c;
    color: #231914;
    border-color: #fdfdfd;
}












.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(23, 18, 15, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 400;
    padding: 1rem;
}
.modal-backdrop[hidden] { display: none; }
.modal-box {
    background: var(--surface);
    color: var(--text);
    width: 100%;
    max-width: 680px;
    max-height: 82vh;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0,0,0,0.35);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}
.modal-header h2 { margin: 0; font-size: 1.25rem; color: var(--primary); }
.search-result-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: block;
    color: var(--text);
}
.search-result-item:hover { background: var(--surface-alt); text-decoration: none; }
.search-result-item strong { color: var(--primary); }

.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
}

@media (max-width: 1060px) {
    .page-wrapper { grid-template-columns: 240px 1fr; }
    .sidebar-right { grid-column: 1 / -1; position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar-right > * { flex: 1; min-width: 275px; }
}
@media (max-width: 760px) {
    .page-wrapper { grid-template-columns: 1fr; }
    .sidebar-left { display: none; }
    .content-card { padding: 1.15rem; }
}


.ad-sponsor-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
}
.inst-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.inst-section:last-child { border-bottom: none; }
.inst-section h2 {
    margin: 0 0 0.55rem 0;
    font-size: 1.22rem;
    color: var(--primary);
}
.seo-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.5rem;
    margin: 0.75rem 0 1.25rem;
}
.seo-topic-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.8rem;
    font-size: 0.86rem;
}
.seo-topic-card strong {
    display: block;
    color: var(--primary);
    margin-bottom: 0.2rem;
}
.seo-topic-card span {
    color: var(--muted);
    font-size: 0.8rem;
}
.wa-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #563628;
    color: #fdfdfd !important;
    padding: 0.7rem 1.25rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.94rem;
    border: 1px solid #d4c59c;
    text-decoration: none !important;
}
.wa-cta-btn:hover { background: #3d251b; }


.seo-topic-card {
    cursor: pointer;
    transition: transform 0.14s, border-color 0.14s, background 0.14s;
}
.seo-topic-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: rgba(212, 197, 156, 0.22);
}
.seo-topic-card .topic-go {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
}




.modal-box {
    padding: 0 1.5rem 1.5rem 1.5rem !important;
}
.modal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    padding: 1.15rem 0 0.8rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.modal-header button {
    background: #563628;
    color: #fdfdfd;
    border: 1px solid #d4c59c;
    font-weight: 700;
    padding: 0.42rem 0.8rem;
    border-radius: 8px;
    flex-shrink: 0;
}
body.dark .modal-header button {
    background: #d4c59c;
    color: #231914;
}


.tool-btns button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Floating Verse Action Bar — Desktop & Mobile Portrait Optimized */
.action-bar {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #3d281f;
    color: #fdfdfd;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #d4c59c;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    z-index: 300;
    max-width: 96vw;
    flex-wrap: nowrap;
}
.action-bar[hidden] {
    display: none !important;
}
#actionRef {
    font-size: 0.82rem;
    font-weight: 800;
    color: #d4c59c;
    white-space: nowrap;
}
.action-bar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: rgba(253, 253, 253, 0.14);
    color: #fdfdfd;
    border: none;
    padding: 0.34rem 0.62rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}
.action-bar button:hover {
    background: rgba(212, 197, 156, 0.3);
}
.action-bar .btn-explain-highlight {
    background: #d4c59c !important;
    color: #3d281f !important;
    font-weight: 800 !important;
}
.action-bar .clear-hl-btn {
    color: #e2d9c8;
}
.action-bar .close-bar-btn {
    background: #991b1b !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}
.action-bar .dot {
    width: 17px !important;
    height: 17px !important;
    min-width: 17px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
}
body:has(.action-bar:not([hidden])) .scroll-top-btn {
    opacity: 0 !important;
    pointer-events: none !important;
}

@media (max-width: 760px) {
    .action-bar {
        bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
        left: 0.45rem;
        right: 0.45rem;
        transform: none;
        width: auto;
        max-width: calc(100vw - 0.9rem);
        border-radius: 14px;
        padding: 0.45rem 0.5rem;
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.35rem 0.25rem;
    }
    /* Row 1: Reference + 3 color dots + clear on left, Close button on right */
    #actionRef {
        order: 1;
        font-size: 0.78rem;
        margin-right: 0.2rem;
    }
    .action-bar .dot {
        order: 2;
        display: inline-flex !important;
        width: 16px !important;
        height: 16px !important;
        min-width: 16px !important;
    }
    .action-bar .clear-hl-btn {
        order: 3;
        display: inline-flex !important;
        padding: 0.2rem 0.42rem !important;
        font-size: 0.68rem !important;
        margin-right: auto;
    }
    .action-bar .close-bar-btn {
        order: 4;
        margin-left: auto;
        padding: 0.24rem 0.58rem !important;
        font-size: 0.72rem !important;
    }
    /* Row 2: 4 equal action buttons filling 100% cleanly */
    .action-bar button:not(.dot):not(.clear-hl-btn):not(.close-bar-btn) {
        order: 10;
        flex: 1 1 calc(25% - 0.25rem);
        max-width: calc(25% - 0.18rem);
        padding: 0.38rem 0.15rem;
        font-size: 0.7rem;
        border-radius: 8px;
        gap: 0.18rem;
    }
}


/* Install App Button & Mobile PWA Banner */
.install-app-btn {
    background: #d4c59c !important;
    color: #3d281f !important;
    font-weight: 800 !important;
    border: 1px solid #fdfdfd !important;
}
.install-app-btn:hover {
    background: #e5d8b5 !important;
}
.pwa-install-banner {
    position: fixed;
    bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    left: 0.65rem;
    right: 0.65rem;
    max-width: 460px;
    margin: 0 auto;
    background: #3d281f;
    color: #fdfdfd;
    border: 1px solid #d4c59c;
    border-radius: 14px;
    padding: 0.75rem 0.9rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
    z-index: 290;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.pwa-install-banner[hidden] {
    display: none !important;
}
.pwa-install-banner img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
    border: 1px solid #d4c59c;
}
.pwa-banner-info {
    flex: 1;
    min-width: 0;
}
.pwa-banner-info strong {
    display: block;
    font-size: 0.88rem;
    color: #d4c59c;
    line-height: 1.25;
}
.pwa-banner-info span {
    display: block;
    font-size: 0.76rem;
    color: #f4f1ea;
    line-height: 1.3;
    margin-top: 0.15rem;
}
.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.pwa-btn-open {
    background: #d4c59c;
    color: #3d281f;
    border: none;
    border-radius: 8px;
    padding: 0.42rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.pwa-btn-close {
    background: rgba(253, 253, 253, 0.16);
    color: #fdfdfd;
    border: none;
    border-radius: 8px;
    padding: 0.42rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.install-steps-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.install-steps-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    font-size: 0.92rem;
}
.step-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #563628;
    color: #fdfdfd;
    font-weight: 800;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
body.dark .step-badge {
    background: #d4c59c;
    color: #231914;
}

/* Portrait Mobile Refinement for Action Bar: tight, zero loose whitespace */
@media (max-width: 760px) {
    .action-bar {
        padding: 0.4rem 0.45rem !important;
        gap: 0.3rem 0.2rem !important;
    }
    .action-bar button:not(.dot):not(.clear-hl-btn):not(.close-bar-btn) {
        flex: 1 1 calc(25% - 0.18rem) !important;
        max-width: calc(25% - 0.15rem) !important;
        padding: 0.4rem 0.1rem !important;
        font-size: 0.68rem !important;
        gap: 0.15rem !important;
    }
}
