/* MS-SQL backup admin */
.sql-backup-shell {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
}

.sql-backup-panel {
    padding: 1.25rem;
}

.sql-backup-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
    margin: 1rem 0;
}

.sql-backup-card {
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .86);
    padding: .8rem .9rem;
    display: grid;
    gap: .25rem;
}

.sql-backup-card strong {
    overflow-wrap: anywhere;
}

.sql-backup-card small,
.sql-backup-label {
    color: rgba(15, 23, 42, .66);
}

.sql-backup-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.sql-backup-actions {
    margin: 1rem 0;
}

.sql-backup-source-list {
    display: grid;
    gap: .5rem;
    margin-top: 1rem;
}

.sql-backup-source-row {
    display: grid;
    gap: .2rem;
    border: 1px solid rgba(15, 23, 42, .11);
    border-radius: 10px;
    padding: .55rem .65rem;
    background: rgba(248, 250, 252, .92);
}

.sql-backup-source-row code {
    overflow-wrap: anywhere;
    white-space: normal;
}

.sql-backup-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .62);
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.sql-backup-modal {
    width: min(720px, 100%);
    border-radius: 18px;
    background: #fff;
    color: #0f172a;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    padding: 1.1rem;
}

.sql-backup-modal h2 {
    margin: 0 0 .4rem;
}

.sql-backup-progress-track {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, .12);
    margin: .8rem 0 .35rem;
}

.sql-backup-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #22c55e);
    transition: width .18s ease;
}

.sql-backup-progress-meta {
    margin: 0 0 .7rem;
    color: rgba(15, 23, 42, .66);
    font-size: .9rem;
}

.sql-backup-log {
    max-height: 220px;
    overflow: auto;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: 12px;
    background: #0f172a;
    color: #dbeafe;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: .8rem;
    padding: .7rem;
    margin: .8rem 0;
}
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #fff;
    background-color: #000814;
    margin: 0;
    padding: 0;
}

/* Force readable text across app + MudBlazor on dark backgrounds */
body,
p,
span,
div,
label,
small,
strong,
em,
li,
td,
th,
h1,
h2,
h3,
h4,
h5,
h6,
.mud-typography,
.mud-button-label,
.mud-input-label,
.mud-input,
.mud-select,
.mud-switch {
    color: #fff !important;
}

/* Wheel of Wisdom — full-page shell must beat the global white `!important` on p/span/div/h*… */
.bible-suite-page.pw-page,
.bible-suite-page.pw-page * {
    color: #000000 !important;
}

/* Improve switch visibility on dark backgrounds */
.mud-switch .mud-switch-track {
    background-color: #bfc5cc !important;
    opacity: 1 !important;
}

.mud-switch .mud-switch-thumb {
    background-color: #ffffff !important;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 0;
}

/* Bible reader: stretch layout shell so the reader can use the full viewport */
.page:has(.bible-reader-page) {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.page:has(.bible-reader-page) > main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
}

main:has(.bible-reader-page),
article.content:has(.bible-reader-page) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.ticker-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 38px;
    background: #000;
    border-left: 2px solid #d4af37;
    transition: width 0.5s ease-in-out;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.55);
}

.ticker-drawer:hover,
.ticker-drawer.is-pinned {
    width: 376px;
}

.ticker-drawer.ticker-drawer-with-weeks_1to2:hover,
.ticker-drawer.ticker-drawer-with-weeks_1to2.is-pinned {
    width: 432px;
}

.ticker-drawer.ticker-drawer-no-priority:hover,
.ticker-drawer.ticker-drawer-no-priority.is-pinned {
    width: 284px;
}

.ticker-drawer.ticker-drawer-with-weeks_1to2.ticker-drawer-no-priority:hover,
.ticker-drawer.ticker-drawer-with-weeks_1to2.ticker-drawer-no-priority.is-pinned {
    width: 392px;
}

.ticker-drawer.no-transition {
    transition: none !important;
}

.ticker-drawer-title-collapsed {
    position: absolute;
    left: 8px;
    top: 62px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 0.08rem;
    color: #d4af37;
    font-weight: 700;
    font-size: 0.95rem;
    pointer-events: none;
}

.ticker-drawer-title-expanded {
    margin: 0;
    color: #d4af37;
    font-weight: 700;
    font-size: 1rem;
}

.ticker-drawer-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin: 8px 10px 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
}

.ticker-drawer:hover .ticker-drawer-title-collapsed,
.ticker-drawer.is-pinned .ticker-drawer-title-collapsed {
    display: none;
}

.ticker-drawer:hover .ticker-drawer-title-expanded,
.ticker-drawer.is-pinned .ticker-drawer-title-expanded {
    display: block;
}

.ticker-drawer:hover .ticker-drawer-header,
.ticker-drawer.is-pinned .ticker-drawer-header {
    display: flex;
}

.ticker-drawer-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ticker-source-badge {
    color: #facc15;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0;
    border: none;
    background: transparent;
    white-space: nowrap;
}

.ticker-drawer-title-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.ticker-main-shifted {
    width: calc(100% - 376px) !important;
    max-width: calc(100% - 376px) !important;
    margin-right: 376px !important;
    transition: width 0.5s ease-in-out, margin-right 0.5s ease-in-out;
}

.ticker-main-shifted.ticker-main-shifted-with-weeks_1to2 {
    width: calc(100% - 432px) !important;
    max-width: calc(100% - 432px) !important;
    margin-right: 432px !important;
}

.ticker-main-shifted.ticker-main-shifted-no-priority {
    width: calc(100% - 284px) !important;
    max-width: calc(100% - 284px) !important;
    margin-right: 284px !important;
}

.ticker-main-shifted.ticker-main-shifted-with-weeks_1to2.ticker-main-shifted-no-priority {
    width: calc(100% - 392px) !important;
    max-width: calc(100% - 392px) !important;
    margin-right: 392px !important;
}

.ticker-main-collapsed {
    width: calc(100% - 38px) !important;
    max-width: calc(100% - 38px) !important;
    margin-right: 38px !important;
    transition: width 0.5s ease-in-out, margin-right 0.5s ease-in-out;
}

.ticker-main-no-transition {
    transition: none !important;
}

.ticker-pin-icon-button {
    margin: 0;
    border: 1px solid #d4af37;
    border-radius: 4px;
    background: #111;
    color: #d4af37 !important;
    flex-shrink: 0;
}

.ticker-drawer-content {
    overflow-y: auto;
    padding: 8px 12px 12px;
    flex: 1 1 auto;
    min-height: 0;
}

.ticker-controls-panel {
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    overflow: hidden;
    pointer-events: none;
    transition: max-height 0.22s ease, opacity 0.2s ease, transform 0.2s ease;
}

.ticker-drawer-header:hover ~ .ticker-drawer-content .ticker-controls-panel,
.ticker-controls-panel:hover {
    max-height: 200px;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Collapsed drawer: show only vertical Portfolio title */
.ticker-drawer .ticker-drawer-header,
.ticker-drawer .ticker-drawer-content {
    display: none;
}

.ticker-drawer:hover .ticker-drawer-content,
.ticker-drawer.is-pinned .ticker-drawer-content {
    display: block;
}

.ticker-add-form {
    display: grid;
    grid-template-columns: 92px 1fr auto;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    align-items: center;
}

.ticker-column-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 4px 0 10px;
    padding: 6px 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.45);
}

.ticker-column-toggle-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ticker-column-toggle-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #d1d5db;
}

.ticker-asset-type,
.ticker-symbol-input,
.ticker-add-button {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #d4af37;
    background: #0f1116;
    color: #fff;
    padding: 6px 8px;
}

.ticker-add-button {
    cursor: pointer;
    background: #1f2937;
    font-weight: 600;
}

.ticker-add-button:hover {
    background: #374151;
}

.ticker-add-form .ticker-add-button {
    width: auto;
    min-width: 64px;
}

.ticker-add-icon-button {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #d4af37;
    background: #1f2937;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    justify-self: end;
}

.ticker-add-icon-button:hover {
    background: #374151;
}

.data-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.history-tab-toolbar {
    flex-wrap: wrap;
}

.history-status-filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: #d1d5db;
}

.history-status-filter-label select {
    min-width: 188px;
}

.history-export-csv-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.15;
    border-radius: 4px;
    border: 1px solid #d4af37;
    background: #1f2937;
    color: #fff;
    cursor: pointer;
}

.history-export-csv-button:hover {
    background: #374151;
}

.history-export-csv-button .history-export-csv-icon.mud-icon-root {
    font-size: 1rem !important;
}

.history-export-csv-button .history-export-csv-icon {
    flex-shrink: 0;
}

.data-manager-toolbar {
    justify-content: space-between;
}

.data-manager-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-manager-toolbar-icon {
    border: 1px solid #d4af37;
    background: #1f2937;
    border-radius: 4px;
}

.data-manager-add-icon {
    margin-left: auto;
}

.my-trades-toolbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-trades-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 10px 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    background: #0d0d0d;
}

.my-trades-filters-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
    flex: 0 1 auto;
    min-width: 0;
}

.my-trades-clear-filters-button {
    flex-shrink: 0;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.15;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: #1f2937;
    color: #e5e7eb;
    cursor: pointer;
}

.my-trades-clear-filters-button .my-trades-clear-filters-icon.mud-icon-root {
    font-size: 1rem !important;
}

.my-trades-clear-filters-button .my-trades-clear-filters-icon {
    flex-shrink: 0;
}

.my-trades-clear-filters-button:hover {
    background: #374151;
    border-color: rgba(212, 175, 55, 0.65);
}

.my-trades-filter-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #9ca3af;
}

.my-trades-filter-label .data-grid-input {
    min-width: 8rem;
}

.event-log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.event-log-heading {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.event-log-clear-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 3px 9px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.15;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.45);
    background: #1f2937;
    color: #e5e7eb;
    cursor: pointer;
}

.event-log-clear-button .event-log-clear-icon.mud-icon-root {
    font-size: 1rem !important;
}

.event-log-clear-button .event-log-clear-icon {
    flex-shrink: 0;
}

.event-log-clear-button:hover {
    background: #374151;
    border-color: rgba(212, 175, 55, 0.65);
}

.audit-trail-intro {
    margin-top: 1rem;
}

.audit-trail-refresh-button {
    border-color: rgba(96, 165, 250, 0.45);
}

.audit-trail-scroll {
    max-height: 320px;
    overflow-y: auto;
    background: #000000;
    padding: 12px;
    border-radius: 6px;
    margin-top: 4px;
}

.audit-trail-row {
    margin-bottom: 10px;
    font-family: Consolas, monospace;
    font-size: 0.82rem;
}

.audit-trail-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    color: #e5e7eb;
}

.audit-trail-ts {
    color: #94a3b8;
    flex-shrink: 0;
}

.audit-trail-cat {
    font-weight: 600;
    flex-shrink: 0;
}

.audit-trail-sum {
    flex: 1 1 200px;
    min-width: 0;
    word-break: break-word;
}

.audit-trail-detail {
    margin-top: 4px;
    padding-left: 8px;
    border-left: 2px solid rgba(148, 163, 184, 0.35);
    color: #9ca3af;
    font-size: 0.78rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.health-shell {
    border-radius: 12px !important;
    border: 1px solid rgba(212, 175, 55, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.health-shell .health-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.health-heading {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f8fafc;
}

.health-intro {
    margin: 1rem 0 0;
    padding: 12px 0 4px;
    line-height: 1.55;
    color: #cbd5e1 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.health-intro code {
    color: #fde68a;
    background: rgba(30, 41, 59, 0.65);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.88em;
}

.health-section {
    margin-top: 1.35rem;
    padding: 1.1rem 1.15rem 1.2rem;
    border-radius: 12px;
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.5) 0%, rgba(3, 7, 18, 0.72) 100%);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.health-intro + .health-section {
    margin-top: 1.05rem;
}

.health-subheading {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fcd34d;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}

.health-subheading--after-block {
    margin-top: 1.15rem;
}

.health-refresh-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(52, 211, 153, 0.45);
    background: #022c22;
    color: #d1fae5;
    cursor: pointer;
}

.health-heartbeat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 0;
}

.health-heartbeat-card {
    flex: 1 1 180px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #111827 0%, #0b0b0b 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.health-hb-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.health-hb-status {
    font-size: 0.9rem;
    color: #86efac;
}

.health-hb-time {
    font-family: Consolas, monospace;
    font-size: 0.8rem;
    color: #94a3b8;
}

.health-rate-box,
.health-scan-grid,
.health-token-grid,
.health-metrics-line {
    font-family: Consolas, monospace;
    font-size: 0.82rem;
}

.health-metrics-section .health-metrics-line {
    margin: 0 0 4px;
}

.health-rate-box {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    padding: 10px 12px;
    color: #cbd5e1;
    word-break: break-word;
    background: rgba(0, 0, 0, 0.25);
}

.health-scan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 16px;
}

.health-label {
    color: #94a3b8;
    margin-right: 8px;
}

.health-value {
    color: #e5e7eb;
}

.health-token-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    border-bottom: 1px solid rgba(55, 65, 81, 0.45);
    padding: 8px 0;
}

.health-token-row:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.health-token-feature {
    color: #93c5fd;
}

.health-token-numbers {
    color: #e5e7eb;
}

.health-cost-section {
    margin-top: 0;
}

.health-cost-totals {
    font-family: Consolas, monospace;
    font-size: 0.82rem;
    margin: 8px 0;
}

.health-cost-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: Consolas, monospace;
    font-size: 0.8rem;
    margin-top: 10px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(55, 65, 81, 0.35);
}

.health-cost-head,
.health-cost-row {
    display: grid;
    grid-template-columns: minmax(88px, 1.5fr) repeat(6, minmax(52px, 1fr));
    gap: 6px;
    align-items: baseline;
}

@media (max-width: 900px) {
    .health-cost-head,
    .health-cost-row {
        grid-template-columns: minmax(72px, 1.2fr) repeat(6, minmax(44px, 1fr));
        font-size: 0.72rem;
        gap: 4px;
    }
}

.health-cost-head {
    font-weight: 600;
    color: #94a3b8;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.health-cost-row span {
    padding: 3px 0;
    border-bottom: 1px solid rgba(55, 65, 81, 0.35);
}

.health-cost-provider {
    color: #93c5fd;
    overflow: hidden;
    text-overflow: ellipsis;
}

.health-strategy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0;
}

.health-strategy-card {
    flex: 1 1 220px;
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-radius: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #13100a 0%, #0b0b0b 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.health-strategy-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #fcd34d;
}

.health-strategy-line {
    font-size: 0.82rem;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.health-strategy-error {
    margin-top: 6px;
    font-size: 0.78rem;
    color: #fca5a5;
    word-break: break-word;
}

.health-strategy-ok {
    margin-top: 6px;
    font-size: 0.78rem;
    color: #86efac;
}

.graph-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.graph-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 12px;
    align-items: start;
}

.graph-options-panel {
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 6px;
    padding: 10px;
    background: #090909;
    display: grid;
    gap: 10px;
}

.graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.graph-header h3 {
    margin: 0;
}

.graph-refresh-icon-button {
    border: 1px solid #d4af37;
    border-radius: 4px;
    background: #111;
}

.graph-load-status {
    margin: 0 0 10px 0;
    color: #facc15 !important;
    font-weight: 600;
}

.graph-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e5e7eb !important;
}

.graph-control-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e5e7eb !important;
}

.graph-control-select,
.graph-control-input {
    min-width: 74px;
    border-radius: 4px;
    border: 1px solid #4b5563;
    background: #111827;
    color: #fff;
    padding: 4px 6px;
}

.graph-signal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    padding-top: 8px;
}

.graph-signal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.graph-signal-buy {
    background: #20c05c;
}

.graph-signal-sell {
    background: #d64545;
}

.ticker-graph-container {
    width: 100%;
    height: 560px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 6px;
}

.data-add-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 8px;
    margin-bottom: 10px;
}

.sms-settings-row {
    grid-template-columns: 1fr 1fr 1fr auto;
}

.settings-section {
    --settings-label-width: 280px;
    --settings-value-width: 250px;
    --settings-column-gap: 10px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 6px;
    padding: 12px;
    margin-top: 12px;
    background: #090909;
}

.settings-section.settings-section-ai-chat {
    --settings-value-width: 375px;
}

.settings-section h4 {
    margin: 0 0 10px 0;
    color: #67e8f9;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.settings-help {
    margin: 6px 0 0 0;
    color: #9ca3af !important;
    font-size: 0.9rem;
}

.settings-label-row {
    margin-bottom: 4px;
    color: #cbd5e1 !important;
    font-size: 0.88rem;
}

.settings-label-row span {
    display: block;
    text-align: left;
}

.settings-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.settings-field > span {
    color: #cbd5e1 !important;
    font-size: 0.88rem;
    text-align: left;
}

.settings-section .data-add-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 8px;
    width: fit-content;
    max-width: 100%;
}

.settings-section .sms-settings-row {
    grid-template-columns: 1fr;
}

.settings-section .settings-field,
.settings-section .graph-control-label {
    display: grid;
    grid-template-columns: var(--settings-label-width) var(--settings-value-width);
    align-items: center;
    justify-content: start;
    column-gap: var(--settings-column-gap);
    margin: 0;
    min-width: 0;
}

.settings-section .settings-field > span {
    margin: 0;
    font-size: 0.9rem;
}

.settings-section .graph-control-label {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.settings-section .settings-field > .data-grid-input,
.settings-section .graph-control-label > .data-grid-input {
    width: 100%;
    justify-self: stretch;
    min-width: 0;
}

.settings-field-number-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.settings-section .settings-field > .settings-field-number-wrap,
.settings-section .graph-control-label > .settings-field-number-wrap {
    justify-self: stretch;
    width: 100%;
}

.settings-section .settings-field-number-wrap .data-grid-input,
.settings-section .graph-control-label > .settings-field-number-wrap .data-grid-input {
    flex: 1 1 120px;
    width: auto !important;
    min-width: 88px;
    max-width: 280px;
}

.settings-saved-baseline {
    color: #94a3b8;
    font-size: 0.85rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.settings-section .chat-system-prompt-input {
    min-height: 90px;
}

.settings-section .ticker-add-button {
    width: auto;
    min-width: 96px;
    justify-self: end;
    padding: 4px 8px;
    font-size: 0.78rem;
    line-height: 1.2;
}

.data-add-row-recommendation {
    grid-template-columns: 1fr 1fr 1fr 110px 110px 1.5fr auto auto;
}

.data-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e5e7eb;
}

.data-grid-wrapper {
    overflow: auto;
    max-height: 62vh;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 6px;
}

.data-add-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2605;
}

.data-add-dialog-card {
    width: min(760px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    background: #0b0f19;
    border: 1px solid rgba(212, 175, 55, 0.45);
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}

.data-add-dialog-card h4 {
    margin: 0 0 10px 0;
    color: #67e8f9;
}

.data-add-dialog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 10px;
}

.data-add-dialog-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.prompts-manual-improvement-dialog {
    width: min(720px, 94vw);
    max-height: min(88vh, 560px);
}

.prompts-manual-improvement-field {
    width: 100%;
    margin-top: 8px;
}

.prompts-manual-improvement-textarea {
    width: 100%;
    min-height: 160px;
    resize: vertical;
}

.data-grid-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.data-grid-table th,
.data-grid-table td {
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}

.data-grid-table thead th {
    position: sticky;
    top: 0;
    background: #0b0b0b;
    z-index: 1;
}

.data-grid-readonly-cell,
.history-prompt-rev {
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
    color: #94a3b8;
    white-space: nowrap;
}

.data-grid-input {
    width: 100%;
    min-width: 90px;
    border-radius: 4px;
    border: 1px solid #4b5563;
    background: #111827;
    color: #fff;
    padding: 5px 7px;
}

.data-actions {
    display: flex;
    gap: 8px;
}

.data-delete-button {
    border: 1px solid #b91c1c;
    background: #450a0a;
    color: #fff;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
}

.data-delete-button:hover {
    background: #7f1d1d;
}

.ticker-empty {
    color: #c6c6c6 !important;
    font-size: 0.9rem;
}

/* Grid keeps Priority / Days_1 / Days_2to5 aligned. First column needs a floor width — at 320px drawer it collapsed to ~26px and clipped tickers. */
.ticker-row {
    display: grid;
    grid-template-columns: minmax(4.25rem, 1fr) 52px minmax(4.6rem, 1fr) minmax(4.6rem, 1fr);
    align-items: center;
    column-gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.ticker-row.ticker-row-with-weeks_1to2 {
    grid-template-columns: minmax(4.25rem, 1fr) 52px minmax(4.2rem, 1fr) minmax(4.2rem, 1fr) minmax(4.2rem, 1fr);
}

.ticker-row.ticker-row-no-priority {
    grid-template-columns: minmax(4.25rem, 1fr) minmax(4.4rem, 1fr) minmax(4.4rem, 1fr);
}

.ticker-row.ticker-row-with-weeks_1to2.ticker-row-no-priority {
    grid-template-columns: minmax(4.25rem, 1fr) minmax(4.1rem, 1fr) minmax(4.1rem, 1fr) minmax(4.1rem, 1fr);
}

.ticker-row.ticker-row-active-trade {
    background: #0f2847;
    border-bottom-color: rgba(15, 40, 71, 0.95);
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 4px;
}

.ticker-indicator-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ticker-indicator-pill.ticker-indicator-active-order {
    outline: 1px solid rgba(212, 175, 55, 0.8);
    outline-offset: 1px;
    border-radius: 4px;
    padding: 1px 3px;
    box-sizing: border-box;
}

.ticker-row-header {
    padding-top: 2px;
    padding-bottom: 4px;
}

.ticker-symbol-header {
    min-width: 0;
}

.ticker-column-header {
    font-family: Consolas, monospace;
    font-size: 0.88rem;
    color: #9ca3af !important;
}

.ticker-column-header.ticker-indicator-group {
    justify-content: flex-end;
}

.ticker-row-header .ticker-priority-group.ticker-column-header {
    justify-content: center;
}

.ticker-symbol-button {
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    padding: 0;
    text-align: left;
    font-size: 1.02rem;
    font-weight: 600;
    justify-self: start;
    min-width: min-content;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker-symbol-button:hover {
    color: #d4af37;
}

.ticker-indicator-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    justify-self: end;
    justify-content: flex-end;
    min-width: 0;
}

.ticker-priority-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    justify-self: center;
    justify-content: center;
    min-width: 0;
}

.ticker-priority-select {
    width: 46px;
    height: 26px;
    border: 1px solid #4b5563;
    border-radius: 4px;
    background: #111827;
    color: #f9fafb;
    font-size: 0.9rem;
    padding: 0 2px;
}

.ticker-indicator-label {
    font-family: Consolas, monospace;
    font-size: 0.9rem;
    color: #9ca3af !important;
}

.ticker-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.ticker-indicator-value {
    font-family: Consolas, monospace;
    font-size: 0.98rem;
    color: #d1d5db !important;
}

.ticker-dot-pending {
    background: #8a8f98;
}

.ticker-dot-recommended {
    background: #20c05c;
}

.ticker-dot-days_2to5-recommended {
    background: #20c05c;
}

.ticker-dot-not-recommended {
    background: #d64545;
}

.ticker-dot-empty {
    background: transparent;
    border: 1px solid transparent;
}

.ticker-indicator-empty {
    color: transparent !important;
}

.tab-button-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tab-button-spacer {
    flex: 1 1 auto;
}

.chat-messages {
    min-height: 320px;
    max-height: 520px;
    overflow-y: auto;
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 10px;
}

.chat-message {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.chat-message-user {
    background: #1e293b;
    border: 1px solid #334155;
    white-space: pre-wrap;
}

.chat-message-assistant {
    background: #0b1324;
    border: 1px solid #1d4ed8;
    white-space: normal;
}

.chat-md-body {
    margin-top: 6px;
    line-height: 1.45;
    color: #e2e8f0;
}

.chat-md-body .chat-md-h {
    margin: 0.65em 0 0.35em;
    font-weight: 700;
    color: #f8fafc;
}

.chat-md-body .chat-md-h1 {
    font-size: 1.15rem;
}

.chat-md-body .chat-md-h2 {
    font-size: 1.08rem;
}

.chat-md-body .chat-md-h3 {
    font-size: 1rem;
}

.chat-md-body .chat-md-p {
    margin: 0.45em 0;
}

.chat-md-body .chat-md-p:first-child {
    margin-top: 0;
}

.chat-md-body .chat-md-ul {
    margin: 0.35em 0 0.35em 1.15rem;
    padding: 0;
}

.chat-md-body .chat-md-ul li {
    margin: 0.2em 0;
}

.chat-md-body .chat-md-pre {
    margin: 0.55em 0;
    padding: 10px 12px;
    overflow-x: auto;
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Menlo, Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.35;
    background: #020617;
    border: 1px solid #334155;
    border-radius: 6px;
}

.chat-md-body .chat-md-pre code {
    font-family: inherit;
    font-size: inherit;
}

.chat-md-body .chat-md-code {
    font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
    font-size: 0.88em;
    padding: 0.1em 0.35em;
    background: #1e293b;
    border-radius: 4px;
}

.chat-md-body .chat-md-link {
    color: #93c5fd;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-md-body .chat-md-link:hover {
    color: #bfdbfe;
}

.chat-md-body em {
    font-style: italic;
    color: inherit;
}

.chat-md-body table.chat-md-table {
    margin: 0.55em 0;
    border-collapse: collapse;
    font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.35;
    width: max-content;
    max-width: 100%;
    border: 1px solid #334155;
}

.chat-md-body table.chat-md-table th,
.chat-md-body table.chat-md-table td {
    border: 1px solid #334155;
    padding: 6px 10px;
    text-align: left;
    vertical-align: top;
}

.chat-md-body table.chat-md-table th {
    background: #111827;
    color: #f1f5f9;
}

.chat-message-assistant .chat-md-body {
    overflow-x: auto;
}

.chat-input {
    min-height: 96px;
}

.chat-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.chat-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.chat-header-controls .data-grid-input.chat-header-provider-select {
    min-width: 132px;
    max-width: 160px;
}

.chat-header-controls .data-grid-input.chat-header-model-select {
    min-width: 180px;
    max-width: min(320px, 100%);
}

.chat-header-controls .data-grid-input {
    min-width: 260px;
}

.chat-clear-button {
    padding: 3px 10px;
    font-size: 0.8rem;
    line-height: 1.2;
}

.chat-input-row {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.chat-system-prompt-input {
    min-height: 72px;
}

.testing-shell {
    min-height: 74vh;
    display: flex;
    flex-direction: column;
}

.testing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

.testing-actions-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 220px;
}

.testing-action-button {
    width: 100% !important;
    min-width: 0;
}

.testing-action-button--running {
    position: relative;
    overflow: hidden;
    border-color: #facc15 !important;
    box-shadow: 0 0 0 rgba(250, 204, 21, 0.0);
    animation: testing-button-pulse 1.3s ease-in-out infinite;
}

.testing-action-button--running::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(250, 204, 21, 0.0) 20%, rgba(250, 204, 21, 0.22) 48%, rgba(250, 204, 21, 0.0) 76%);
    transform: translateX(-120%);
    animation: testing-button-sheen 1.6s linear infinite;
    pointer-events: none;
}

@keyframes testing-button-pulse {
    0% { box-shadow: 0 0 0 rgba(250, 204, 21, 0.0); }
    50% { box-shadow: 0 0 14px rgba(250, 204, 21, 0.35); }
    100% { box-shadow: 0 0 0 rgba(250, 204, 21, 0.0); }
}

@keyframes testing-button-sheen {
    from { transform: translateX(-120%); }
    to { transform: translateX(120%); }
}

.testing-debug-panel {
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 8px;
    padding: 10px;
}

.testing-debug-panel strong,
.testing-debug-panel b {
    color: #7dd3fc !important;
}

.testing-hover-dialog-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2000;
}

.testing-hover-dialog {
    position: fixed;
    width: 560px;
    max-width: min(560px, calc(100vw - 24px));
    background: rgba(2, 6, 23, 0.96);
    border: 1px solid rgba(250, 204, 21, 0.7);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
    padding: 14px 16px;
}

.testing-hover-dialog-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #facc15;
    margin-bottom: 8px;
}

.testing-hover-dialog-list {
    margin: 0;
    padding-left: 18px;
    color: #e5e7eb;
    font-size: 0.83rem;
    line-height: 1.45;
}

.testing-hover-dialog-list li + li {
    margin-top: 5px;
}

.formula-lab-panel {
    margin-top: 6px;
    border: 1px solid #1f2937;
    background: #020617;
    border-radius: 8px;
    padding: 10px;
    max-height: 58vh;
    overflow: auto;
}

.formula-lab-panel--page {
    max-height: none;
    height: 100%;
}

.formula-lab-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #facc15;
    margin-bottom: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.formula-lab-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    margin-bottom: 8px;
}

.formula-lab-action-button {
    min-width: 0;
    font-size: 0.72rem;
    padding: 5px 6px;
}

.formula-lab-action-button--small {
    min-width: 0;
    font-size: 0.66rem;
    padding: 3px 7px;
    line-height: 1.1;
}

.formula-lab-actions--inline {
    margin-bottom: 0;
    gap: 4px;
}

.formula-lab-status {
    font-size: 0.73rem;
    color: #93c5fd;
    margin-bottom: 8px;
}

.formula-lab-indicator-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.formula-lab-indicator-row--compact {
    grid-template-columns: 60px minmax(0, 340px) auto;
}

.formula-lab-indicator-row--inline {
    margin-bottom: 0;
}

.formula-lab-indicator-label {
    font-size: 0.72rem;
    color: #cbd5e1;
}

.formula-lab-indicator-select {
    width: 100%;
    border: 1px solid #000000;
    border-radius: 4px;
    background: #ffffff;
    color: #000000;
    padding: 4px 6px;
    font-size: 0.74rem;
    box-shadow: none;
}

.formula-lab-indicator-select--compact {
    max-width: 340px;
}

.formula-lab-indicator-select option {
    background: #ffffff;
    color: #000000;
}

.formula-lab-add-open-button {
    padding: 4px 10px;
    font-size: 0.68rem;
    background: #7f1d1d;
    border-color: #ef4444;
    color: #fee2e2;
}

.formula-lab-add-open-button:hover {
    background: #991b1b;
}

.formula-lab-add-open-button--small {
    margin-left: auto;
    padding: 3px 9px;
    font-size: 0.64rem;
    line-height: 1.1;
}

.formula-lab-add-indicator-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 6px;
    margin-bottom: 8px;
}

.formula-lab-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(2, 6, 23, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.formula-lab-dialog {
    width: min(520px, 100%);
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0b1220;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.formula-lab-dialog-title {
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.formula-lab-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.formula-floating-field {
    position: relative;
}

.formula-floating-input::placeholder {
    color: #64748b;
    transition: color 120ms ease;
}

.formula-floating-label {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 4px;
    background: #0b1220;
    color: #64748b;
    font-size: 0.74rem;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transition: top 140ms ease, transform 140ms ease, opacity 140ms ease, font-size 140ms ease, color 140ms ease;
}

.formula-floating-input:focus::placeholder {
    color: transparent;
}

.formula-floating-input:focus + .formula-floating-label,
.formula-floating-input:not(:placeholder-shown) + .formula-floating-label {
    top: 0;
    transform: translateY(-52%);
    opacity: 1;
    font-size: 0.62rem;
    color: #94a3b8;
}

.formula-lab-formula-card {
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px;
    background: #0b1220;
}

.formula-lab-formula-card + .formula-lab-formula-card {
    margin-top: 8px;
}

.formula-lab-formula-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 6px;
}

.formula-lab-base-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.74rem;
    color: #cbd5e1;
}

.formula-lab-terms {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formula-lab-term {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) 108px 72px;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border: 1px dashed #334155;
    border-radius: 6px;
    background: #0f172a;
}

.formula-lab-term-handle {
    color: #64748b;
    cursor: grab;
    user-select: none;
    font-size: 0.8rem;
}

.formula-lab-term-label {
    color: #e2e8f0;
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.formula-lab-op-select {
    width: 100%;
    border: 1px solid #000000;
    border-radius: 4px;
    background: #ffffff;
    color: #000000;
    padding: 3px 4px;
    font-size: 0.68rem;
    box-shadow: none;
}

.formula-lab-op-select option {
    background: #ffffff;
    color: #000000;
}

.formula-lab-number {
    width: 100%;
    border: 1px solid #334155;
    border-radius: 4px;
    background: #020617;
    color: #e5e7eb;
    padding: 3px 6px;
    font-size: 0.74rem;
}

.formula-lab-page-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.formula-lab-toolbar {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0b1220;
}

.formula-lab-toolbar-main {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.formula-composer {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #020617;
    padding: 10px;
    margin-bottom: 10px;
    min-height: 0;
}

.formula-composer-main {
    display: block;
    min-height: 480px;
    flex: 1 1 auto;
    min-width: 0;
}

.formula-composer-left,
.formula-composer-right {
    min-width: 0;
}

.formula-composer-left {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.formula-composer-right {
    border: 1px solid #3b82f6;
    border-radius: 10px;
    background: #0f2f63;
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.22);
    padding: 10px;
}

.formula-ribbon {
    border: 1px solid #3b82f6;
    border-radius: 10px;
    background: #0f2f63;
    box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.22);
    padding: 10px;
    margin-bottom: 8px;
}

.formula-ribbon-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.formula-ribbon-top .formula-composer-heading {
    margin-bottom: 0;
}

.formula-ribbon-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.formula-gemini-panel {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #1e293b;
}

.formula-gemini-panel--below {
    margin-bottom: 0;
    padding-bottom: 2px;
    width: 100%;
    box-sizing: border-box;
}

.formula-gemini-title {
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.formula-gemini-help {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.formula-gemini-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 120px;
    resize: vertical;
    font-family: ui-monospace, monospace;
    font-size: 0.72rem;
    line-height: 1.35;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #e2e8f0;
    margin-bottom: 6px;
}

.formula-gemini-textarea:disabled {
    opacity: 0.65;
}

.formula-gemini-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
}

.formula-gemini-status {
    font-size: 0.72rem;
    color: #7dd3fc;
    white-space: pre-wrap;
}

.formula-var-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    margin-bottom: 8px;
}

.formula-composer-status {
    font-size: 0.78rem;
    color: #8fa3b8;
    margin-bottom: 8px;
}

.formula-var-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.formula-var-chip-wrap {
    position: relative;
    display: inline-flex;
}

.formula-var-chip {
    border: 1px solid #334155;
    border-radius: 999px;
    background: #0b1220;
    color: #cbd5e1;
    font-size: 0.7rem;
    padding: 3px 9px;
}

.formula-var-chip-active {
    border-color: #facc15;
    color: #fef08a;
    background: #1f2937;
}

.formula-var-chip-ok {
    border-color: #86efac;
    color: #bbf7d0;
}

.formula-var-chip-missing {
    border-color: #fca5a5;
    color: #fecaca;
}

.formula-var-chip-delete {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    border: 1px solid #ef4444;
    border-radius: 999px;
    background: #7f1d1d;
    color: #fecaca;
    font-size: 0.58rem;
    line-height: 1;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.formula-mini-button {
    border: 1px solid #475569;
    border-radius: 4px;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.72rem;
    padding: 4px 8px;
}

.formula-composer-heading {
    color: #facc15;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.formula-assignment-row {
    display: block;
    margin-bottom: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

.formula-var-name {
    color: #cbd5e1;
    font-family: Consolas, monospace;
    font-size: 0.78rem;
}

.formula-var-expression {
    min-height: 160px;
    width: 100%;
    height: 100%;
}

.formula-var-expression-active {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 6px 6px;
    min-height: 160px;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    cursor: grab;
    scrollbar-color: #1d4ed8 #bfdbfe;
    scrollbar-width: auto;
}

.formula-var-expression-active:active {
    cursor: grabbing;
}

.formula-var-expression-active::-webkit-scrollbar {
    height: 14px;
    width: 14px;
}

.formula-var-expression-active::-webkit-scrollbar-track {
    background: #bfdbfe;
    border: 1px solid #93c5fd;
    border-radius: 10px;
}

.formula-var-expression-active::-webkit-scrollbar-thumb {
    background: #1d4ed8;
    border: 2px solid #bfdbfe;
    border-radius: 10px;
}

.formula-var-expression-active::-webkit-scrollbar-thumb:hover {
    background: #1e40af;
}

.formula-text-preview-box {
    margin-top: 6px;
    min-height: 34px;
    max-height: 56px;
    overflow-x: auto;
    overflow-y: auto;
    white-space: nowrap;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #000000;
    font-family: Consolas, monospace;
    font-size: 0.74rem;
    line-height: 1.25;
    padding: 6px 8px;
}

.formula-whiteboard-canvas {
    display: inline-block;
    min-width: max-content;
    min-height: 100%;
    white-space: nowrap;
    position: relative;
}

.formula-whiteboard-cursor-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 1200;
    border: 1px solid #334155;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.95);
    color: #facc15;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    white-space: nowrap;
}

.formula-slot {
    border: 1px solid #000000;
    border-radius: 6px;
    background: #fee2e2;
    color: transparent;
    font-size: 0.72rem;
    padding: 8px;
    text-align: center;
    cursor: pointer;
}

.formula-node {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    padding: 2px;
    max-width: 100%;
}

.formula-node-leaf {
    min-width: 120px;
}

.formula-node-leaf-literal {
    min-width: 56px;
}

.formula-node-leaf-literal .formula-node-input {
    min-width: 56px;
    width: 56px;
    padding: 2px 3px;
}

.formula-node-input {
    border-radius: 4px;
    padding: 3px 6px;
    font-size: 0.72rem;
    min-width: 56px;
}

input.formula-node-input {
    border: 1px solid #334155;
    background: #ffffff;
    color: #000000;
}

select.formula-node-var-select,
select.formula-node-op {
    border: 1px solid #000000 !important;
    border-radius: 4px;
    background: #ffffff !important;
    color: #000000 !important;
    padding: 3px 6px;
    font-size: 0.72rem;
    box-shadow: none;
}

select.formula-node-var-select option,
select.formula-node-op option {
    background: #ffffff;
    color: #000000;
}

.formula-node-op {
    min-width: 42px;
    width: 42px;
    padding: 1px 6px;
}

.formula-node-binary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.formula-node-exponent {
    display: inline-flex;
    align-items: flex-start;
    transform: translateY(calc(-0.35em - 5px));
    font-size: 0.84em;
}

.formula-node-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.formula-node-clamp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.formula-node-call {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 4px;
}

.formula-node-call-name {
    width: 70px;
    text-transform: uppercase;
}

.formula-node-label {
    color: #1e3a8a;
    font-size: 1rem;
    font-weight: 900;
    opacity: 1;
}

.formula-node-paren {
    display: inline-block;
    font-size: 1.5rem;
    line-height: 1;
    transform: translateY(-5px);
}

.formula-node-label-fraction-outer {
    font-size: 3rem;
    line-height: 1;
    font-weight: 950;
    transform: translateY(-7px);
}

.formula-paren-tone-0 {
    color: #000000 !important;
}

.formula-paren-tone-1 {
    color: #f97316 !important;
}

.formula-paren-tone-2 {
    color: #65a30d !important;
}

.formula-paren-tone-3 {
    color: #dc2626 !important;
}

.formula-paren-tone-4 {
    color: #d946ef !important;
}

.formula-paren-tone-5 {
    color: #2563eb !important;
}

.formula-node-clamp-keyword {
    color: #000000 !important;
}

.formula-node-param-punct {
    color: #000000 !important;
}

.db-schema-shell {
    border: 1px solid #334155;
    border-radius: 10px;
}

.db-schema-toolbar {
    margin-bottom: 10px;
}

.db-schema-title {
    margin: 0;
    color: #e2e8f0;
}

.db-schema-subtitle {
    color: #94a3b8;
    font-size: 0.78rem;
    margin-top: 2px;
}

.db-schema-relations-block {
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 10px;
    background: #020617;
}

.db-schema-relations-title {
    font-size: 0.75rem;
    color: #93c5fd;
    font-weight: 700;
    margin-bottom: 6px;
}

.db-schema-relations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.db-schema-relations-table th,
.db-schema-relations-table td {
    border: 1px solid #334155;
    padding: 4px 6px;
    text-align: left;
}

.db-schema-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
}

.db-schema-card {
    border: 1px solid #334155;
    border-radius: 8px;
    background: #020617;
    overflow: hidden;
}

.db-schema-card-header {
    padding: 6px 8px;
    border-bottom: 1px solid #334155;
    background: #0f172a;
}

.db-schema-card-title {
    font-size: 0.76rem;
    color: #fde68a;
    font-weight: 700;
}

.db-schema-fields {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.db-schema-field-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
}

.db-schema-field-name {
    color: #e2e8f0;
    font-family: Consolas, monospace;
}

.db-schema-field-type {
    color: #93c5fd;
    font-size: 0.65rem;
}

.db-schema-field-tags {
    display: inline-flex;
    gap: 4px;
}

.db-schema-tag {
    display: inline-block;
    border-radius: 999px;
    border: 1px solid #334155;
    padding: 0 6px;
    font-size: 0.6rem;
    line-height: 1.4;
    font-weight: 700;
}

.db-schema-tag-pk {
    color: #86efac;
    border-color: #166534;
    background: #052e16;
}

.db-schema-tag-fk {
    color: #fca5a5;
    border-color: #7f1d1d;
    background: #450a0a;
}

/* Scenic hero: mountain vista (Unsplash). Layers stack bottom → top; first list item paints on top. */
.home-shell,
.mud-paper.home-shell {
    --home-scenic-image: url("https://images.unsplash.com/photo-1464822759794-d0e8b8716dbc?auto=format&fit=crop&w=1920&q=82");
    min-height: 78vh;
    border-radius: 16px;
    border: none !important;
    outline: none !important;
    background-color: #070b14 !important;
    background-image:
        linear-gradient(
            168deg,
            rgba(6, 10, 20, 0.78) 0%,
            rgba(7, 12, 22, 0.72) 38%,
            rgba(4, 8, 16, 0.86) 100%
        ),
        radial-gradient(ellipse 130% 90% at 50% 115%, rgba(0, 0, 0, 0.45) 0%, transparent 52%),
        radial-gradient(ellipse 90% 70% at 50% -15%, rgba(15, 23, 42, 0.55) 0%, transparent 45%),
        radial-gradient(1000px 420px at 10% 5%, rgba(99, 102, 241, 0.14), transparent 58%),
        radial-gradient(800px 360px at 92% 8%, rgba(212, 175, 55, 0.07), transparent 50%),
        var(--home-scenic-image) !important;
    background-size: cover, cover, cover, cover, cover, cover !important;
    background-position: center, center, center, center, center, center !important;
    background-repeat: no-repeat !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.07) inset,
        0 28px 56px rgba(0, 0, 0, 0.45) !important;
}

/* Header + main nav: scrolls with the page (not sticky) */
.home-sticky-bar {
    position: relative;
    z-index: 200;
    margin: 0 0 0.65rem;
    padding: 0 0 0.85rem;
    /* Opaque when not overridden (e.g. non–home-front shells); home front uses site-themes.css */
    background: rgba(7, 11, 20, 0.96);
    backdrop-filter: blur(14px) saturate(1.05);
    -webkit-backdrop-filter: blur(14px) saturate(1.05);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
}

.home-sticky-bar .home-nav {
    margin-top: 0.85rem;
}

.home-sticky-bar .home-admin-submenu,
.home-sticky-bar .home-games-submenu,
.home-sticky-bar .home-memory-submenu,
.home-sticky-bar .home-admin-nested-flyout {
    z-index: 500;
}

/* Home columns stack below the header block */
.home-shell.home-shell--front > .home-columns,
.mud-paper.home-shell.home-shell--front > .home-columns {
    position: relative;
    z-index: 0;
}

/* Title (left) + verse float:right on one row; verse first in DOM for float behavior */
.home-header {
    margin: 0;
}

/* Home front: brand + stacked theme/auth on the left; verse on the right */
.home-header.home-header--split {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 1.75rem;
}

.home-header.home-header--split::after {
    display: none;
}

.home-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 1 1 220px;
    min-width: 0;
}

.home-header--split .home-menu-prebar--stacked {
    margin-top: 0.35rem;
    padding-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    gap: 0.5rem;
}

.home-header--split .home-menu-prebar--stacked .home-auth-wrap {
    align-self: flex-start;
}

.home-header--split .home-verse {
    float: none;
    flex: 0 1 auto;
    max-width: min(520px, 100%);
    margin: 0;
}

@media (max-width: 720px) {
    .home-header--split .home-verse {
        flex: 1 1 100%;
        max-width: none;
        text-align: left;
    }
}

.home-header::after {
    content: "";
    display: table;
    clear: both;
}

.home-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(1.65rem, 4vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #f1f5f9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 24px rgba(0, 0, 0, 0.35);
}

.home-brand {
    color: #f8fafc;
}

.home-brand-suffix {
    color: #c4b5fd;
    font-weight: 500;
}

.home-chat-strip {
    clear: both;
    margin: 0.65rem 0 0.35rem;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.92rem;
    line-height: 1.45;
    color: #e2e8f0;
}

.home-chat-strip-link {
    font-weight: 700;
    color: #93c5fd;
    text-decoration: none;
    margin-right: 0.5rem;
}

.home-chat-strip-link:hover {
    text-decoration: underline;
}

.home-chat-strip-meta {
    opacity: 0.82;
    font-size: 0.86rem;
}

.home-verse {
    float: right;
    max-width: min(520px, 58%);
    margin: 0 0 0 1.25rem;
    padding: 0;
    text-align: right;
    border: none;
    background: none;
    box-shadow: none;
}

.home-verse-text {
    margin: 0;
    font-size: clamp(0.95rem, 2.1vw, 1.08rem);
    line-height: 1.65;
    color: #e2e8f0;
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.home-verse-ref {
    margin: 0.65rem 0 0 0;
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Theme + auth sit in .home-menu-prebar above this row (see HomeMenuHeader). */
.home-menu-prebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1.25rem;
    justify-content: flex-start;
    margin-top: 1.25rem;
    padding-bottom: 0.55rem;
}

.home-menu-prebar .home-auth-wrap {
    flex: 0 1 auto;
    min-width: 0;
}

.home-menu-prebar .home-auth-name {
    max-width: min(28rem, 85vw);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.25;
}

.home-nav {
    clear: both;
    margin-top: 0;
    padding: 0.65rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.home-nav-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Plain top-level links: same bottom band as flyouts (trigger padding + wrapper padding-bottom on menus). */
.home-nav-list > .home-nav-item:not(.home-nav-item-endcap) > a.home-nav-link {
    padding-bottom: calc(0.45rem + 0.4rem);
}

.home-nav-link {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    color: #cbd5e1 !important;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

button.home-nav-link {
    font: inherit;
    margin: 0;
    text-align: inherit;
}

.home-nav-link:hover,
.home-nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9 !important;
}

/* Feedback sits on the right (before theme/auth); flex gap fills space after Games */
.home-nav-item-feedback {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.home-nav-item-feedback > .home-nav-link {
    padding-bottom: calc(0.45rem + 0.4rem);
}

.home-nav-item-donations {
    margin-left: auto;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.home-nav-list > .home-nav-item-donations > a.home-nav-link {
    padding-bottom: calc(0.45rem + 0.4rem);
}

.home-nav-item-endcap {
    margin-left: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    position: relative;
}

/* When Feedback is moved off the nav (home footer), keep Admin/theme/auth aligned right. */
.home-nav-list.home-nav-list--no-feedback-nav > .home-nav-item-endcap {
    margin-left: auto;
}

.home-theme-field {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.home-theme-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    user-select: none;
    white-space: nowrap;
}

.home-theme-select {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 1.75rem 0.3rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    max-width: min(11rem, 42vw);
}

/*
 * Theme dropdowns (site-wide): each <option> uses that theme’s palette in the list
 * (Chrome/Edge/Firefox; native list UI may ignore on some OS).
 * Home + Bible use storage ids; Dreams page uses red/blue for crimson/rwa.
 */
.home-theme-select option[value="crimson"],
.bible-reader-theme select option[value="crimson"],
.dream-theme-select option[value="red"] {
    background-color: #4a0e14;
    color: #fde68a;
    font-weight: 600;
}

.home-theme-select option[value="rwa"],
.bible-reader-theme select option[value="rwa"],
.dream-theme-select option[value="blue"] {
    background-color: #0c1929;
    color: #bae6fd;
    font-weight: 600;
}

.home-theme-select option[value="dark"],
.bible-reader-theme select option[value="dark"],
.dream-theme-select option[value="dark"] {
    background-color: #0f172a;
    color: #e2e8f0;
    font-weight: 600;
}

.home-theme-select option[value="purple"],
.bible-reader-theme select option[value="purple"],
.dream-theme-select option[value="purple"] {
    background-color: #231a3b;
    color: #ede9fe;
    font-weight: 600;
}

.home-theme-select option[value="light"],
.bible-reader-theme select option[value="light"],
.dream-theme-select option[value="light"] {
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
}

.home-auth-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.home-auth-guest,
.home-auth-signed {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.home-auth-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fde68a;
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-auth-link {
    font-size: 0.72rem;
    font-weight: 600;
    color: #93c5fd !important;
    text-decoration: none;
}

.home-auth-btn {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.32rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.65);
    color: #e2e8f0;
    cursor: pointer;
}

.home-auth-btn--primary {
    background: linear-gradient(180deg, #fde68a, #d97706);
    color: #1a0f06;
    border-color: rgba(120, 80, 20, 0.45);
}

.site-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.site-modal-card {
    width: 100%;
    max-width: 22rem;
    padding: 1.15rem 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #f1f5f9;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.site-modal-card--wide {
    max-width: 26rem;
}

/* Feedback dialog: wider card, centered in viewport (grid works even if an ancestor uses flex/transform quirks). */
.site-modal-overlay--feedback {
    display: grid;
    place-items: center;
    padding:
        max(1rem, env(safe-area-inset-top, 0px))
        max(1rem, env(safe-area-inset-right, 0px))
        max(1rem, env(safe-area-inset-bottom, 0px))
        max(1rem, env(safe-area-inset-left, 0px));
}

.site-modal-card--feedback {
    width: min(44rem, 94vw);
    max-width: min(44rem, 94vw);
    box-sizing: border-box;
}

.site-modal-title {
    margin: 0 0 0.65rem 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fde68a;
}

.site-modal-lead {
    margin: 0 0 0.75rem 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: rgba(226, 232, 240, 0.92);
}

.site-modal-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.95);
    margin: 0.45rem 0 0.2rem 0;
}

.site-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(100, 116, 139, 0.55);
    background: rgba(15, 23, 42, 0.9);
    color: #f8fafc;
    font-size: 0.88rem;
}

.site-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.85rem;
    justify-content: flex-end;
}

.site-modal-btn {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.42rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid rgba(148, 163, 184, 0.35);
}

.site-modal-btn--ghost {
    background: transparent;
    color: #e2e8f0;
}

.site-modal-btn--primary {
    background: linear-gradient(180deg, #fde68a, #d97706);
    color: #1a0f06;
    border-color: rgba(120, 80, 20, 0.5);
}

.site-modal-error {
    margin: 0.5rem 0 0 0;
    font-size: 0.82rem;
    color: #fecaca;
}

.site-modal-info {
    margin: 0.5rem 0 0 0;
    font-size: 0.8rem;
    color: #bbf7d0;
}

.site-modal-input--textarea {
    resize: vertical;
    min-height: 7rem;
    line-height: 1.45;
}

.feedback-email-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.feedback-email-input {
    flex: 1;
    min-width: 0;
}

.feedback-email-clear {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0.35rem;
    background: rgba(0, 0, 0, 0.25);
    color: #fecaca;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.feedback-email-clear:hover {
    background: rgba(255, 255, 255, 0.08);
}

.home-admin-menu {
    position: relative;
    padding-bottom: 0.4rem;
}

.home-admin-trigger {
    border: none;
    background: transparent;
    cursor: pointer;
}

.home-admin-submenu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 220px;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(11, 18, 32, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 30;
    overflow: visible;
}

.home-admin-link {
    display: block;
    width: 100%;
}

.home-admin-menu:hover .home-admin-submenu,
.home-admin-menu:focus-within .home-admin-submenu {
    display: block;
}

/* Admin → Cube / Games: second-level flyout opens to the left of the submenu row */
.home-admin-nested {
    position: relative;
    width: 100%;
    margin-top: 0.15rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.home-admin-nested:hover {
    z-index: 60;
}

.home-admin-nested-trigger {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.4rem 0.45rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: #cbd5e1;
    text-align: left;
}

.home-admin-nested-trigger:hover,
.home-admin-nested-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

.home-admin-nested-flyout {
    display: none;
    position: absolute;
    /* Overlap the submenu row so the cursor never crosses an empty gap (was margin-right: 4px). */
    right: calc(100% - 22px);
    left: auto;
    top: 0;
    margin-right: 0;
    min-width: 210px;
    max-width: min(92vw, 22rem);
    max-height: min(72vh, 28rem);
    overflow-y: auto;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(11, 18, 32, 0.98);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
    z-index: 55;
}

.home-admin-nested:hover .home-admin-nested-flyout,
.home-admin-nested:focus-within .home-admin-nested-flyout {
    display: block;
}

.home-admin-flyout-divider {
    height: 1px;
    margin: 0.35rem 0.25rem;
    background: rgba(255, 255, 255, 0.1);
}

.home-admin-flyout-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(253, 224, 71, 0.55);
    padding: 0.2rem 0.35rem 0.25rem;
}

.home-admin-flyout-unfinished {
    padding-left: 0.45rem;
    font-size: 0.88rem;
}

.home-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 1.5rem;
    align-items: stretch;
}

.home-columns-samples {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Home: horizontal rule + centered Feedback below tile grid */
.home-feedback-below-tiles {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    padding-bottom: 0.35rem;
}

.home-feedback-below-tiles__rule {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    margin: 0 0 1.1rem;
}

.home-feedback-below-tiles__stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.home-feedback-ai-note {
    margin: 0;
    max-width: 42rem;
    padding: 0 0.75rem;
    font-size: 0.92rem;
    line-height: 1.55;
    font-style: italic;
    text-align: center;
    color: rgba(226, 232, 240, 0.88);
}

.home-feedback-footer-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.45rem 0.75rem;
}

.home-feedback-footer-sep {
    color: rgba(226, 232, 240, 0.5);
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.home-feedback-donations-link {
    padding-bottom: calc(0.45rem + 0.4rem);
}

.home-feedback-footer {
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-feedback-footer__btn {
    padding-bottom: calc(0.45rem + 0.4rem);
}

.home-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

/* Home: XRPL / DEX column — panels keep natural height instead of flex-stretching */
.home-col-sidebar > .home-panel,
.home-col-sidebar > a.home-panel-link,
.home-col-sidebar > .home-xrpl-token-wrap {
    flex: 0 0 auto;
    align-self: stretch;
}

.home-panel {
    flex: 0 0 auto;
    position: relative;
    isolation: isolate;
    padding: 1.25rem 1.35rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(
            118deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.015) 38%,
            transparent 52%,
            rgba(0, 0, 0, 0.22) 100%
        ),
        linear-gradient(180deg, rgba(15, 23, 42, 0.72) 0%, rgba(8, 12, 22, 0.92) 52%, rgba(3, 5, 12, 0.98) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.1) inset,
        0 -1px 0 rgba(0, 0, 0, 0.28) inset,
        0 0 0 1px rgba(148, 163, 184, 0.06) inset,
        0 10px 36px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

a.home-panel-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    outline-offset: 3px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

a.home-panel-link:hover {
    border-color: rgba(196, 181, 253, 0.38);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 -1px 0 rgba(0, 0, 0, 0.28) inset,
        0 0 0 1px rgba(167, 139, 250, 0.14) inset,
        0 12px 40px rgba(0, 0, 0, 0.38);
}

a.home-panel-link:focus-visible {
    border-color: rgba(196, 181, 253, 0.55);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 0 0 2px rgba(167, 139, 250, 0.45),
        0 12px 40px rgba(0, 0, 0, 0.38);
}

/* Home: Bible reading — rotating hero (3:2), links to /Bible */
.home-bible-reading-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #1a0508;
}

.home-bible-reading-rotator {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
}

.home-bible-reading__slide {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    /*
     * Seamless crossfade: 0% and 100% both opacity 1 so the loop has no “all off” frame.
     * 45s = 3 × 15s per slide slot; negative delays phase the three slides by 15s each.
     */
    animation: home-bible-reading-crossfade 45s ease-in-out infinite;
}

.home-bible-reading__slide:nth-child(1) {
    animation-delay: 0s;
}

.home-bible-reading__slide:nth-child(2) {
    animation-delay: -30s;
}

.home-bible-reading__slide:nth-child(3) {
    animation-delay: -15s;
}

@keyframes home-bible-reading-crossfade {
    0% {
        opacity: 1;
    }

    33.33% {
        opacity: 0;
    }

    66.66% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-bible-reading__slide {
        animation: none;
    }

    .home-bible-reading__slide:not(:first-child) {
        opacity: 0;
        visibility: hidden;
    }

    .home-bible-reading__slide:first-child {
        opacity: 1;
        visibility: visible;
    }
}

/* Home: Biblical Dream Interpretation — image fills panel, whole panel is the link */
.home-dream-banner-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-dream-banner__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: XRPL Tokenization — panel links to /XRPLTokenization; hover flyout lists RWA routes */
.home-xrpl-token-wrap {
    position: relative;
    isolation: isolate;
}

.home-xrpl-token-wrap:hover .home-xrpl-token-panel,
.home-xrpl-token-wrap:focus-within .home-xrpl-token-panel {
    border-color: rgba(196, 181, 253, 0.38);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.12) inset,
        0 -1px 0 rgba(0, 0, 0, 0.28) inset,
        0 0 0 1px rgba(167, 139, 250, 0.14) inset,
        0 12px 40px rgba(0, 0, 0, 0.38);
}

.home-xrpl-token-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-xrpl-token-flyout {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    min-width: 0;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(11, 18, 32, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 40;
}

.home-xrpl-token-flyout .home-nav-link {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
}

.home-xrpl-token-flyout .home-nav-link:hover,
.home-xrpl-token-flyout .home-nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.home-xrpl-token-wrap:hover .home-xrpl-token-flyout,
.home-xrpl-token-wrap:focus-within .home-xrpl-token-flyout {
    display: block;
}

.home-xrpl-token__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: BibleCubes panel graphic */
.home-bible-cubes-wrap {
    display: block;
}

.home-bible-cubes-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-bible-cubes__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: Bible Story Jigsaw panel graphic */
.home-bible-jigsaw-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-bible-jigsaw__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: Chat panel graphic */
.home-community-chat-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-community-chat__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: Wheel of Wisdom panel graphic */
.home-wheel-wisdom-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-wheel-wisdom__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: Blaster panel graphic */
.home-blaster-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-blaster__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: Bible Word Search panel graphic */
.home-bws-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-bws__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: welcome video panel (landscape 3:2) */
.home-welcome-video-panel {
    position: relative;
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-welcome-video__img,
.home-welcome-video__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.home-welcome-video__img {
    object-fit: cover;
    object-position: center;
}

.home-welcome-video__frame {
    background: #000;
}

.home-welcome-video__play {
    position: absolute;
    right: 0.7rem;
    bottom: 0.7rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #f8fafc;
    font-size: 0.72rem;
    line-height: 1;
    letter-spacing: 0.02em;
    pointer-events: none;
}

/* Home: Ten Commandments memory game panel (3:2) */
.home-ten-commandments-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-ten-commandments__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

/* Home: Creation memory game panel (3:2) */
.home-creation-memory-panel {
    padding: 0 !important;
    overflow: hidden;
    line-height: 0;
    aspect-ratio: 3 / 2;
    background: #000;
}

.home-creation-memory__img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: center;
}

.home-panel-accent {
    border-color: rgba(196, 181, 253, 0.42);
    background:
        linear-gradient(
            122deg,
            rgba(255, 255, 255, 0.07) 0%,
            rgba(167, 139, 250, 0.05) 40%,
            transparent 55%,
            rgba(15, 12, 40, 0.5) 100%
        ),
        linear-gradient(155deg, rgba(58, 22, 95, 0.72) 0%, rgba(35, 30, 85, 0.68) 42%, rgba(6, 8, 18, 0.96) 100%);
    box-shadow:
        0 1px 0 rgba(237, 233, 254, 0.14) inset,
        0 -1px 0 rgba(0, 0, 0, 0.32) inset,
        0 0 0 1px rgba(139, 92, 246, 0.12) inset,
        0 10px 36px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

@media (prefers-reduced-transparency: reduce) {
    .home-panel,
    .home-panel-accent {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .home-panel {
        background:
            linear-gradient(118deg, rgba(255, 255, 255, 0.05) 0%, transparent 50%, rgba(0, 0, 0, 0.18) 100%),
            linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(4, 6, 14, 0.99) 100%);
    }

    .home-panel-accent {
        background:
            linear-gradient(122deg, rgba(255, 255, 255, 0.06) 0%, transparent 50%, rgba(20, 16, 55, 0.42) 100%),
            linear-gradient(155deg, rgba(52, 20, 88, 0.88) 0%, rgba(6, 8, 18, 0.99) 100%);
    }
}

.home-panel-title {
    margin: 0 0 0.5rem 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
}

.home-panel-lead {
    margin: 0 0 0.65rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
}

.home-panel-body {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #cbd5e1;
}

/* In-panel status note (e.g. BibleCubes on home) */
.home-panel-wip-note {
    margin-top: 0.7rem;
    font-size: 0.82rem;
    line-height: 1.45;
}

.home-panel-meta {
    margin: 0.75rem 0 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a5b4fc;
}

.home-panel-action {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #c4b5fd !important;
    text-decoration: none;
}

.home-panel-action:hover,
.home-panel-action:focus-visible {
    color: #e9d5ff !important;
    text-decoration: underline;
}

.home-panel-action-on-accent {
    color: #ede9fe !important;
}

.home-panel-action-on-accent:hover,
.home-panel-action-on-accent:focus-visible {
    color: #fff !important;
}

.home-cubes-chart-wrap {
    margin-top: 0.85rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.home-cubes-pie {
    --pie-active-pct: 0;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background:
      conic-gradient(
        #4ade80 0 calc(var(--pie-active-pct) * 1%),
        #f97316 calc(var(--pie-active-pct) * 1%) 100%
      );
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25) inset;
}

.home-cubes-legend {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
}

.home-cubes-legend-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.25;
}

.home-cubes-dot {
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 999px;
    flex: 0 0 auto;
}

.home-cubes-dot--active {
    background: #4ade80;
}

.home-cubes-dot--inactive {
    background: #f97316;
}

.home-sample-list {
    margin: 0.85rem 0 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.home-sample-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.home-sample-list li:last-child {
    border-bottom: none;
}

/* Home front themes (Crimson default, RWA) → wwwroot/css/site-themes.css — toggled via <html data-home-theme> */

.cube-admin-shell {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 2rem 1.2rem;
}

.cube-admin-ai-provider-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin: 0.35rem 0 0.85rem;
    padding: 0.5rem 0;
}

.cube-admin-ai-provider-label {
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.cube-admin-ai-provider-select {
    min-width: 10rem;
    max-width: 20rem;
}

.cube-admin-cube-picker-root {
    position: relative;
    z-index: 2;
}

.cube-admin-cube-picker-trigger {
    cursor: pointer;
    text-align: left;
    min-width: min(100%, 18rem);
    max-width: min(92vw, 36rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cube-admin-cube-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(2, 6, 23, 0.45);
}

.cube-admin-cube-picker-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: min(100%, 20rem);
    max-width: min(92vw, 32rem);
    max-height: min(58vh, 440px);
    padding: 0.55rem 0.6rem 0.5rem;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.98);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.cube-admin-cube-picker-search {
    width: 100%;
    box-sizing: border-box;
    flex: 0 0 auto;
}

.cube-admin-cube-picker-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.cube-admin-cube-picker-item {
    padding: 0.45rem 0.5rem;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.35;
    color: #e2e8f0;
}

.cube-admin-cube-picker-item:hover,
.cube-admin-cube-picker-item:focus-visible {
    background: rgba(59, 130, 246, 0.18);
    outline: none;
}

.cube-admin-cube-picker-item--current {
    background: rgba(148, 163, 184, 0.22);
}

.cube-admin-cube-picker-empty {
    padding: 0.5rem 0.35rem 0.35rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.chat-personalities-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
    margin: 1rem 0 0.75rem;
}

.chat-personalities-select {
    min-width: 12rem;
}

.chat-personalities-shared-details {
    margin: 0.75rem 0 1rem;
}

.chat-personalities-shared-pre {
    margin: 0.5rem 0 0;
    padding: 0.65rem 0.75rem;
    max-height: 14rem;
    overflow: auto;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(2, 6, 23, 0.35);
    color: #e2e8f0;
}

.chat-personalities-textarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.35rem;
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.45;
    resize: vertical;
    min-height: 12rem;
}

.chat-personalities-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: 1rem;
}

/* Chat personalities admin — full viewport + site theme tokens (see site-themes.css) */
.full-viewport-layout > .chat-personalities-rwa.rwa-shell {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
}

.chat-personalities-rwa .rwa-shell__main {
    max-width: min(96rem, 100%);
    margin-inline: auto;
    padding-inline: clamp(0.75rem, 2.5vw, 2rem);
    box-sizing: border-box;
}

.chat-personalities-rwa__body {
    padding-bottom: 2.5rem;
}

.chat-personalities-theme-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem 1rem;
    margin-bottom: 1.25rem;
}

.chat-personalities-theme-bar__label {
    margin: 0;
}

.chat-personalities-theme-bar__select {
    max-width: 16rem;
}

.chat-personalities-rwa__select {
    max-width: 20rem;
}

.chat-personalities-rwa__status {
    margin-bottom: 1rem;
}

.rwa-p--tight {
    margin-top: 0.25rem;
}

.chat-personalities-rwa .rwa-panel--actions {
    margin-top: 0.25rem;
}

.cube-admin-status {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.cube-admin-tile-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.cube-admin-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.cube-admin-tile-header .home-panel-title {
    margin: 0;
}

.cube-admin-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.cube-admin-section-header .home-panel-title {
    margin: 0;
}

.cube-admin-delete-btn {
    margin-left: auto;
    border: 1px solid rgba(248, 113, 113, 0.75);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.95), rgba(69, 10, 10, 0.95));
    color: #fee2e2;
    border-radius: 8px;
    width: 1.9rem;
    height: 1.9rem;
    line-height: 1;
    font-weight: 800;
    cursor: pointer;
}

.cube-admin-delete-btn:hover {
    background: linear-gradient(180deg, rgba(153, 27, 27, 0.98), rgba(91, 14, 14, 0.98));
    color: #fff;
}

.cube-admin-delete-btn-nav {
    border-color: rgba(248, 113, 113, 0.75);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.95), rgba(69, 10, 10, 0.95));
    color: #fee2e2;
}

.cube-admin-delete-btn-nav:hover {
    background: linear-gradient(180deg, rgba(153, 27, 27, 0.98), rgba(91, 14, 14, 0.98));
    color: #fff;
}

.cube-admin-tile-toggles {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.cube-admin-tile-toggles label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.cube-admin-link-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
}

.cube-admin-file-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.75rem;
}

.cube-admin-inline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    color: #cbd5e1;
    font-size: 0.85rem;
    white-space: nowrap;
}

.cube-admin-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 0.5rem;
    align-items: center;
}

.cube-admin-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1rem;
    align-items: stretch;
}

.cube-admin-tile-preview {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: rgba(5, 11, 24, 0.66);
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cube-admin-tile-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cube-admin-tile-preview-empty {
    color: #94a3b8;
    font-size: 0.82rem;
    padding: 0.75rem;
    text-align: center;
}

.cube-admin-ai-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: start;
}

.cube-admin-ai-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 9.5rem;
}

.cube-admin-ai-action-btn {
    width: 100%;
}

.cube-admin-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(10, 16, 29, 0.72);
    color: #e2e8f0;
}

.cube-admin-input:focus {
    outline: 2px solid rgba(167, 139, 250, 0.45);
    outline-offset: 1px;
}

.cube-admin-nav-right {
    margin-left: auto;
}

.cube-admin-select {
    min-width: 260px;
}

.cube-admin-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    margin-bottom: 1rem;
}

.cube-admin-toolbar-right {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
}

.cube-admin-btn {
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(18, 28, 46, 0.82);
    color: #e2e8f0;
    font-weight: 600;
}

.cube-admin-btn-primary {
    border-color: rgba(167, 139, 250, 0.35);
    color: #ede9fe;
}

.cube-admin-btn-save {
    border-color: rgba(34, 197, 94, 0.65);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
    color: #f0fdf4;
}

.cube-admin-btn-save:hover {
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.98), rgba(21, 128, 61, 0.98));
    color: #ffffff;
}

.cube-admin-btn-save-pulse {
    animation: cube-admin-save-pulse 1.35s ease-in-out infinite;
}

@keyframes cube-admin-save-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
        transform: scale(1);
    }
    55% {
        box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
        transform: scale(1);
    }
}

.cube-admin-btn-new {
    border-color: rgba(248, 113, 113, 0.75);
    background: linear-gradient(180deg, rgba(153, 27, 27, 0.96), rgba(127, 29, 29, 0.96));
    color: #fee2e2;
    text-decoration: none;
}

.cube-admin-btn-new:hover,
.cube-admin-btn-new:focus-visible {
    background: linear-gradient(180deg, rgba(185, 28, 28, 0.98), rgba(153, 27, 27, 0.98));
    color: #ffffff;
}

.cube-admin-save-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cube-admin-draft-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(120, 53, 15, 0.28);
    color: #fde68a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.cube-admin-tile-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.cube-admin-tile-actions__msg {
    flex: 1 1 auto;
    min-width: 0;
}

.cube-admin-tile-save-feedback {
    font-size: 0.82rem;
}

.cube-admin-add-card-btn {
    margin-top: 0.75rem;
    border: none;
    background: transparent;
    color: #f3a6ac;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 0.25rem 0.1rem;
}

.cube-admin-add-card-btn:hover,
.cube-admin-add-card-btn:focus-visible {
    color: #ffc2c7;
}

.cube-admin-prompt {
    font-family: Consolas, "Courier New", monospace;
    min-height: 26rem;
    resize: none;
    overflow-y: hidden;
    field-sizing: content;
}

.cube-admin-shell .home-panel {
    background: rgba(20, 31, 52, 0.8);
}

.api-auth-shell {
    max-width: 1100px;
}

.api-auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.85rem 1rem;
    margin-top: 1rem;
}

.api-auth-field {
    margin: 0;
}

.api-auth-help {
    color: #94a3b8;
    font-size: 0.78rem;
    line-height: 1.35;
}

.api-auth-fingerprint {
    color: #93c5fd;
    font-size: 0.75rem;
    line-height: 1.3;
}

.api-auth-fallback {
    color: #c4b5fd;
    font-size: 0.75rem;
    line-height: 1.3;
}

.api-auth-actions {
    margin-top: 1rem;
}

.cube-bulk-results {
    display: grid;
    gap: 0.4rem;
}

.cube-bulk-result-row {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.88rem;
}

.cube-bulk-result-row--ok {
    border-color: rgba(74, 222, 128, 0.45);
    color: #bbf7d0;
}

.cube-bulk-result-row--warn {
    border-color: rgba(251, 146, 60, 0.45);
    color: #fed7aa;
}

.cube-bulk-progress-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.58);
}

.cube-bulk-progress-dialog {
    width: 75vw;
    max-width: 75vw;
    margin: 0;
}

.cube-bulk-progress-detail {
    margin: 0.35rem 0 0.7rem;
    color: #cbd5e1;
}

.cube-bulk-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
}

.cube-bulk-progress-context {
    display: grid;
    gap: 0.18rem;
    margin-bottom: 0.55rem;
    font-size: 0.83rem;
    color: #cbd5e1;
}

.cube-bulk-progress-context strong {
    color: #94a3b8;
    font-weight: 700;
}

.cube-bulk-progress-track {
    height: 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(10, 16, 29, 0.75);
    overflow: hidden;
}

.cube-bulk-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(96, 165, 250, 0.95), rgba(167, 139, 250, 0.95));
    transition: width 220ms ease;
}

.cube-bulk-progress-events {
    margin-top: 0.75rem;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.44);
}

.cube-bulk-progress-event {
    padding: 0.4rem 0.6rem;
    font-size: 0.84rem;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.cube-bulk-progress-event:last-child {
    border-bottom: none;
}

.cube-list-item {
    text-decoration: none;
    display: block;
}

.cube-list-title {
    font-size: 1.2em;
}

.cube-list-item:hover,
.cube-list-item:focus-visible {
    border-color: rgba(167, 139, 250, 0.45);
    background: rgba(31, 46, 74, 0.86);
}

.cube-list-item--incomplete {
    border-color: rgba(248, 113, 113, 0.78);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.62), rgba(69, 10, 10, 0.62));
}

.cube-list-item--incomplete .home-panel-title {
    color: #fecaca;
}

.cube-list-item--incomplete .home-panel-meta {
    color: #fee2e2;
}

.home-sample-k {
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #94a3b8;
}

.home-sample-v {
    font-variant-numeric: tabular-nums;
    color: #e2e8f0;
}

.home-sample-cubes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 1rem;
    max-width: 180px;
}

.home-sample-cubes span {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.25), rgba(15, 23, 42, 0.6));
}

/* Bible reader page — colors from CSS vars; themes set vars in css/site-themes.css via html[data-home-theme] */
.bible-reader-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(0.65rem, 1.8vw, 1.1rem) clamp(0.75rem, 2.2vw, 1.75rem) clamp(0.75rem, 2vw, 1.25rem);
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    background: var(--br-page-bg, #000814);
    /* Defaults (slate) when theme vars not loaded yet */
    --br-title: #f8fafc;
    --br-subtitle: #cbd5e1;
    --br-label: #cbd5e1;
    --br-home-bg: rgba(15, 23, 42, 0.7);
    --br-home-border: rgba(148, 163, 184, 0.35);
    --br-home-color: #e2e8f0;
    --br-select-bg: rgba(15, 23, 42, 0.85);
    --br-select-border: rgba(148, 163, 184, 0.42);
    --br-select-color: #f8fafc;
    --br-card-border: rgba(148, 163, 184, 0.34);
    --br-card-bg: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.9));
    --br-reference: #f8fafc;
    --br-translation: #93c5fd;
    --br-verse-li: #e2e8f0;
    --br-verse-num: #facc15;
    --br-section-title: #f8fafc;
    --br-pill-bg: rgba(30, 41, 59, 0.86);
    --br-pill-border: rgba(148, 163, 184, 0.42);
    --br-pill-color: #f8fafc;
    --br-inline-color: #fde68a;
    --br-inline-underline: rgba(250, 204, 21, 0.55);
    --br-popover-bg: rgba(2, 6, 23, 0.97);
    --br-popover-border: rgba(148, 163, 184, 0.45);
    --br-popover-color: #e2e8f0;
}

.bible-reader-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 0.9rem;
}

.bible-reader-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.1rem;
    padding: 0 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--br-home-border);
    background: var(--br-home-bg);
    color: var(--br-home-color) !important;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
}

.bible-reader-title {
    margin: 0;
    font-size: clamp(1.4rem, 3.2vw, 2rem);
    color: var(--br-title) !important;
}

.bible-reader-subtitle {
    margin: 0.3rem 0 0 0;
    color: var(--br-subtitle) !important;
    font-size: 0.9rem;
    line-height: 1.45;
}

.bible-reader-theme {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--br-label) !important;
    white-space: nowrap;
}

.bible-reader-theme-label {
    color: inherit;
}

.bible-reader-controls label {
    display: inline-flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--br-label) !important;
}

.bible-reader-theme select,
.bible-reader-controls select {
    min-width: 11rem;
    border-radius: 8px;
    border: 1px solid var(--br-select-border);
    background: var(--br-select-bg);
    color: var(--br-select-color);
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.4rem 0.55rem;
}

.bible-reader-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.9rem;
}

.bible-reader-card {
    border: 1px solid var(--br-card-border);
    border-radius: 12px;
    background: var(--br-card-bg);
    padding: 0.9rem 1rem;
    margin-bottom: 0.9rem;
}

.bible-reader-chapter-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 0.65rem;
    margin-bottom: 0;
}

.bible-reader-chapter-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.35rem;
    margin-right: -0.2rem;
    scrollbar-gutter: stable;
}

.bible-reader-prose {
    margin: 0;
    color: var(--br-verse-li);
    line-height: 1.6;
    font-size: 0.96rem;
    white-space: pre-wrap;
}

.bible-reader-error {
    margin: 0;
    color: #fca5a5;
    font-size: 0.92rem;
    line-height: 1.5;
}

.bible-reader-error code {
    font-size: 0.85em;
    color: #fde68a;
}

html[data-home-theme="light"] .bible-reader-page .bible-reader-error,
html[data-home-theme="light"] .bible-reader-page .bible-reader-error code {
    color: #000000 !important;
}

/*
 * Light Bible reader: global `body, span, li, h2, … { color: #fff !important }` wins over
 * `color: var(--br-*)` without !important — force ink for chapter UI + main text.
 */
html[data-home-theme="light"] .bible-reader-page .bible-reader-reference,
html[data-home-theme="light"] .bible-reader-page .bible-reader-translation,
html[data-home-theme="light"] .bible-reader-page .bible-reader-verses li,
html[data-home-theme="light"] .bible-reader-page .bible-reader-verse-num,
html[data-home-theme="light"] .bible-reader-page .bible-reader-verse-text,
html[data-home-theme="light"] .bible-reader-page .bible-reader-prose,
html[data-home-theme="light"] .bible-reader-page .bible-word-inline,
html[data-home-theme="light"] .bible-reader-page .bible-word-pill,
html[data-home-theme="light"] .bible-reader-page .bible-word-popover {
    color: #000000 !important;
}

.bible-reader-reference {
    margin: 0 0 0.55rem 0;
    color: var(--br-reference) !important;
    font-size: 1rem;
}

.bible-reader-translation {
    margin-left: 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--br-translation);
}

.bible-reader-verses {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.bible-reader-verses li {
    display: grid;
    grid-template-columns: 1.6rem 1fr;
    gap: 0.45rem;
    align-items: start;
    color: var(--br-verse-li);
    line-height: 1.55;
    font-size: 0.96rem;
}

.bible-reader-verse-text {
    display: inline;
}

.bible-reader-verse-num {
    color: var(--br-verse-num);
    font-weight: 700;
    text-align: right;
}

.bible-reader-word-study-title {
    margin: 0 0 0.6rem 0;
    font-size: 0.92rem;
    color: var(--br-section-title) !important;
}

.bible-reader-word-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bible-word-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid var(--br-pill-border);
    background: var(--br-pill-bg);
    color: var(--br-pill-color);
    font-size: 0.82rem;
    cursor: help;
}

.bible-word-inline {
    position: relative;
    display: inline;
    color: var(--br-inline-color);
    text-decoration: underline dotted var(--br-inline-underline);
    text-underline-offset: 2px;
    cursor: help;
}

.bible-word-popover {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 0.45rem);
    transform: translateX(-50%);
    width: min(24rem, 92vw);
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--br-popover-border);
    background: var(--br-popover-bg);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    color: var(--br-popover-color);
    z-index: 40;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.78rem;
    line-height: 1.45;
}

.bible-word-popover span,
.bible-word-popover strong,
.bible-word-popover b {
    display: block;
    color: inherit;
}

.bible-word-pill:hover .bible-word-popover,
.bible-word-pill:focus-within .bible-word-popover,
.bible-word-inline:hover .bible-word-popover,
.bible-word-inline:focus-within .bible-word-popover {
    display: block;
}

/* Home main grid: 3 columns → 2 (sidebar full-width row) → 1 when viewport shrinks / zoom increases */
@media (max-width: 75rem) {
    .home-columns,
    .home-columns-samples {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-columns-samples .home-col-sidebar {
        grid-column: 1 / -1;
    }
}

@media (max-width: 48rem) {
    .home-columns,
    .home-columns-samples {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-columns-samples .home-col-sidebar {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .home-verse {
        float: none;
        max-width: 100%;
        margin: 0 0 1rem 0;
        text-align: left;
    }

    .home-nav-list {
        gap: 0.15rem;
    }

    .home-nav-link {
        padding: 0.4rem 0.65rem;
        font-size: 0.8rem;
    }

    .home-nav-list > .home-nav-item:not(.home-nav-item-endcap) > a.home-nav-link {
        padding-bottom: calc(0.4rem + 0.4rem);
    }

    .home-nav-item-feedback > .home-nav-link {
        padding-bottom: calc(0.4rem + 0.4rem);
    }

    .home-nav-list > .home-nav-item-donations > a.home-nav-link {
        padding-bottom: calc(0.4rem + 0.4rem);
    }
}

/* Bible Cubes — full-viewport scene under fixed header */
.bible-cubes-page {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: #000;
}

/* Bible Cubes V1 — first-run instructions: black type on parchment (transparent panel); see bibleCubesV1.mjs */
.bible-cubes-start-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
        max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    pointer-events: auto;
}

.bible-cubes-start-overlay__bg {
    position: absolute;
    inset: 20px;
    z-index: 0;
    pointer-events: none;
    background-color: #0d0a06;
    background-position: center;
    background-repeat: no-repeat;
    /* Fill the inset box; aspect ratio of the asset may stretch (not preserved). */
    background-size: 100% 100%;
}

.bible-cubes-start-overlay__panel {
    position: relative;
    z-index: 1;
    width: min(46rem, 94vw);
    max-height: min(88vh, 760px);
    overflow: auto;
    box-sizing: border-box;
    padding: clamp(0.85rem, 2.5vw, 1.35rem) clamp(0.9rem, 3vw, 1.55rem);
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    /* Ink on parchment; global page rules may force light type — win with !important. */
    color: #000000 !important;
}

.bible-cubes-start-overlay__title {
    margin: 0 0 0.45rem;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(1.15rem, 2.6vw, 1.45rem);
    font-weight: 700;
    color: #000000 !important;
    letter-spacing: 0.02em;
    text-shadow: none;
}

.bible-cubes-start-overlay__instructions {
    margin: 0 0 0.75rem;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(0.95rem, 2.1vw, 1.05rem);
    line-height: 1.38;
    color: #000000 !important;
    white-space: pre-line;
    text-shadow: none;
}

.bible-cubes-start-overlay__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.bible-cubes-start-overlay__ok {
    min-width: 7.5rem;
    padding: 0.55rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: system-ui, "Segoe UI", sans-serif;
    color: #0f0f0f;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid rgba(40, 28, 10, 0.45);
    background: linear-gradient(180deg, #ffe9a8 0%, #e8b84a 100%);
    box-shadow: 0 2px 0 rgba(80, 52, 8, 0.35);
}

.bible-cubes-start-overlay__ok:hover {
    filter: brightness(1.03);
}

.bible-cubes-start-overlay__loading {
    margin-top: 0.25rem;
}

.bible-cubes-start-overlay__loading-text {
    margin: 0 0 0.65rem;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #000000 !important;
    text-shadow: none;
}

.bible-cubes-start-overlay__progress {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.bible-cubes-start-overlay__progress-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #c9a227, #8b6914);
    transition: width 220ms ease;
}

.bible-cubes-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 121;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 52px;
    padding: 0 0.75rem 0 0.5rem;
    background: rgba(6, 6, 10, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.bible-cubes-90-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    cursor: pointer;
    user-select: none;
    font-size: 0.8rem;
    font-weight: 500;
    color: #cbd5e1;
    font-family: system-ui, "Segoe UI", sans-serif;
}

.bible-cubes-90-option input {
    width: 1rem;
    height: 1rem;
    accent-color: #a78bfa;
    cursor: pointer;
}

.bible-cubes-90-label {
    color: #e2e8f0;
}

.bible-cubes-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 44px;
    color: #94a3b8 !important;
    text-decoration: none;
    font-size: 1.1rem;
    border-radius: 8px;
}

.bible-cubes-home:hover,
.bible-cubes-home:focus-visible {
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.06);
}

.bible-cubes-brand {
    display: flex;
    align-items: center;
    gap: 0.12rem;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #f1f5f9;
}

.bible-cubes-word {
    color: #f8fafc;
}

.bible-cubes-c {
    margin-right: -0.02em;
    color: #c4b5fd;
}

.bible-cubes-u {
    width: 2.5rem;
    height: 2.05rem;
    margin: 0 0.04rem 0 0.02rem;
    flex-shrink: 0;
    display: block;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

.bible-cubes-voxel-brick path {
    vector-effect: non-scaling-stroke;
}

.bible-cubes-voxel-brick .bible-cubes-f-top {
    fill: #d6dbe3;
    stroke: rgba(55, 60, 70, 0.35);
    stroke-width: 0.2;
}

.bible-cubes-voxel-brick .bible-cubes-f-left {
    fill: #6e757f;
    stroke: rgba(30, 34, 40, 0.35);
    stroke-width: 0.2;
}

.bible-cubes-voxel-brick .bible-cubes-f-right {
    fill: #9ea5af;
    stroke: rgba(55, 60, 70, 0.3);
    stroke-width: 0.2;
}

.bible-cubes-voxel-back .bible-cubes-f-top {
    fill: #bfc5ce;
}

.bible-cubes-voxel-back .bible-cubes-f-left {
    fill: #5c626b;
}

.bible-cubes-voxel-back .bible-cubes-f-right {
    fill: #8b919b;
}

.bible-cubes-host {
    position: fixed;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    overflow: hidden;
}

.bible-cubes-v1-page .bible-cubes-host {
    top: 0;
}

.bible-cubes-scale-page.v1-focus-header-hidden .bible-cubes-host,
.bible-cubes-v1-page.v1-focus-header-hidden .bible-cubes-host {
    top: 0;
    z-index: 122;
}

.bible-cubes-host canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
}

/* Bible Cubes V1 — focus: tight column under top-right × (report, then admin edit). Tile overlay reuses the same × slot (no extra top offset). */
.bible-cubes-focus-side-actions {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px) + 44px + 4px);
    right: calc(8px + env(safe-area-inset-right, 0px));
    z-index: 1319;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    pointer-events: auto;
}

/* localhost Admin: edit focused cube (opens Cube Admin in new tab) */
.bible-cubes-focus-edit-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bible-cubes-focus-edit-link:hover,
.bible-cubes-focus-edit-link:focus-visible {
    color: #fff;
    background: rgba(30, 41, 59, 0.92);
    border-color: rgba(196, 181, 253, 0.55);
    outline: none;
}

.bible-cubes-focus-edit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bible-cubes-focus-report-btn {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    color: #fecaca !important;
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(248, 113, 113, 0.55) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bible-cubes-focus-report-btn:hover,
.bible-cubes-focus-report-btn:focus-visible {
    color: #fee2e2 !important;
    background: rgba(69, 10, 10, 0.55) !important;
    border-color: rgba(252, 165, 165, 0.85) !important;
    outline: none;
}

/* Report dialog (XRPL-style floating hint reuses .rwa-input-wrap / .rwa-float-hint) */
.bible-cubes-report-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1340;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.bible-cubes-report-backdrop.is-open {
    display: flex;
}

.bible-cubes-report-panel {
    width: min(420px, 100%);
    max-height: min(88vh, 520px);
    overflow: auto;
    padding: 1.15rem 1.25rem 1.25rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.96);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}

.bible-cubes-report-panel h2 {
    margin: 0 0 0.85rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc !important;
}

.bible-cubes-report-panel .rwa-float-hint {
    color: rgba(203, 213, 225, 0.92) !important;
}

.bible-cubes-report-panel .rwa-input-wrap:focus-within .rwa-float-hint,
.bible-cubes-report-panel .rwa-input-wrap:has(.rwa-textarea:not(:placeholder-shown)) .rwa-float-hint {
    background: #0f172a !important;
    border-color: rgba(100, 116, 139, 0.95) !important;
    color: #cbd5e1 !important;
}

.bible-cubes-report-textarea {
    width: 100%;
    min-height: 5.5rem;
    resize: vertical;
    box-sizing: border-box;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(71, 85, 105, 0.95);
    background: rgba(2, 6, 23, 0.92);
    color: #f1f5f9 !important;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.4;
}

.bible-cubes-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

.bible-cubes-report-actions button {
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0 !important;
}

.bible-cubes-report-actions .bible-cubes-report-send {
    background: rgba(30, 58, 138, 0.95);
    border-color: rgba(129, 140, 248, 0.55);
    color: #eef2ff !important;
}

/* Bible Cubes V1 — loading until first WebGL frame is composited */
.bible-cubes-loading {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.bible-cubes-loading--hide {
    opacity: 0;
    visibility: hidden;
}

.bible-cubes-loading__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.35rem;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.38);
    background: rgba(15, 23, 42, 0.88);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.bible-cubes-loading__text {
    margin: 0;
    font-family: system-ui, "Segoe UI", sans-serif;
    font-size: clamp(0.92rem, 2.2vw, 1.08rem);
    font-weight: 600;
    letter-spacing: 0.03em;
    color: #f8fafc;
    text-align: center;
}

.bible-cubes-loading__spinner {
    display: block;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 3px solid rgba(148, 163, 184, 0.35);
    border-top-color: #fde68a;
    animation: bible-cubes-loading-spin 0.85s linear infinite;
}

@keyframes bible-cubes-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Blasteroids — Three.js full-viewport game (same shell pattern as Bible Cubes) */
.blasteroids-page {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: #000000;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.blasteroids-header {
    position: relative;
    flex-shrink: 0;
    z-index: 121;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    min-height: 52px;
    padding: 0.35rem 0.75rem 0.35rem 0.45rem;
    background: linear-gradient(180deg, rgba(10, 14, 32, 0.97) 0%, rgba(6, 8, 20, 0.92) 100%);
    border-bottom: 1px solid rgba(255, 214, 128, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.blasteroids-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 44px;
    color: #94a3b8 !important;
    text-decoration: none;
    font-size: 1.1rem;
    border-radius: 8px;
}

.blasteroids-home:hover,
.blasteroids-home:focus-visible {
    color: #fde68a !important;
    background: rgba(255, 255, 255, 0.06);
}

.blasteroids-brand {
    display: flex;
    align-items: baseline;
    gap: 0.06rem;
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f8fafc;
}

.blasteroids-word--gold {
    background: linear-gradient(135deg, #fff7d6 0%, #f59e0b 55%, #d97706 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 24px rgba(251, 191, 36, 0.35);
}

.blasteroids-tagline {
    margin: 0 0 0 auto;
    max-width: min(28rem, 42vw);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(199, 210, 254, 0.75);
    line-height: 1.35;
}

@media (max-width: 720px) {
    .blasteroids-tagline {
        width: 100%;
        max-width: none;
        margin: 0.15rem 0 0 0;
        order: 4;
    }
}

.blasteroids-host--intro .blasteroids-hud {
    visibility: hidden;
}

/* Blasteroids intro — instructions on stretched Parchment.jpg (+ cream wash); wwwroot/images/Parchment/Parchment.jpg */
.blasteroids-page .blasteroids-intro-overlay::before {
    background-image:
        linear-gradient(165deg, rgba(255, 252, 245, 0.38) 0%, rgba(245, 236, 220, 0.46) 100%),
        url("/images/Parchment/Parchment.jpg");
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
}

.blasteroids-page .blasteroids-intro-overlay .bible-cubes-parchment-text {
    background: rgba(255, 254, 252, 0.88);
    border-radius: 12px;
    box-shadow: 0 4px 28px rgba(62, 44, 28, 0.18);
    box-sizing: border-box;
}

/* Parchment intro: same asset + text classes as BibleCubes tile label */
.blasteroids-intro-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding:
        calc(20px + env(safe-area-inset-top, 0px))
        calc(14px + env(safe-area-inset-right, 0px))
        calc(18px + env(safe-area-inset-bottom, 0px))
        calc(14px + env(safe-area-inset-left, 0px));
    background: transparent;
    isolation: isolate;
    box-sizing: border-box;
}

/* Full-viewport stretched parchment (rotation/scale from bibleParchmentAspect.mjs). */
.blasteroids-intro-overlay::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--bible-parchment-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
}

.blasteroids-intro-overlay > * {
    position: relative;
    z-index: 1;
}

.blasteroids-intro-overlay .bible-cubes-parchment {
    width: 100%;
    min-height: 0;
    max-height: 100%;
    box-sizing: border-box;
    background-color: transparent;
}

/* Texture is on the overlay ::above; inner scroll uses text + optional wash only. */
.blasteroids-intro-overlay .bible-cubes-parchment::before {
    content: none;
}

.blasteroids-intro-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.25rem;
}

.blasteroids-start-btn {
    cursor: pointer;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #1a0f06;
    padding: 0.55rem 2.25rem;
    border: 2px solid rgba(74, 44, 18, 0.45);
    border-radius: 10px;
    background: linear-gradient(180deg, #fde68a 0%, #f59e0b 45%, #d97706 100%);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.blasteroids-start-btn:hover,
.blasteroids-start-btn:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    outline: none;
}

.blasteroids-host {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    outline: none;
}

.blasteroids-host canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    touch-action: none;
    cursor: crosshair;
}

.blasteroids-hud {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 5;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: rgba(6, 10, 28, 0.72);
    border: 1px solid rgba(255, 230, 180, 0.14);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    color: #e2e8f0;
    pointer-events: none;
    max-width: min(18rem, 88vw);
}

.blasteroids-hud-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
}

.blasteroids-hud-row:last-of-type {
    margin-bottom: 0.35rem;
}

.blasteroids-hud-label {
    color: rgba(196, 210, 254, 0.75);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.65rem;
}

.blasteroids-hud-hint {
    font-size: 0.62rem;
    line-height: 1.45;
    color: rgba(148, 163, 184, 0.9);
    letter-spacing: 0.02em;
}

.blasteroids-hud-verse {
    margin-top: 0.4rem;
    font-size: 0.6rem;
    font-style: italic;
    color: rgba(253, 230, 138, 0.55);
    letter-spacing: 0.03em;
}

.blasteroids-hud-gameover {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(251, 191, 36, 0.25);
    font-size: 0.78rem;
    font-weight: 600;
    color: #fde68a;
    letter-spacing: 0.04em;
}

.blasteroids-hud-shell {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
    pointer-events: none;
    max-width: min(20rem, 92vw);
}

.blasteroids-hud-shell .blasteroids-hud {
    position: relative;
    top: auto;
    left: auto;
}

.blasteroids-hud-shell .game-highscore-panel {
    pointer-events: auto;
}

.bible-cubes-tile-label-btn {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 126;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(226, 232, 240, 0.42);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.84);
    color: #f8fafc;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.bible-cubes-tile-label-btn:hover,
.bible-cubes-tile-label-btn:focus-visible {
    border-color: rgba(125, 211, 252, 0.8);
    background: rgba(15, 23, 42, 0.94);
}

.bible-cubes-tile-label-overlay {
    position: fixed;
    inset: 0;
    z-index: 1320;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding:
        calc(18px + env(safe-area-inset-top, 0px))
        calc(14px + env(safe-area-inset-right, 0px))
        calc(16px + env(safe-area-inset-bottom, 0px))
        calc(14px + env(safe-area-inset-left, 0px));
    /* Softer dim: full-strength rgba read as a “black sheet” over the parchment */
    background: rgba(15, 18, 28, 0.32);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

/*
 * app.css opens with `body, div, span, strong, … { color: #fff !important }`.
 * That wins over `.bible-cubes-parchment-text { color: #000 }` for some descendants
 * (same specificity + later source order). Force ink-on-parchment for the whole overlay.
 */
.bible-cubes-tile-label-overlay,
.bible-cubes-tile-label-overlay * {
    color: #1c1008 !important;
}

/* Beats rule above: close control lives inside overlay but must stay light on dark chip. */
.bible-cubes-tile-label-overlay .bible-cubes-tile-label-close,
.bible-cubes-tile-label-overlay .bible-cubes-tile-label-close * {
    color: #ffffff !important;
}

.bible-cubes-tile-label-overlay ::selection {
    color: #0f172a !important;
    background: rgba(186, 230, 253, 0.95);
}

.bible-cubes-tile-label-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.bible-cubes-tile-label-overlay.is-fading {
    opacity: 0;
}

.bible-cubes-tile-label-close {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    z-index: 1335;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    line-height: 1;
    color: #f8fafc !important;
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bible-cubes-tile-label-close:hover,
.bible-cubes-tile-label-close:focus-visible {
    color: #ffffff !important;
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(196, 181, 253, 0.55) !important;
    outline: none;
}

.bible-cubes-tile-label-close__x {
    font-size: 1.65rem;
    font-weight: 300;
    line-height: 1;
    margin-top: -0.08em;
}

/* Focus cube view: same × as tile text; sits under full-screen overlay (1320) so only one × while reading. */
.bible-cubes-tile-label-close.bible-cubes-focus-exit-close {
    z-index: 1318;
}

.bible-cubes-image-debug-overlay {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 128;
    width: min(560px, calc(100% - 1.5rem));
    border: 1px solid rgba(251, 113, 133, 0.55);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.9);
    color: #fee2e2;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    font-family: Consolas, "Courier New", monospace;
    pointer-events: none;
}

.bible-cubes-image-debug-title {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(251, 113, 133, 0.4);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #fecaca;
    background: rgba(69, 10, 10, 0.42);
}

.bible-cubes-image-debug-body {
    max-height: 210px;
    overflow-y: auto;
}

.bible-cubes-image-debug-row {
    padding: 0.33rem 0.6rem;
    border-bottom: 1px solid rgba(251, 113, 133, 0.18);
    font-size: 0.7rem;
    line-height: 1.35;
    word-break: break-word;
    color: #fda4af;
}

.bible-cubes-image-debug-row:last-child {
    border-bottom: none;
}

/* Same asset as BibleCubes tile overlays / intros: wwwroot/images/Parchment/Parchment.gif */
:root {
    --bible-parchment-image: url("/images/Parchment/Parchment.gif");
    /* bibleParchmentAspect.mjs updates rotation/scale from real image dimensions */
    --bible-parchment-aspect-rot: 0deg;
    --bible-parchment-bg-scale: 1;
}

/* Shared stretched parchment layer (rotate + scale from :root; image fills host) */
.bible-cubes-parchment {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    max-width: none;
    border: none;
    border-radius: 0;
    overflow: auto;
    position: relative;
    isolation: isolate;
    background-color: #0d0a06;
    background-image: none;
    opacity: 0;
    animation: bible-parchment-fade-in 420ms ease-out forwards;
    scrollbar-color: rgba(100, 100, 100, 0.55) #000000;
}

.bible-cubes-parchment::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--bible-parchment-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
    border-radius: inherit;
}

.bible-cubes-parchment > .bible-cubes-parchment-text {
    position: relative;
    z-index: 1;
}

.bible-cubes-parchment::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.bible-cubes-parchment::-webkit-scrollbar-track {
    background: #000000;
}

.bible-cubes-parchment::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 5px;
}

.bible-cubes-parchment-text {
    color: #000000 !important;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(0.98rem, 1.35vw, 1.16rem);
    line-height: 1.56;
    letter-spacing: 0.01em;
    text-shadow: none;
    white-space: pre-wrap;
    min-height: 100%;
    box-sizing: border-box;
    padding: clamp(1.25rem, 4vh, 2.5rem) 60px;
    background: transparent;
    opacity: 0;
    animation: bible-parchment-text-fade 280ms ease 180ms forwards;
}

.bible-cubes-parchment-text strong {
    font-weight: 700;
    color: #000000 !important;
}

.bible-cubes-parchment-text em {
    font-style: italic;
    color: #000000 !important;
}

/*
 * Global reset above forces h2, p, li, … to white !important.
 * Parchment intros must re-assert dark ink on the tan texture.
 */
.blasteroids-intro-overlay .bible-cubes-parchment-text,
.blasteroids-intro-overlay .bible-cubes-parchment-text h1,
.blasteroids-intro-overlay .bible-cubes-parchment-text h2,
.blasteroids-intro-overlay .bible-cubes-parchment-text h3,
.blasteroids-intro-overlay .bible-cubes-parchment-text h4,
.blasteroids-intro-overlay .bible-cubes-parchment-text p,
.blasteroids-intro-overlay .bible-cubes-parchment-text li,
.blasteroids-intro-overlay .bible-cubes-parchment-text ul,
.blasteroids-intro-overlay .bible-cubes-parchment-text ol,
.blasteroids-intro-overlay .bible-cubes-parchment-text span,
.blasteroids-intro-overlay .bible-cubes-parchment-text em,
.blasteroids-intro-overlay .bible-cubes-parchment-text div,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text h1,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text h2,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text h3,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text h4,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text p,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text li,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text ul,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text ol,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text span,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text em,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text div {
    color: #000000 !important;
}

.blasteroids-intro-overlay .bible-cubes-parchment-text strong,
.bible-cubes-tile-label-overlay .bible-cubes-parchment-text strong {
    color: #000000 !important;
}

.blasteroids-intro-overlay .bible-cubes-parchment-text {
    min-height: 0;
    padding-top: clamp(1rem, 3.5vmin, 1.9rem);
    padding-bottom: clamp(0.85rem, 2.5vmin, 1.4rem);
    padding-left: clamp(14px, 4vw, 42px);
    padding-right: clamp(14px, 4vw, 42px);
    /*
     * Parchment-text base uses white-space: pre-wrap so the dynamic cube
     * tile labels (JS-fed plaintext) keep their newlines. The game intros
     * use real HTML (h2 / p / ul / li), so pre-wrap turns every source
     * newline + indentation into a visible blank line, opening huge gaps
     * between the lead, list items, and quote. Override to normal here.
     */
    white-space: normal;
}

.bible-cubes-tile-label-overlay .bible-cubes-parchment {
    max-height: 100%;
    box-sizing: border-box;
    /* Pitch-black base read through the GIF as a veil; keep transparent so texture reads */
    background-color: transparent;
}

.bible-cubes-tile-label-overlay .bible-cubes-parchment-text {
    min-height: 0;
    padding-top: clamp(1.35rem, 4.5vmin, 2.5rem);
    padding-bottom: clamp(1rem, 3vmin, 1.85rem);
    padding-left: clamp(14px, 5vw, 52px);
    padding-right: clamp(14px, 5vw, 52px);
    /* Readable even if parchment is dark or global white-text rules leak in */
    background: rgba(255, 252, 246, 0.94);
    border-radius: 14px;
    box-shadow: 0 6px 32px rgba(40, 28, 18, 0.22), inset 0 0 0 1px rgba(120, 83, 45, 0.12);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.bible-cubes-tile-label-overlay.is-closing .bible-cubes-parchment {
    animation: bible-parchment-fade-out 220ms ease-in forwards;
}

@keyframes bible-parchment-fade-in {
    0% { opacity: 0; transform: translateY(10px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes bible-parchment-text-fade {
    0% { opacity: 0; transform: translateY(6px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes bible-parchment-fade-out {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(6px) scale(0.99); }
}

.formula-context-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.formula-context-menu {
    position: fixed;
    min-width: 156px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0b1220;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.formula-context-menu-item {
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: left;
    padding: 5px 8px;
    cursor: pointer;
}

.formula-context-menu-item-delete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.formula-context-menu-delete-target {
    color: #93c5fd;
    font-size: 0.66rem;
    font-weight: 700;
    white-space: nowrap;
}

.formula-context-menu-item:hover,
.formula-context-menu-item:focus-visible {
    background: #1e293b;
    border-color: #60a5fa;
}

.formula-quick-insert-menu {
    position: fixed;
    z-index: 1310;
    min-width: 230px;
    max-width: 360px;
    max-height: 340px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(100px, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #eff6ff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.formula-quick-insert-item {
    border: 1px solid #334155;
    border-radius: 6px;
    background: #ffffff;
    color: #000000;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: left;
    padding: 6px 8px;
    cursor: pointer;
}

.formula-quick-insert-item:hover,
.formula-quick-insert-item:focus-visible {
    background: #dbeafe;
    border-color: #2563eb;
}

.formula-node-fraction {
    position: relative;
    display: inline-grid;
    grid-template-rows: auto 1px auto;
    gap: 4px;
    min-width: 120px;
    padding-right: 24px;
}

.formula-fraction-line {
    height: 1px;
    background: #64748b;
}

.formula-fraction-top,
.formula-fraction-bottom {
    min-height: 28px;
}

.formula-node-clear {
    border: 1px solid #334155;
    border-radius: 4px;
    background: #1e293b;
    color: #fca5a5;
    font-size: 0.68rem;
    padding: 2px 6px;
}

.formula-node-wrap {
    border: 1px solid #334155;
    border-radius: 4px;
    background: #ffffff;
    color: #000000;
    font-size: 0.66rem;
    padding: 1px 5px;
    white-space: nowrap;
}

.formula-node-var-select {
    min-width: 86px;
}

.formula-node,
.formula-slot,
.formula-node-call-name,
.formula-node-var-select,
.formula-node-input::placeholder {
    color: #000000 !important;
}

.formula-node-call-name {
    background: #ffffff !important;
    color: #000000 !important;
}

.formula-palette-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

.formula-palette-section {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
}

.formula-palette-section-title {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #94a3b8;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.formula-palette-help {
    color: #94a3b8;
    font-size: 0.68rem;
    line-height: 1.35;
    margin-bottom: 8px;
}

.formula-palette-item {
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0b1220;
    padding: 8px;
    cursor: grab;
}

.formula-palette-item + .formula-palette-item {
    margin-top: 6px;
}

.formula-palette-item-primary {
    margin-top: 0 !important;
}

.formula-palette-operator-host {
    position: relative;
}

.formula-palette-flyout {
    position: absolute;
    left: auto;
    right: 0;
    top: calc(100% + 4px);
    display: none;
    gap: 6px;
    padding: 6px;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    background: #0f2f63;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    z-index: 30;
}

.formula-palette-flyout--days-inputs {
    width: 480px;
    max-width: min(72vw, 480px);
    left: auto;
    right: 0;
    display: none;
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 6px;
}

.formula-palette-operator-host:hover .formula-palette-flyout,
.formula-palette-flyout:hover {
    display: flex;
}

.formula-palette-flyout-button {
    border: 1px solid #60a5fa;
    border-radius: 6px;
    background: #0b1220;
    color: #e2e8f0;
    min-width: 36px;
    min-height: 30px;
    padding: 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: grab;
}

.formula-palette-flyout-button.formula-palette-tone-self {
    color: #bbf7d0;
    border-color: #86efac;
}

.formula-palette-flyout-button.formula-palette-tone-needs {
    color: #fecaca;
    border-color: #fca5a5;
}

.formula-palette-flyout--days-inputs .formula-palette-flyout-button {
    flex: 0 0 calc((100% - 6px) / 2);
    min-width: 0;
    padding: 6px 10px;
    font-size: 0.74rem;
    min-height: 30px;
}

.formula-palette-flyout-button:hover,
.formula-palette-flyout-button:focus-visible {
    background: #1d4f99;
    border-color: #93c5fd;
    color: #ffffff;
}

.formula-palette-item-title {
    color: #e2e8f0;
    font-size: 0.76rem;
    font-weight: 700;
}

.formula-palette-item-desc {
    color: #94a3b8;
    font-size: 0.68rem;
    margin-top: 3px;
}

.tab-divider {
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.95) 0%, rgba(250, 204, 21, 0.95) 50%, rgba(212, 175, 55, 0.95) 100%);
    margin: 10px 0 12px;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.35);
}

.tab-button-group + .tab-divider {
    margin-top: 8px;
    margin-bottom: 14px;
}

.app-title {
    margin: 4px 0 10px;
    font-size: 2.15rem !important;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.app-header-right-cluster {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    margin-left: auto;
}

.app-autotrade-kill {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    padding-bottom: 2px;
}

.app-autotrade-kill-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    line-height: 1.2;
}

.app-autotrade-kill-switch-row {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
}

.app-autotrade-kill-state-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #6b7280;
    user-select: none;
}

.app-autotrade-kill-switch {
    transform: scale(0.92);
    transform-origin: center right;
}

.app-header-right-cluster .app-balance-strip {
    margin-left: 0;
}

.app-balance-strip {
    margin-left: auto;
    display: block;
    font-size: 0.95rem;
    color: #d1d5db !important;
}

.app-balance-table {
    border-collapse: collapse;
    margin-left: auto;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.app-balance-table td,
.app-balance-table th {
    padding: 1px 14px 1px 0;
    white-space: nowrap;
    vertical-align: baseline;
}

.app-balance-table thead th {
    font-weight: 600;
    font-size: 0.82rem;
    color: #9ca3af;
    text-align: right;
}

.app-balance-table thead th.app-balance-indicator {
    text-align: left;
}

.app-balance-table tbody th.app-balance-indicator {
    font-weight: 700;
    text-align: left;
    color: #d1d5db;
}

.app-balance-table tbody td.app-balance-cell {
    text-align: right;
}

.app-balance-th-corner {
    padding-bottom: 4px;
}

.app-balance-table .app-balance-indicator {
    min-width: 78px;
}

.app-balance-cell {
    min-width: 110px;
}

.app-balance-cell-total {
    padding-left: 16px;
    border-left: 1px solid rgba(212, 175, 55, 0.35);
}

.app-balance-table tbody td.app-balance-cell-total {
    font-weight: 600;
    color: #e5e7eb;
}

.app-title-lighthouse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.7rem;
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 10px;
    background: radial-gradient(circle at 35% 35%, #132341 0%, #050b18 70%);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.35), inset 0 0 12px rgba(255, 255, 255, 0.08);
}

.app-title-paper-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 0.46em;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    align-self: center;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: linear-gradient(145deg, rgba(127, 29, 29, 0.55), rgba(67, 10, 10, 0.65));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    color: #fecaca;
}

.trade-brief-panel {
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-radius: 8px;
}

.trade-brief-loading-inline {
    margin: 12px 0 16px;
    display: flex;
    justify-content: center;
}

.trade-brief-loading-dialog {
    max-width: 440px;
    width: min(88vw, 440px);
    background: linear-gradient(180deg, #0b1220 0%, #060b14 100%);
    color: #ffffff;
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    padding: 22px 26px;
    text-align: center;
}

.trade-brief-loading-dialog-inline {
    width: 100%;
}

.trade-brief-loading-icon {
    font-size: 1.9rem;
    margin-bottom: 10px;
}

.trade-brief-loading-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fde68a;
    margin-bottom: 8px;
}

.trade-brief-loading-message {
    font-size: 1rem;
    line-height: 1.45;
    color: #e5e7eb;
}

.trade-brief-loading-note {
    margin: 14px 0 0;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #94a3b8;
}

.trade-brief-status-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 12px 0 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.92rem;
    line-height: 1.45;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: linear-gradient(145deg, rgba(127, 29, 29, 0.55), rgba(67, 10, 10, 0.65));
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.trade-brief-status-banner-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
    margin-top: 2px;
}

.trade-brief-status-banner-body {
    flex: 1 1 auto;
    min-width: 0;
}

.trade-brief-status-banner-title {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    color: #fecaca;
    margin-bottom: 6px;
}

.trade-brief-status-banner-message {
    color: #fee2e2;
}

.trade-brief-status-banner--error {
    border-color: rgba(239, 68, 68, 0.55);
}

.monitor-status-inline--brief-error {
    color: #fca5a5 !important;
    font-weight: 600;
}

.trade-brief-error {
    color: #f87171;
    margin: 8px 0;
}

.trade-brief-body {
    margin-top: 12px;
    line-height: 1.55;
    font-size: 0.98rem;
}

.trade-brief-heading {
    margin: 16px 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fde68a;
}

.trade-brief-heading:first-child {
    margin-top: 0;
}

.trade-brief-list {
    margin: 0 0 0 1.1rem;
    padding: 0;
    color: #e5e7eb;
}

.trade-brief-list li {
    margin: 0.45rem 0;
}

.trade-brief-para {
    margin: 0.35rem 0;
    color: #d1d5db;
}

.trade-brief-body a {
    color: #93c5fd;
    text-decoration: underline;
}

.trade-brief-empty-hint > p:first-child {
    margin-bottom: 0.35rem;
}

.trade-brief-empty-positions-label {
    margin: 10px 0 4px;
    font-size: 0.92rem;
    color: #d1d5db;
}

.trade-brief-empty-positions-list {
    margin-top: 4px;
}

.tab-button {
    border: 1px solid #d4af37;
    background: #111827;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.15s ease-in-out, transform 0.1s ease-in-out;
}

.tab-icon-button {
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 1.45rem;
    line-height: 1;
}

.tab-prompts-ai-link.tab-icon-button {
    font-size: inherit;
    padding: 6px 8px;
}

.tab-prompts-ai-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 3px 7px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #f8fafc;
    border: 1px solid rgba(212, 175, 55, 0.9);
    border-radius: 5px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    line-height: 1.15;
    text-transform: uppercase;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.tab-button-active.tab-prompts-ai-link .tab-prompts-ai-label {
    color: #000814;
    background: #d4af37;
    border-color: #0f172a;
}

.tab-button:hover {
    background: #1f2937;
}

.tab-button:active {
    transform: translateY(1px);
}

.tab-button-active {
    background: #d4af37;
    color: #000814;
    font-weight: 700;
}

.manual-scan-button {
    border: 1px solid #d4af37 !important;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35) inset;
    border-radius: 5px !important;
    margin-top: 4px !important;
}

.monitor-scan-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

.monitor-status-inline {
    color: #facc15 !important;
    font-weight: 600;
}

.recommendation-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    margin: 6px 0;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 5px;
    overflow: hidden;
    background: transparent;
}

.recommendation-header-row {
    width: 100%;
    padding: 8px 10px;
    background: rgba(27, 15, 49, 0.95);
    color: #f8fafc;
    font-weight: 700;
}

.recommendation-main {
    flex: 1 1 auto;
    width: 100%;
    background: transparent;
    padding: 0 10px;
}

.recommendation-actions {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    background: transparent;
    padding: 0 10px 10px 10px;
}

.recommendation-amount-input {
    width: 82px;
    text-align: right;
    -moz-appearance: textfield;
    appearance: textfield;
    margin-right: 2px;
}

.recommendation-amount-prefix {
    color: #d4af37;
    font-weight: 700;
}

.recommendation-amount-input::-webkit-outer-spin-button,
.recommendation-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.recommendation-action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.recommendation-risk-safe {
    color: #22c55e !important;
    font-weight: 700;
}

.recommendation-risk-caution {
    color: #facc15 !important;
    font-weight: 700;
}

.recommendation-risk-risky {
    color: #ef4444 !important;
    font-weight: 700;
}

.recommendation-risk-value {
    color: #e5e7eb !important;
}

.grok-node-icon {
    cursor: help;
    font-size: 0.95rem;
    line-height: 1;
    display: inline-block;
}

.grok-node-icon.empty {
    opacity: 0.45;
}

.reconnect-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 2400;
    pointer-events: none;
}

.manual-scan-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.52);
    z-index: 2390;
    pointer-events: auto;
}

.manual-scan-dialog {
    pointer-events: auto;
}

.manual-scan-dialog-emoji {
    filter: grayscale(0.1);
}

.reconnect-dialog {
    max-width: 520px;
    width: min(88vw, 520px);
    background: linear-gradient(180deg, #0b1220 0%, #060b14 100%);
    color: #ffffff;
    border: 1px solid rgba(34, 211, 238, 0.55);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    padding: 20px 24px;
    text-align: center;
    pointer-events: auto;
}

.reconnect-dialog-icon {
    font-size: 1.9rem;
    margin-bottom: 8px;
}

.reconnect-dialog-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #67e8f9;
    margin-bottom: 8px;
}

.reconnect-dialog-message {
    font-size: 1rem;
    line-height: 1.45;
    color: #e5e7eb;
}

#components-reconnect-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.58);
    z-index: 2600;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

#components-reconnect-modal.components-reconnect-hide {
    display: none !important;
}

.blazor-reconnect-card {
    width: min(88vw, 480px);
    background: linear-gradient(180deg, #0b1220 0%, #060b14 100%);
    color: #ffffff;
    border: 1px solid rgba(34, 211, 238, 0.55);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
    padding: 20px 24px;
    text-align: center;
}

.blazor-reconnect-icon {
    font-size: 1.9rem;
    margin-bottom: 8px;
}

.blazor-reconnect-title {
    font-size: 1.12rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.blazor-reconnect-message {
    color: #bfdbfe;
    margin-bottom: 6px;
}

.blazor-reconnect-attempt {
    color: #93c5fd;
    font-size: 0.9rem;
    margin-bottom: 14px;
}

/* Grok prompts tab */
.prompts-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.testing-flow-box {
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 8px;
    padding: 10px;
    margin: 4px 0;
    background: rgba(30, 41, 59, 0.35);
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.testing-flow-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #e2e8f0;
}

.testing-flow-hint {
    font-size: 0.77rem;
    color: #94a3b8;
}

.prompts-heading {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.prompts-back-inline {
    flex-shrink: 0;
    padding: 4px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.prompts-toolbar-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.prompts-panel-status {
    margin: 0 0 12px 0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.88rem;
    line-height: 1.4;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(30, 41, 59, 0.65);
    color: #e2e8f0;
}

.prompts-panel-status--ok {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(22, 101, 52, 0.35);
    color: #bbf7d0;
}

.prompts-panel-status--warn {
    border-color: rgba(251, 146, 60, 0.65);
    background: rgba(124, 45, 18, 0.45);
    color: #fed7aa;
}

.prompts-panel-status--info {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(12, 74, 110, 0.35);
    color: #bae6fd;
}

.prompts-ask-grok-button {
    width: auto;
    padding: 4px 12px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 4px;
    border: 1px solid #d4af37;
    background: #1f2937;
    color: #f9fafb;
    cursor: pointer;
    white-space: nowrap;
}

.prompts-ask-grok-button:hover:not(:disabled) {
    background: #374151;
}

.prompts-ask-grok-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.prompts-revert-last-button {
    width: auto;
    padding: 4px 12px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 4px;
    border: 1px solid #94a3b8;
    background: #1e293b;
    color: #e2e8f0;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 4px;
}

.prompts-revert-last-button:hover:not(:disabled) {
    background: #334155;
    border-color: #cbd5e1;
}

.prompts-revert-last-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.prompts-edit-templates-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto;
    padding: 4px 12px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 4px;
    border: 1px solid #d4af37;
    background: #1f2937;
    color: #f9fafb;
    cursor: pointer;
    white-space: nowrap;
}

.prompts-edit-templates-button:hover:not(:disabled) {
    background: #374151;
}

.prompts-edit-templates-button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.prompts-edit-templates-button--active {
    background: #374151;
    border-color: #fcd34d;
    color: #f9fafb;
}

.prompts-refresh-icon-button {
    border: 1px solid #d4af37;
    border-radius: 4px;
    background: #111;
}

.prompts-mode-icon-active {
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.85);
    background: rgba(30, 41, 59, 0.95);
}

/* Review: compact system (~30% of former ~12-line height), full-height proposed body */
.prompts-review-system-textarea {
    line-height: 1.4;
    font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
    font-size: 0.88rem;
    overflow-y: hidden;
    resize: none;
    field-sizing: content;
    display: block;
    box-sizing: border-box;
}

.prompts-review-user-body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
    font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
    font-size: 0.88rem;
    box-sizing: border-box;
}

.prompts-review-rationale {
    white-space: pre-wrap;
    word-break: break-word;
}

.prompts-review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
    justify-content: space-between;
    width: 100%;
}

.prompts-review-actions .data-delete-button,
.prompts-review-actions .ticker-add-button.prompts-review-action-approve {
    padding: 6px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    box-sizing: border-box;
    min-height: 2.35rem;
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.prompts-review-action-primary {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.prompts-review-action-approve {
    flex-shrink: 0;
}

.prompts-review-actions .data-delete-button {
    flex-shrink: 0;
}

.prompts-edit-scanner-block {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.prompts-edit-scanner-title {
    margin: 0 0 10px 0;
    color: #facc15;
    font-size: 1rem;
}

.prompts-history-subheading {
    margin: 0 0 8px 0;
    color: #facc15;
    font-size: 0.95rem;
    font-weight: 600;
}

.prompts-form {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.prompts-form .settings-field {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: stretch;
}

.prompts-form .settings-field > span {
    flex-shrink: 0;
}

.prompts-form .settings-field > .data-grid-input,
.prompts-form .settings-field select.data-grid-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.prompts-form .prompts-body-textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: block;
    resize: none;
    overflow-y: hidden;
    field-sizing: content;
    min-height: 280px;
    line-height: 1.4;
    font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
    font-size: 0.88rem;
}

.prompts-form .prompts-system-textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    display: block;
    min-height: 100px;
    resize: none;
    overflow-y: hidden;
    field-sizing: content;
    line-height: 1.4;
    font-size: 0.88rem;
    font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
}

.prompts-revision-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 100%;
}

.tab-panel-host-hidden {
    display: none !important;
}

.prompts-revision-note-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    resize: none;
    overflow-y: hidden;
    field-sizing: content;
}

.prompts-grok-revision-note {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.86rem;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
}

.prompts-review-paper-legend {
    margin: 6px 0 10px 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #cbd5e1;
    text-align: left;
}

.prompts-template-diff {
    margin-top: 6px;
    max-width: 100%;
    box-sizing: border-box;
}

.prompts-template-diff-same {
    margin: 0 0 4px 0;
}

.prompts-template-diff .settings-help {
    margin: 0 0 8px 0;
    font-size: 0.78rem;
    color: #94a3b8;
}

.prompts-template-diff-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: start;
}

@media (max-width: 900px) {
    .prompts-template-diff-grid {
        grid-template-columns: 1fr;
    }
}

.prompts-template-diff-col-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #7dd3fc;
    margin-bottom: 4px;
}

.prompts-template-diff-col .prompts-template-diff-lines {
    max-height: min(60vh, 28rem);
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    background: #0f172a;
    padding: 2px 0;
    font-size: 0.78rem;
    line-height: 1.45;
    font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
    color: #e2e8f0;
}

.prompts-template-diff-line {
    padding: 1px 8px 1px 10px;
    border-left: 3px solid transparent;
    white-space: pre-wrap;
    word-break: break-word;
}

.prompts-template-diff-line--unchanged {
    color: #cbd5e1;
}

.prompts-template-diff-line--old-deleted,
.prompts-template-diff-line--old-mod {
    background: rgba(127, 29, 29, 0.25);
    border-left-color: #b91c1c;
}

.prompts-template-diff-line--new-inserted,
.prompts-template-diff-line--new-mod {
    background: rgba(6, 78, 59, 0.3);
    border-left-color: #15803d;
}

.prompts-template-diff-line--phantom {
    min-height: 1.1em;
    color: #64748b;
    background: rgba(15, 23, 42, 0.6);
    border-left-color: #475569;
}

.prompts-grok-revision-note .prompts-template-diff {
    width: 100%;
    max-width: 100%;
}

.prompts-grok-revision-note .prompts-review-backtest-block {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 4px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(56, 189, 248, 0.25);
    text-align: left;
}

.prompts-review-backtest-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #7dd3fc;
    margin-bottom: 6px;
}

.prompts-review-backtest-lines {
    white-space: pre-line;
    font-size: 0.84rem;
    line-height: 1.5;
    color: #e2e8f0;
    font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
}

.prompts-review-backtest-hint {
    margin: 8px 0 0 0;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.35;
}

.prompts-review-grok-rationale-block {
    margin-top: 4px;
    color: #cbd5e1;
}

.prompts-grok-revision-note .prompts-review-rationale {
    color: #cbd5e1;
    white-space: pre-wrap;
}

.prompts-grok-revision-note .prompts-review-rationale-structured {
    margin-top: 6px;
    color: #cbd5e1;
}

.prompts-grok-revision-note .prompts-rationale-section-title {
    margin: 12px 0 6px 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #facc15;
    border-bottom: 1px solid rgba(212, 175, 55, 0.25);
    padding-bottom: 4px;
}

.prompts-grok-revision-note .prompts-rationale-section-title:first-child {
    margin-top: 0;
}

.prompts-grok-revision-note ul.prompts-rationale-bullets {
    margin: 4px 0 10px 0;
    padding-left: 1.25rem;
    color: #e2e8f0;
}

.prompts-grok-revision-note ul.prompts-rationale-bullets li {
    margin: 4px 0;
    line-height: 1.45;
}

.prompts-grok-revision-note .prompts-rationale-paragraph {
    margin: 4px 0 8px 0;
    color: #e2e8f0;
    line-height: 1.45;
}

.prompts-grok-revision-note strong {
    color: #f1f5f9;
}

.prompts-history-active-cell {
    text-align: center;
    vertical-align: middle;
    width: 3rem;
}

.prompts-active-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.15rem;
    height: 1.15rem;
    box-sizing: border-box;
    border-radius: 3px;
    background: linear-gradient(180deg, #22c55e 0%, #15803d 100%);
    border: 1px solid #4ade80;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.prompts-history-summary-cell {
    max-width: 420px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #cbd5e1;
    word-break: break-word;
    vertical-align: top;
}

.prompts-save-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.settings-save-action-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.prompts-save-inline-msg {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    max-width: min(420px, 100%);
}

.prompts-save-inline-msg--ok {
    color: #86efac;
}

.prompts-save-inline-msg--warn {
    color: #fca5a5;
}

.prompts-save-revision-button {
    width: auto;
    display: inline-block;
    padding: 4px 14px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 4px;
    border: 1px solid #d4af37;
    background: #1f2937;
    color: #f9fafb;
    cursor: pointer;
}

.prompts-save-revision-button:hover {
    background: #374151;
}

.prompts-history-scroll {
    max-height: 320px;
    overflow-y: auto;
}

.prompts-preview-cell {
    max-width: 280px;
    word-break: break-word;
}

.prompts-suggestion-preview-cell {
    max-width: 340px;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #cbd5e1;
    word-break: break-word;
    vertical-align: top;
}

.prompts-inbox-empty-cell {
    line-height: 1.55;
    vertical-align: top;
    padding-top: 8px;
    padding-bottom: 8px;
}

.prompts-suggestions-table tbody tr.prompts-suggestion-row {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.prompts-suggestions-table tbody tr.prompts-suggestion-row:hover {
    background: rgba(30, 64, 175, 0.42);
}

.prompts-suggestions-table tbody tr.prompts-suggestion-row:active {
    background: rgba(30, 64, 175, 0.55);
}

.prompts-suggestion-actions {
    white-space: normal;
}

/* Manual prompt improvement — progress stays visible on top; backdrop does not capture clicks so tabs/nav stay usable */
.prompts-improvement-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: none;
    box-sizing: border-box;
}

/* Cube Admin (and shared): modal AI progress — backdrop captures clicks so users cannot double-start jobs */
.cube-admin-ai-operation-overlay {
    pointer-events: auto;
    cursor: default;
}

.cube-admin-ai-operation-message {
    white-space: pre-line;
    text-align: left;
}

.cube-admin-ai-operation-hint {
    margin: 10px 0 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.35;
}

.prompts-improvement-dialog {
    pointer-events: auto;
    width: min(90vw, 420px);
    max-height: min(80vh, 360px);
    background: linear-gradient(180deg, #0b1220 0%, #060b14 100%);
    color: #f1f5f9;
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 14px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
    padding: 22px 24px 18px 24px;
    text-align: center;
    box-sizing: border-box;
    overflow: auto;
}

.prompts-improvement-icon {
    font-size: 1.75rem;
    margin-bottom: 6px;
    line-height: 1;
}

.prompts-improvement-title {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #facc15;
}

.prompts-improvement-message {
    margin: 0 0 12px 0;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #e2e8f0;
    min-height: 2.6em;
}

.prompts-improvement-hint {
    margin: 12px 0 0 0;
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
}

.prompts-improvement-indeterminate {
    height: 4px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.95);
    border-radius: 2px;
    overflow: hidden;
}

.prompts-improvement-indeterminate-bar {
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, #b45309, #facc15, #b45309);
    border-radius: 2px;
    animation: prompts-improvement-shimmer 1.2s ease-in-out infinite;
}

@keyframes prompts-improvement-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(400%);
    }
}

.prompts-action-compact {
    margin: 2px 4px 2px 0;
}

.formula-var-help {
    margin: 2px 0 10px;
    padding: 8px 10px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0b1220;
}

.formula-var-help-title {
    color: #facc15;
    font-size: 0.74rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.formula-var-help-text {
    color: #cbd5e1;
    font-size: 0.7rem;
    line-height: 1.35;
}

.formula-var-help-formula {
    margin-top: 5px;
    color: #93c5fd;
    font-family: Consolas, monospace;
    font-size: 0.68rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow-x: auto;
}

/*
 * -----------------------------------------------------------------------------
 * Bible Cubes V1 — zoom UI (baseline — 2026-05-01; addenda below)
 * Do not remove this note; add dated addenda if styling or markup changes.
 * Slider raw 0–1000 in BibleCubesV1Page.razor (#bible-cubes-v1-zoom); JS uses v = value/1000. Fill: --zoom-fill (percent).
 * Row: .bible-cubes-scale-zoom — min-width 280px; slider width min(42vw, 320px); Razor placeholder 500/50% until mjs init randomizes zoom + bar.
 * Addendum 2026-05-10: V1 moved zoom out of the header to a fixed right-side vertical rail; host fills the viewport from top:0.
 * Z-axis / dolly: bibleCubesV1.mjs (file-top FLOAT ZOOM header; FLOAT_Z_AXIS_SCALE, bounds = camera Z).
 * Addendum 2026-05-02: Document v=value/1000 and align comment with mjs +Z roam + matched bounds.
 * -----------------------------------------------------------------------------
 */

.bible-cubes-scale-zoom {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 280px;
}

.bible-cubes-v1-page .bible-cubes-scale-zoom--vertical {
    position: fixed;
    top: calc(50% + env(safe-area-inset-top, 0px) * 0.5 - env(safe-area-inset-bottom, 0px) * 0.5);
    right: calc(10px + env(safe-area-inset-right, 0px));
    z-index: 126;
    transform: translateY(-50%);
    margin-left: 0;
    min-width: 0;
    min-height: clamp(220px, 48vh, 390px);
    padding: 0.72rem 0.42rem;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(208, 157, 44, 0.55);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.8), rgba(4, 4, 8, 0.58));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42), inset 0 0 18px rgba(244, 196, 91, 0.06);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.bible-cubes-scale-zoom-label {
    color: #f2d37a;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bible-cubes-scale-zoom-value {
    color: #f6dda1;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    min-width: 2.8rem;
    text-align: right;
}

.bible-cubes-scale-zoom--vertical .bible-cubes-scale-zoom-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.72rem;
}

.bible-cubes-scale-zoom--vertical .bible-cubes-scale-zoom-value {
    min-width: 0;
    width: 2.6rem;
    text-align: center;
    font-size: 0.72rem;
}

.bible-cubes-scale-zoom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: min(42vw, 320px);
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(208, 157, 44, 0.65);
    background:
        linear-gradient(90deg, rgba(247, 221, 148, 0.92) 0%, rgba(247, 221, 148, 0.92) var(--zoom-fill, 50%), rgba(32, 21, 7, 0.98) var(--zoom-fill, 50%), rgba(32, 21, 7, 0.98) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 241, 191, 0.1), inset 0 1px 10px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 193, 57, 0.18);
}

.bible-cubes-scale-zoom--vertical .bible-cubes-scale-zoom-slider {
    width: 12px;
    height: clamp(150px, 34vh, 300px);
    writing-mode: vertical-rl;
    direction: rtl;
    background:
        linear-gradient(0deg, rgba(247, 221, 148, 0.92) 0%, rgba(247, 221, 148, 0.92) var(--zoom-fill, 50%), rgba(32, 21, 7, 0.98) var(--zoom-fill, 50%), rgba(32, 21, 7, 0.98) 100%);
}

.bible-cubes-scale-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(120, 80, 9, 0.95);
    background: radial-gradient(circle at 35% 35%, #fff5d1 0%, #f6c451 35%, #b87c16 72%, #5b3608 100%);
    box-shadow: 0 0 0 2px rgba(255, 223, 125, 0.45), 0 0 12px rgba(255, 190, 60, 0.55);
    cursor: pointer;
}

.bible-cubes-scale-zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(120, 80, 9, 0.95);
    background: radial-gradient(circle at 35% 35%, #fff5d1 0%, #f6c451 35%, #b87c16 72%, #5b3608 100%);
    box-shadow: 0 0 0 2px rgba(255, 223, 125, 0.45), 0 0 12px rgba(255, 190, 60, 0.55);
    cursor: pointer;
}

.bible-cubes-scale-page .bible-cubes-header,
.bible-cubes-v1-page .bible-cubes-header,
.bible-cubes-v1-page .bible-cubes-header {
    transition: opacity 260ms ease, transform 260ms ease, max-height 260ms ease, margin 260ms ease, padding 260ms ease;
    overflow: hidden;
    max-height: 120px;
}

.bible-cubes-scale-page.v1-focus-header-hidden .bible-cubes-header,
.bible-cubes-v1-page.v1-focus-header-hidden .bible-cubes-header {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    max-height: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.bible-cubes-v1-subtitle {
    color: #f4c45b;
    font-size: 0.85rem;
    letter-spacing: .03em;
    opacity: .9;
}

.bible-cubes-v1-content {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    width: min(35vw, 430px);
    min-height: 120px;
    background: linear-gradient(180deg, rgba(15, 15, 18, 0.92), rgba(9, 9, 12, 0.9));
    border: 1px solid rgba(244, 196, 91, 0.6);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45), inset 0 0 30px rgba(244, 196, 91, 0.08);
    padding: .85rem .95rem;
    color: #f6f4ec;
    z-index: 8;
}

.bible-cubes-v1-content h3 {
    margin: 0 0 .45rem;
    color: #f4c45b;
    font-size: .95rem;
}

.bible-cubes-v1-content div {
    font-size: .88rem;
    line-height: 1.42;
    opacity: .95;
    white-space: pre-wrap;
}

/* ——— Bible Word Search ——— */
.bws-page {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: #020208;
}

.bws-page--viewport {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.bws-page--viewport .bible-cubes-header.bws-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    flex-shrink: 0;
    z-index: 250;
    pointer-events: auto;
}

/* Intro overlay lives in main; keep header (themes, nav) above it and clickable */
.bws-page--viewport .bws-main {
    z-index: 1;
}

.bws-page--dark {
    color-scheme: dark;
}

/* Bible Word Search — dark: modest padding so the grid can use viewport (was 80px all sides). */
.bws-page--dark .bws-scroll--play {
    padding:
        max(8px, min(18px, 2.5vmin))
        calc(max(8px, min(22px, 3.2vw)) + env(safe-area-inset-right, 0px))
        calc(max(8px, min(18px, 2.5vmin)) + env(safe-area-inset-bottom, 0px))
        calc(max(8px, min(22px, 3.2vw)) + env(safe-area-inset-left, 0px));
}

.bws-page--dark .bws-split__left {
    background: rgba(12, 14, 28, 0.94);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(251, 191, 36, 0.22);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 10px 32px rgba(0, 0, 0, 0.5);
}

.bws-page--dark .bws-main > .bws-empty {
    padding: max(16px, min(80px, 10vmin));
    box-sizing: border-box;
}

.bws-page--dark .bws-split__left .bws-complete {
    text-align: left;
}

.bws-page--purple {
    background: linear-gradient(172deg, #24163d 0%, #1a1231 44%, #2a1d48 100%);
}

.bws-page--purple .bws-split__left {
    background: rgba(49, 30, 88, 0.9);
    border: 1px solid rgba(196, 181, 253, 0.36);
}

.bws-page--red {
    background: linear-gradient(172deg, #2f111b 0%, #241019 44%, #3b1723 100%);
}

.bws-page--red .bws-split__left {
    background: rgba(82, 24, 46, 0.88);
    border: 1px solid rgba(251, 191, 203, 0.34);
}

.bws-page--blue {
    background: linear-gradient(172deg, #0f1d3a 0%, #111b33 44%, #162848 100%);
}

.bws-page--blue .bws-split__left {
    background: rgba(17, 46, 94, 0.86);
    border: 1px solid rgba(125, 211, 252, 0.32);
}

.bws-page--purple .bws-main > .bws-empty,
.bws-page--red .bws-main > .bws-empty,
.bws-page--blue .bws-main > .bws-empty {
    padding: max(16px, min(80px, 10vmin));
    box-sizing: border-box;
}

.bws-page--purple .bws-split__left .bws-complete,
.bws-page--red .bws-split__left .bws-complete,
.bws-page--blue .bws-split__left .bws-complete {
    text-align: left;
}

.bws-theme {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    font-family: system-ui, "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.88);
}

.bws-theme-label {
    opacity: 0.78;
    white-space: nowrap;
}

.bws-theme-toggles {
    display: flex;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.32);
    overflow: hidden;
}

.bws-theme-btn {
    margin: 0;
    padding: 0.32rem 0.55rem;
    border: none;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(12, 12, 22, 0.95);
    color: #cbd5e1;
    transition: background 0.12s ease, color 0.12s ease;
}

.bws-theme-btn:hover,
.bws-theme-btn:focus-visible {
    outline: none;
    background: rgba(251, 191, 36, 0.14);
    color: #fde68a;
}

.bws-theme-btn--active {
    background: rgba(251, 191, 36, 0.32);
    color: #fffbeb;
}

.bws-header {
    padding-right: 0.65rem;
    flex-wrap: wrap;
    row-gap: 0.35rem;
}

.bws-brand {
    flex-shrink: 0;
}

.bws-title-hint-wrap {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.bws-hint-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0.2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(251, 191, 36, 0.12);
    color: rgba(253, 230, 138, 0.95);
    transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.bws-hint-btn:hover,
.bws-hint-btn:focus-visible {
    outline: none;
    background: rgba(251, 191, 36, 0.26);
    color: #fffbeb;
}

.bws-hint-btn:active {
    transform: scale(0.94);
}

.bws-hint-btn:disabled {
    opacity: 0.45;
    cursor: wait;
    transform: none;
}

.bws-hint-icon {
    width: 1.15rem;
    height: 1.15rem;
    display: block;
}

.bws-header-spacer {
    flex: 1 1 auto;
    min-width: 0.35rem;
}

.bws-difficulty {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    font-family: system-ui, "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.88);
}

.bws-difficulty-label {
    opacity: 0.78;
    white-space: nowrap;
}

.bws-difficulty-toggles {
    display: flex;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.32);
    overflow: hidden;
}

.bws-diff-btn {
    margin: 0;
    padding: 0.32rem 0.62rem;
    border: none;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(12, 12, 22, 0.95);
    color: #cbd5e1;
    transition: background 0.12s ease, color 0.12s ease;
}

.bws-diff-btn:hover,
.bws-diff-btn:focus-visible {
    outline: none;
    background: rgba(251, 191, 36, 0.14);
    color: #fde68a;
}

.bws-diff-btn--active {
    background: rgba(251, 191, 36, 0.32);
    color: #fffbeb;
}

.bws-verse-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.bws-arrow {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    color: #fcd34d;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.bws-arrow:hover:not(:disabled),
.bws-arrow:focus-visible:not(:disabled) {
    background: rgba(251, 191, 36, 0.12);
    color: #fde68a;
    outline: none;
}

.bws-arrow:disabled {
    opacity: 0.28;
    cursor: default;
}

.bws-verse-index {
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #fcd34d;
    min-width: 3.5rem;
    text-align: center;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
}

.bws-main {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: radial-gradient(ellipse 120% 80% at 50% 0%, rgba(30, 27, 64, 0.5) 0%, #020208 55%);
}

.bws-scroll {
    max-width: 52rem;
    margin: 0 auto;
    padding:
        0.85rem
        calc(12px + env(safe-area-inset-right, 0px))
        calc(1.25rem + env(safe-area-inset-bottom, 0px))
        calc(12px + env(safe-area-inset-left, 0px));
}

.bws-scroll--play {
    max-width: none;
    margin: 0;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    padding:
        0.35rem
        calc(8px + env(safe-area-inset-right, 0px))
        calc(0.5rem + env(safe-area-inset-bottom, 0px))
        calc(8px + env(safe-area-inset-left, 0px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bws-split {
    display: flex;
    flex: 1 1 0%;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
    height: 100%;
    align-items: stretch;
}

@media (orientation: landscape) and (min-width: 700px), (min-width: 1024px) {
    .bws-split {
        flex-direction: row;
        align-items: stretch;
        gap: 0.65rem;
    }
}

.bws-split__left {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    min-height: 0;
    flex: 0 1 auto;
    max-height: 42vh;
    overflow: hidden auto;
}

@media (orientation: landscape) and (min-width: 700px), (min-width: 1024px) {
    .bws-split__left {
        flex: 0 0 clamp(11.5rem, 26vw, 19rem);
        max-height: none;
        overflow: auto;
    }
}

.bws-play-title {
    margin: 0;
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    font-size: clamp(0.95rem, 2.2vw, 1.15rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fde68a;
    text-shadow: 0 0 14px rgba(251, 191, 36, 0.25);
}

.bws-verse-display {
    margin: 0;
    padding: 0.35rem 0.45rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(251, 191, 36, 0.15);
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(0.72rem, min(1.85vw, 2.8vh), 0.95rem);
    line-height: 1.45;
    color: rgba(253, 230, 210, 0.92);
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.bws-split__right {
    flex: 1 1 0%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.1rem;
    container-type: size;
    container-name: bwsgridhost;
}

.bws-split__left .bws-ref {
    text-align: left;
    margin: 0 0 0.15rem 0;
    font-size: clamp(0.88rem, 2.2vw, 1.1rem);
}

.bws-split__left .bws-blanks {
    justify-content: flex-start;
}

.bws-split__left .bws-complete {
    margin-top: 0.25rem;
}

/* Intro parchment: keep copy inside the graphic without eating tablet/phone width. */
.bws-page .blasteroids-intro-overlay .bible-cubes-parchment-text {
    padding-left: calc(clamp(18px, 6vw, 56px) + env(safe-area-inset-left, 0px));
    padding-right: calc(clamp(18px, 6vw, 56px) + env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}

/* Parchment theme: same full-viewport intro parchment as other games; ink on cream wash. */
.bws-page--parchment .blasteroids-intro-overlay {
    background: transparent;
}

.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment {
    background-color: transparent;
    background-image: none;
    scrollbar-color: rgba(80, 72, 62, 0.45) #ebe4d9;
}

.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment::-webkit-scrollbar-track {
    background: #ebe4d9;
}

.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text h1,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text h2,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text h3,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text h4,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text p,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text li,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text ul,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text ol,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text span,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text em,
.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text div {
    color: #000000 !important;
}

.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text strong {
    color: #000000 !important;
}

.bws-page--parchment .blasteroids-intro-overlay .bible-cubes-parchment-text {
    background: rgba(255, 254, 252, 0.88);
}

/* BWS intro — Dark theme: dim parchment wash, light type on a deep panel */
.bws-page--dark .blasteroids-intro-overlay::before {
    opacity: 0.12;
    filter: grayscale(0.4) brightness(0.42);
}

.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text h1,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text h2,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text h3,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text h4,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text p,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text li,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text ul,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text ol,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text span,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text em,
.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text div {
    color: #f1f5f9 !important;
}

.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text strong {
    color: #fde68a !important;
}

.bws-page--dark .blasteroids-intro-overlay .bible-cubes-parchment-text {
    background: rgba(15, 18, 32, 0.82);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.bws-page--dark .bws-intro-quote {
    color: #cbd5e1 !important;
    opacity: 0.95;
}

/* BWS intro — Light theme: soft parchment hint, dark ink on white panel */
.bws-page--light .blasteroids-intro-overlay::before {
    opacity: 0.1;
    filter: brightness(1.08);
}

.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text h1,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text h2,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text h3,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text h4,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text p,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text li,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text ul,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text ol,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text span,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text em,
.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text div {
    color: #0f172a !important;
}

.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text strong {
    color: #78350f !important;
}

.bws-page--light .blasteroids-intro-overlay .bible-cubes-parchment-text {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 12px;
    box-shadow: 0 6px 28px rgba(15, 23, 42, 0.12);
}

.bws-page--light .bws-intro-quote {
    color: #334155 !important;
    opacity: 0.95;
}

.bws-intro-title {
    margin: 0 0 0.45rem 0;
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    line-height: 1.2;
}

.bws-intro-lead {
    margin: 0 0 0.45rem 0;
    line-height: 1.32;
}

.bws-intro-list {
    margin: 0.2rem 0 0.5rem 1.1rem;
    padding: 0;
    line-height: 1.3;
}

.bws-intro-list li {
    margin-bottom: 0.16rem;
}

.bws-intro-list li:last-child {
    margin-bottom: 0;
}

.bws-intro-quote {
    margin: 0 0 0.5rem 0;
    font-style: italic;
    opacity: 0.92;
    line-height: 1.32;
}

/* BWS intro overlay: slightly tighter body copy than generic parchment intros */
.bws-page .blasteroids-intro-overlay .bible-cubes-parchment-text p,
.bws-page .blasteroids-intro-overlay .bible-cubes-parchment-text li {
    line-height: 1.38;
}

.bws-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2rem 1rem;
    font-size: 0.95rem;
}

.bws-retry-btn {
    display: block;
    margin: 0.5rem auto 0;
    cursor: pointer;
    padding: 0.45rem 1.25rem;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.12);
    color: #fde68a;
    font-weight: 600;
}

.bws-ref {
    text-align: center;
    margin: 0 0 1rem 0;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(1.05rem, 2.8vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fcd34d;
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.35);
}

.bws-grid-wrap {
    --bws-cols: 12;
    display: grid;
    grid-template-columns: repeat(var(--bws-cols), minmax(0, 1fr));
    gap: 3px;
    max-width: min(96vw, 720px);
    margin: 0 auto 1.35rem;
    padding: 5px;
    border: 1px solid rgba(251, 191, 36, 0.32);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.55) inset,
        0 4px 18px rgba(0, 0, 0, 0.55);
    box-sizing: border-box;
    user-select: none;
    touch-action: none;
}

.bws-split__right .bws-grid-wrap {
    --bws-grid-side: min(100cqw, 100cqh, 100%);
    max-width: none;
    width: var(--bws-grid-side);
    height: var(--bws-grid-side);
    max-height: 100%;
    margin: 0 auto;
    aspect-ratio: 1;
    box-sizing: border-box;
}

@supports not (container-type: size) {
    .bws-split__right .bws-grid-wrap {
        --bws-grid-fallback: min(100vw - 2rem, calc(100dvh - 9.5rem));
        width: min(100%, var(--bws-grid-fallback));
        height: min(100%, var(--bws-grid-fallback));
        max-height: min(100%, var(--bws-grid-fallback));
    }
}

@media (max-width: 699px), (orientation: portrait) and (max-width: 1023px) {
    .bws-split {
        flex-direction: column;
    }

    .bws-split__right {
        order: -1;
        flex: 1 1 0%;
        min-height: min(62dvh, 32rem);
    }

    .bws-split__left {
        order: 1;
        flex: 0 1 auto;
        max-height: min(34vh, 15rem);
    }
}

.bws-cell {
    aspect-ratio: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-weight: 700;
    font-size: clamp(0.62rem, 2.5vw, 0.98rem);
    letter-spacing: 0.02em;
    color: rgba(253, 230, 168, 0.48);
    text-shadow: none;
    background: rgba(3, 3, 8, 0.97);
    border: 1px solid rgba(251, 191, 36, 0.1);
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    transition:
        color 0.15s ease,
        text-shadow 0.15s ease,
        background 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}

.bws-split__right .bws-cell {
    font-size: clamp(0.52rem, min(3.2vmin, 3.6vw), 1.18rem);
}

.bws-cell:hover,
.bws-cell:focus-visible {
    background: rgba(251, 191, 36, 0.06);
    border-color: rgba(251, 191, 36, 0.28);
    color: rgba(253, 230, 168, 0.62);
    outline: none;
}

.bws-cell--preview {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(253, 230, 138, 0.32);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.12) inset;
    color: rgba(253, 230, 168, 0.72);
}

.bws-cell--found {
    /* Same vivid letter treatment as the original default cells */
    color: #fde68a;
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.26);
    background: rgba(10, 10, 18, 0.92);
    cursor: default;
}

.bws-cell--hint-flash {
    animation: bws-hint-flash 0.72s ease-in-out;
    position: relative;
    z-index: 1;
}

@keyframes bws-hint-flash {
    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.25);
    }

    35%,
    65% {
        box-shadow: inset 0 0 0 2px rgba(253, 224, 71, 0.85), 0 0 18px rgba(251, 191, 36, 0.45);
        background: rgba(251, 191, 36, 0.42);
        color: #0f172a;
    }
}

.bws-blanks-outer {
    position: relative;
}

.bws-blanks {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 0.35rem 0.55rem;
    row-gap: 0.65rem;
    padding: 0.25rem 0 1rem;
    border-radius: 10px;
    transition: box-shadow 0.15s ease, background 0.15s ease;
    cursor: pointer;
}

.bws-blanks--peek {
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}

@keyframes bws-letter-slot-pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

/* Tap blank row: slots pulse while letters are temporarily visible */
.bws-blanks--pulse-reveal {
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.4);
}

.bws-blanks--pulse-reveal .bws-letter-slot {
    animation: bws-letter-slot-pulse 0.42s ease-in-out infinite;
}

.bws-letter-slot--peek {
    font-weight: 800;
    color: #fef08a !important;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

.bws-verse-flash {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.9rem;
    text-align: center;
    border-radius: 10px;
    background: rgba(6, 6, 14, 0.94);
    border: 1px solid rgba(251, 191, 36, 0.5);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35),
        0 8px 32px rgba(251, 191, 36, 0.22);
    animation: bws-verse-flash-in 0.28s ease-out;
    pointer-events: none;
}

.bws-verse-flash__text {
    margin: 0;
    max-height: min(42vh, 16rem);
    overflow-y: auto;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(0.86rem, 2.1vw, 1.05rem);
    line-height: 1.48;
    color: #fef9c3;
}

.bws-verse-flash__ref {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(253, 230, 138, 0.92);
}

@keyframes bws-verse-flash-in {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bws-blanks--error {
    animation: bws-blanks-error-flash 0.42s ease;
}

@keyframes bws-blanks-error-flash {
    0%,
    100% {
        box-shadow: none;
        background: transparent;
    }

    35%,
    65% {
        box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.75);
        background: rgba(248, 113, 113, 0.1);
    }
}

.bws-word-group {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0.2rem 0.15rem;
    border-radius: 8px;
    transition:
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.bws-word-group--current {
    outline: 1px dashed rgba(251, 191, 36, 0.4);
    outline-offset: 3px;
    border-radius: 10px;
}

.bws-word-group--current .bws-letter-slot {
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.22) inset;
}

.bws-letter-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.05em;
    height: 1.35em;
    padding: 0 0.12em;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: Georgia, "Times New Roman", Times, serif;
    font-weight: 700;
    font-size: clamp(0.85rem, 2.4vw, 1.05rem);
    color: #fef3c7;
}

.bws-word-group--solved .bws-letter-slot {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.28);
}

.bws-word-group--error {
    animation: bws-word-error-flash 0.42s ease;
}

@keyframes bws-word-error-flash {
    0%,
    100% {
        box-shadow: none;
        background: transparent;
    }

    35%,
    65% {
        box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.85);
        background: rgba(248, 113, 113, 0.18);
    }
}

.bws-word-group--glow .bws-letter-slot {
    animation: bws-letter-glow 0.55s ease;
}

@keyframes bws-letter-glow {
    0% {
        box-shadow: none;
    }

    40% {
        box-shadow:
            0 0 14px rgba(251, 191, 36, 0.85),
            0 0 0 1px rgba(253, 230, 138, 0.65) inset;
        background: rgba(251, 191, 36, 0.22);
        border-color: rgba(253, 230, 138, 0.55);
    }

    100% {
        box-shadow: none;
    }
}

.bws-complete {
    text-align: center;
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fcd34d;
    letter-spacing: 0.04em;
}

/* Bible Word Search — Parchment theme (default): full-screen stretched parchment; black type */
.bws-page--parchment {
    color-scheme: light;
    position: relative;
    isolation: isolate;
    z-index: 0;
    background: #0d0a06;
}

.bws-page--parchment::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--bible-parchment-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
}

.bws-page--parchment > * {
    position: relative;
    z-index: 1;
}

.bws-page--parchment .bible-cubes-header.bws-header {
    color: #000000;
    background: linear-gradient(180deg, rgba(250, 240, 220, 0.97) 0%, rgba(232, 214, 188, 0.98) 100%);
    border-bottom: 1px solid rgba(62, 39, 18, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.bws-page--parchment .bws-header .bible-cubes-home {
    color: #000000 !important;
}

.bws-page--parchment .bws-header .bible-cubes-home:hover,
.bws-page--parchment .bws-header .bible-cubes-home:focus-visible {
    color: #000000 !important;
    background: rgba(185, 28, 28, 0.08);
}

.bws-page--parchment .bws-header .bible-cubes-brand,
.bws-page--parchment .bws-header .bible-cubes-word {
    color: #000000;
}

.bws-page--parchment .bws-header .bible-cubes-c {
    color: #000000;
}

.bws-page--parchment .bws-theme,
.bws-page--parchment .bws-difficulty-label {
    color: #000000;
}

.bws-page--parchment .bws-theme-toggles,
.bws-page--parchment .bws-difficulty-toggles {
    border-color: rgba(62, 39, 18, 0.35);
}

.bws-page--parchment .bws-theme-btn,
.bws-page--parchment .bws-diff-btn {
    background: rgba(255, 252, 246, 0.9);
    color: #000000;
}

.bws-page--parchment .bws-theme-btn:hover,
.bws-page--parchment .bws-theme-btn:focus-visible,
.bws-page--parchment .bws-diff-btn:hover,
.bws-page--parchment .bws-diff-btn:focus-visible {
    background: rgba(254, 243, 199, 0.95);
    color: #000000;
}

.bws-page--parchment .bws-theme-btn--active,
.bws-page--parchment .bws-diff-btn--active {
    background: rgba(185, 28, 28, 0.18);
    color: #000000;
}

.bws-page--parchment .bws-arrow {
    color: #000000;
    text-shadow: none;
}

.bws-page--parchment .bws-arrow:hover:not(:disabled),
.bws-page--parchment .bws-arrow:focus-visible:not(:disabled) {
    color: #000000;
    background: rgba(185, 28, 28, 0.1);
}

.bws-page--parchment .bws-verse-index {
    color: #000000;
    text-shadow: none;
}

.bws-page--parchment .bws-hint-btn {
    background: rgba(185, 28, 28, 0.12);
    color: #000000;
}

.bws-page--parchment .bws-hint-btn:hover:not(:disabled),
.bws-page--parchment .bws-hint-btn:focus-visible:not(:disabled) {
    background: rgba(185, 28, 28, 0.22);
    color: #000000;
}

/* Play area: light wash over full-screen parchment (texture on ::before above). */
.bws-page--parchment .bws-main {
    color: #000000;
    background-color: transparent;
    background-image: linear-gradient(
        168deg,
        rgba(250, 247, 242, 0.88) 0%,
        rgba(242, 235, 226, 0.9) 42%,
        rgba(228, 217, 202, 0.92) 100%
    );
    background-repeat: no-repeat;
}

.bws-page--parchment .bws-scroll--play {
    padding:
        max(8px, min(18px, 2.5vmin))
        calc(max(8px, min(22px, 3.2vw)) + env(safe-area-inset-right, 0px))
        calc(max(8px, min(18px, 2.5vmin)) + env(safe-area-inset-bottom, 0px))
        calc(max(8px, min(22px, 3.2vw)) + env(safe-area-inset-left, 0px));
}

/* Left rail: solid reading card so scripture is never painted over the scenic texture. */
.bws-page--parchment .bws-split__left {
    background: #fffef9;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(30, 22, 14, 0.12);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.85) inset,
        0 10px 28px rgba(25, 15, 8, 0.07);
}

.bws-page--parchment .bws-empty,
.bws-page--parchment .bws-retry-btn {
    color: #000000;
}

.bws-page--parchment .bws-main > .bws-empty {
    padding: max(16px, min(80px, 10vmin));
    box-sizing: border-box;
}

.bws-page--parchment .bws-play-title {
    color: #000000;
    text-shadow: none;
}

.bws-page--parchment .bws-ref {
    color: #000000;
    text-shadow: none;
}

.bws-page--parchment .bws-verse-display {
    color: #000000;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.14);
    font-weight: 500;
}

.bws-page--parchment .bws-split__left .bws-play-title,
.bws-page--parchment .bws-split__left .bws-ref,
.bws-page--parchment .bws-split__left .bws-verse-display {
    color: #000000;
    text-shadow: none;
}

.bws-page--parchment .bws-split__left .bws-letter-slot {
    color: #000000;
    background: #f4f4f5;
    border-color: rgba(0, 0, 0, 0.12);
}

.bws-page--parchment .bws-split__left .bws-letter-slot--peek {
    color: #000000 !important;
    text-shadow: none;
    background: #fff7c2 !important;
    border-color: rgba(185, 28, 28, 0.4);
}

.bws-page--parchment .bws-blanks--pulse-reveal {
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.35);
}

.bws-page--parchment .bws-grid-wrap {
    border: 1px solid rgba(62, 39, 18, 0.35);
    background: rgba(255, 252, 246, 0.94);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.5) inset,
        0 4px 14px rgba(45, 28, 12, 0.12);
}

.bws-page--parchment .bws-cell {
    color: #000000;
    background: rgba(255, 250, 242, 0.88);
    border: 1px solid rgba(62, 39, 18, 0.15);
}

.bws-page--parchment .bws-cell:hover,
.bws-page--parchment .bws-cell:focus-visible {
    background: rgba(255, 245, 230, 0.95);
    color: #000000;
    border-color: rgba(62, 39, 18, 0.28);
}

.bws-page--parchment .bws-cell--preview {
    background: rgba(254, 226, 226, 0.55);
    border-color: rgba(185, 28, 28, 0.35);
    color: #000000;
}

.bws-page--parchment .bws-cell--found {
    color: #7f1d1d;
    font-weight: 800;
    text-shadow:
        0 0 8px rgba(248, 113, 113, 0.95),
        0 0 18px rgba(220, 38, 38, 0.75),
        0 0 28px rgba(185, 28, 28, 0.55);
    background: rgba(255, 248, 245, 0.98);
    border-color: rgba(185, 28, 28, 0.45);
    box-shadow: 0 0 14px rgba(220, 38, 38, 0.35);
}

.bws-page--parchment .bws-cell--hint-flash {
    animation: bws-hint-flash-parchment 0.72s ease-in-out;
}

@keyframes bws-hint-flash-parchment {
    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.25);
    }

    35%,
    65% {
        box-shadow:
            inset 0 0 0 2px rgba(220, 38, 38, 0.75),
            0 0 18px rgba(248, 113, 113, 0.55);
        background: rgba(254, 226, 226, 0.85);
        color: #000000;
    }
}

.bws-page--parchment .bws-letter-slot {
    color: #000000;
    border-color: rgba(62, 39, 18, 0.22);
}

.bws-page--parchment .bws-word-group--current .bws-letter-slot {
    border-color: rgba(185, 28, 28, 0.45);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.2);
}

.bws-page--parchment .bws-word-group--solved .bws-letter-slot {
    color: #7f1d1d;
    font-weight: 800;
    text-shadow:
        0 0 8px rgba(248, 113, 113, 0.95),
        0 0 20px rgba(220, 38, 38, 0.72),
        0 0 32px rgba(185, 28, 28, 0.5);
    border-color: rgba(185, 28, 28, 0.35);
}

.bws-page--parchment .bws-word-group--glow .bws-letter-slot {
    animation: bws-letter-glow-parchment 0.55s ease;
}

@keyframes bws-letter-glow-parchment {
    0%,
    100% {
        box-shadow: none;
    }

    40% {
        box-shadow:
            0 0 14px rgba(248, 113, 113, 0.85),
            0 0 26px rgba(220, 38, 38, 0.55);
        color: #000000;
    }
}

.bws-page--parchment .bws-verse-flash {
    background: rgba(255, 252, 246, 0.96);
    border: 1px solid rgba(185, 28, 28, 0.35);
}

.bws-page--parchment .bws-verse-flash__text,
.bws-page--parchment .bws-verse-flash__ref {
    color: #000000;
}

.bws-page--parchment .bws-complete {
    color: #000000;
    text-shadow: none;
}

.bws-page--parchment .bws-split__left .bws-complete {
    color: #000000;
    text-shadow: none;
    text-align: left;
}

.bws-page--parchment .bws-retry-btn {
    border-color: rgba(62, 39, 18, 0.45);
    background: rgba(255, 252, 246, 0.85);
    color: #000000;
}

/* Bible Word Search — light theme */
.bws-page--light {
    color-scheme: light;
    background: #ffffff;
}

.bws-page--light .bible-cubes-header.bws-header {
    background: linear-gradient(180deg, #0f2847 0%, #0a1a33 100%);
    border-bottom: 1px solid rgba(15, 40, 71, 0.85);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.bws-page--light .bws-header .bible-cubes-home {
    color: #cbd5e1 !important;
}

.bws-page--light .bws-header .bible-cubes-home:hover,
.bws-page--light .bws-header .bible-cubes-home:focus-visible {
    color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.1);
}

.bws-page--light .bws-header .bible-cubes-brand {
    color: #f1f5f9;
}

.bws-page--light .bws-header .bible-cubes-word {
    color: #f8fafc !important;
}

.bws-page--light .bws-header .bible-cubes-c {
    color: #fde68a !important;
}

.bws-page--light .bws-theme,
.bws-page--light .bws-difficulty-label {
    color: rgba(226, 232, 240, 0.92);
}

.bws-page--light .bws-theme-toggles,
.bws-page--light .bws-difficulty-toggles {
    border-color: rgba(255, 255, 255, 0.22);
}

.bws-page--light .bws-theme-btn,
.bws-page--light .bws-diff-btn {
    background: rgba(8, 20, 40, 0.65);
    color: #e2e8f0;
}

.bws-page--light .bws-theme-btn:hover,
.bws-page--light .bws-theme-btn:focus-visible,
.bws-page--light .bws-diff-btn:hover,
.bws-page--light .bws-diff-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    color: #fffbeb;
}

.bws-page--light .bws-theme-btn--active,
.bws-page--light .bws-diff-btn--active {
    background: rgba(251, 191, 36, 0.38);
    color: #0f172a;
}

.bws-page--light .bws-arrow {
    color: #fde68a;
    text-shadow: none;
}

.bws-page--light .bws-arrow:hover:not(:disabled),
.bws-page--light .bws-arrow:focus-visible:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    color: #fffbeb;
}

.bws-page--light .bws-arrow:disabled {
    color: rgba(226, 232, 240, 0.35);
}

.bws-page--light .bws-verse-index {
    color: #e2e8f0;
    text-shadow: none;
}

.bws-page--light .bws-main {
    background: #ffffff;
}

/* Light: modest play padding so the grid can grow (match dark/parchment). */
.bws-page--light .bws-scroll--play {
    padding:
        max(8px, min(18px, 2.5vmin))
        calc(max(8px, min(22px, 3.2vw)) + env(safe-area-inset-right, 0px))
        calc(max(8px, min(18px, 2.5vmin)) + env(safe-area-inset-bottom, 0px))
        calc(max(8px, min(22px, 3.2vw)) + env(safe-area-inset-left, 0px));
}

.bws-page--light .bws-split__left {
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.92) inset,
        0 10px 28px rgba(30, 58, 95, 0.1);
}

.bws-page--light .bws-main > .bws-empty {
    padding: max(16px, min(80px, 10vmin));
    box-sizing: border-box;
}

.bws-page--light .bws-split__left .bws-complete {
    text-align: left;
}

.bws-page--light .bws-empty {
    color: #334155;
}

.bws-page--light .bws-retry-btn {
    border-color: #1e3a5f;
    background: rgba(30, 58, 95, 0.08);
    color: #0f172a;
}

.bws-page--light .bws-retry-btn:hover,
.bws-page--light .bws-retry-btn:focus-visible {
    background: rgba(30, 58, 95, 0.14);
}

.bws-page--light .bws-ref {
    color: #0f172a;
    text-shadow: none;
}

.bws-page--light .bws-play-title {
    color: #b45309;
    text-shadow: none;
}

.bws-page--light .bws-verse-display {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(15, 23, 42, 0.12);
}

.bws-page--light .bws-grid-wrap {
    border: 1px solid rgba(15, 23, 42, 0.2);
    background: #f8fafc;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9) inset,
        0 2px 12px rgba(15, 23, 42, 0.08);
}

.bws-page--light .bws-cell {
    color: #0f172a;
    background: #f1f5f9;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.bws-page--light .bws-cell:hover,
.bws-page--light .bws-cell:focus-visible {
    background: #e2e8f0;
    border-color: rgba(30, 58, 95, 0.35);
    color: #020617;
}

.bws-page--light .bws-cell--preview {
    background: rgba(251, 191, 36, 0.22);
    border-color: rgba(217, 119, 6, 0.45);
    color: #0f172a;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35) inset;
}

.bws-page--light .bws-cell--found {
    color: #9f1239;
    text-shadow: none;
    font-weight: 800;
    background: #fff1f2;
    border: 1px solid rgba(190, 18, 60, 0.45);
}

.bws-page--light .bws-hint-btn {
    background: rgba(30, 58, 95, 0.12);
    color: rgba(30, 64, 175, 0.95);
}

.bws-page--light .bws-hint-btn:hover,
.bws-page--light .bws-hint-btn:focus-visible {
    background: rgba(30, 58, 95, 0.2);
    color: #1e3a5f;
}

.bws-page--light .bws-cell--hint-flash {
    animation: bws-hint-flash-light 0.72s ease-in-out;
}

@keyframes bws-hint-flash-light {
    0%,
    100% {
        box-shadow: inset 0 0 0 1px rgba(30, 58, 95, 0.2);
    }

    35%,
    65% {
        box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.55), 0 0 16px rgba(59, 130, 246, 0.28);
        background: rgba(191, 219, 254, 0.85);
        color: #0f172a;
    }
}

.bws-page--light .bws-letter-slot {
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.15);
}

.bws-page--light .bws-word-group--current {
    outline-color: rgba(30, 58, 95, 0.45);
}

.bws-page--light .bws-word-group--current .bws-letter-slot {
    box-shadow: 0 0 0 1px rgba(30, 58, 95, 0.2) inset;
}

.bws-page--light .bws-word-group--solved .bws-letter-slot {
    color: #9f1239;
    background: #fff1f2;
    border-color: rgba(190, 18, 60, 0.4);
    font-weight: 800;
}

.bws-page--light .bws-letter-slot--peek {
    color: #0f172a !important;
    text-shadow: none;
    background: #fef9c3 !important;
    border-color: rgba(30, 58, 95, 0.35);
}

.bws-page--light .bws-blanks--pulse-reveal {
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.38);
}

.bws-page--light .bws-verse-flash {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(30, 58, 95, 0.35);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.06),
        0 8px 28px rgba(30, 58, 95, 0.12);
}

.bws-page--light .bws-verse-flash__text {
    color: #0f172a;
}

.bws-page--light .bws-verse-flash__ref {
    color: #1e3a5f;
}

.bws-page--light .bws-blanks--error {
    animation: bws-blanks-error-flash-light 0.42s ease;
}

@keyframes bws-blanks-error-flash-light {
    0%,
    100% {
        box-shadow: none;
        background: transparent;
    }

    35%,
    65% {
        box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.65);
        background: rgba(254, 226, 226, 0.65);
    }
}

.bws-page--light .bws-word-group--glow .bws-letter-slot {
    animation: bws-letter-glow-light 0.55s ease;
}

@keyframes bws-letter-glow-light {
    0% {
        box-shadow: none;
    }

    40% {
        box-shadow:
            0 0 12px rgba(190, 18, 60, 0.45),
            0 0 0 1px rgba(190, 18, 60, 0.35) inset;
        background: rgba(255, 241, 242, 0.95);
        border-color: rgba(190, 18, 60, 0.55);
    }

    100% {
        box-shadow: none;
    }
}

.bws-page--light .bws-complete {
    color: #0f172a;
}

/* ——— Verse Builder (shares bws-page / header / verse nav / themes) ——— */
.vb-diff-toggles {
    position: relative;
}

.vb-diff-cursor-hint {
    position: fixed;
    z-index: 25000;
    pointer-events: none;
    max-width: min(22rem, calc(100vw - 1.5rem));
    padding: 0.42rem 0.55rem;
    border-radius: 10px;
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.42);
    transform: translate(14px, 16px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(15, 23, 42, 0.94);
    color: #f1f5f9;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.bws-main.vb-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vb-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
}

.vb-play {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    padding:
        0.35rem
        calc(8px + env(safe-area-inset-right, 0px))
        calc(0.5rem + env(safe-area-inset-bottom, 0px))
        calc(8px + env(safe-area-inset-left, 0px));
}

.vb-split {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    max-width: none;
    margin: 0;
    align-items: stretch;
    min-height: 0;
}

/* Side-by-side: wide enough, or landscape phones/tablets — panels fill left/right */
@media (min-width: 720px), (orientation: landscape) and (min-width: 560px) {
    .vb-split {
        flex-direction: row;
        align-items: stretch;
        gap: 0.65rem;
    }

    .vb-pane {
        flex: 1 1 50%;
        min-width: 0;
        min-height: 0;
    }
}

.vb-pane {
    border-radius: 14px;
    padding: 1rem 1.1rem 1.15rem;
    box-sizing: border-box;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.vb-pane--build .vb-slots {
    flex: 1 1 auto;
    align-content: flex-start;
}

.vb-pane-title {
    margin: 0 0 0.35rem 0;
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    font-size: clamp(0.82rem, 2vw, 0.98rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vb-ref {
    margin: 0 0 0.5rem 0;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 700;
}

.vb-hint,
.vb-bank-hint {
    margin: 0 0 0.65rem 0;
    font-size: clamp(0.76rem, 1.9vw, 0.88rem);
    line-height: 1.45;
    opacity: 0.92;
}

.vb-bank-hint--easy {
    margin: -0.25rem 0 0.55rem;
    font-size: clamp(0.72rem, 1.75vw, 0.84rem);
    line-height: 1.4;
    opacity: 0.94;
}

.vb-slots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.45rem;
    row-gap: 0.55rem;
    padding: 0.5rem 0;
    border-radius: 10px;
    transition: box-shadow 0.15s ease;
    cursor: pointer;
}

.vb-slots--pulse-reveal {
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.4);
}

.vb-slots--pulse-reveal .vb-slot {
    animation: bws-letter-slot-pulse 0.42s ease-in-out infinite;
}

/* Peek = temporarily “flipped” word in a slot — always black type on a light chip for contrast */
.vb-slot--peek {
    font-weight: 800;
    color: #000000 !important;
    text-shadow: none;
    background: #fffef5 !important;
    border: 1px solid rgba(0, 0, 0, 0.22) !important;
}

.vb-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.1em;
    min-height: 2.1em;
    padding: 0.2rem 0.35rem;
    border-radius: 8px;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-weight: 700;
    font-size: clamp(0.82rem, 2.2vw, 1rem);
    box-sizing: border-box;
}

/* Easy mode: inline min-width (ch) per word; keep height consistent */
.vb-slots--easy .vb-slot {
    max-width: 100%;
}

.vb-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    min-height: 3rem;
    transition: box-shadow 0.15s ease;
}

.vb-bank-btn {
    cursor: pointer;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-weight: 700;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    border: 2px solid rgba(251, 191, 36, 0.35);
    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease;
}

.vb-bank-btn:hover,
.vb-bank-btn:focus-visible {
    outline: none;
    transform: translateY(-1px);
}

/* Easy mode: five candidate words highlighted in the bank */
.vb-bank-btn--hint {
    box-shadow:
        0 0 0 2px rgba(245, 158, 11, 0.85),
        0 2px 14px rgba(245, 158, 11, 0.28);
    transform: translateY(-1px);
}

.vb-reset {
    margin-top: 0.25rem;
}

.vb-done {
    margin: 0.75rem 0 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.vb-empty {
    padding: max(16px, min(48px, 5vmin));
}

@keyframes vb-wrong-flash {
    0%,
    100% {
        box-shadow: none;
    }

    35%,
    65% {
        box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.85);
    }
}

.vb-slots--wrong,
.vb-bank--wrong {
    animation: vb-wrong-flash 0.42s ease;
}

/* Verse Builder — parchment panes (darker card, black type) */
.bws-page--parchment .vb-pane {
    background: #bfae96;
    border: 1px solid rgba(18, 12, 8, 0.32);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.28) inset,
        0 10px 28px rgba(12, 8, 4, 0.28);
}

.bws-page--parchment .vb-pane-title {
    color: #000000;
}

.bws-page--parchment .vb-ref {
    color: #000000;
}

.bws-page--parchment .vb-hint,
.bws-page--parchment .vb-bank-hint {
    color: #000000;
}

.bws-page--parchment .vb-slot--empty {
    color: rgba(0, 0, 0, 0.55);
    background: #e4d9c8;
    border: 1px dashed rgba(30, 20, 10, 0.42);
}

.bws-page--parchment .vb-slot--filled {
    color: #000000;
    background: #faf6ee;
    border: 1px solid rgba(0, 0, 0, 0.22);
}

.bws-page--parchment .vb-bank-btn {
    color: #000000;
    background: linear-gradient(180deg, #faf6ee, #ebe3d4);
    border-color: rgba(40, 26, 12, 0.45);
}

.bws-page--parchment .vb-bank-hint--easy {
    color: #000000;
}

.bws-page--parchment .vb-bank-btn--hint {
    box-shadow:
        0 0 0 2px rgba(180, 83, 9, 0.9),
        0 2px 14px rgba(180, 83, 9, 0.3);
    background: linear-gradient(180deg, #fffbeb, #fde68a);
}

.bws-page--parchment .vb-done {
    color: #000000;
}

.bws-page--parchment .vb-slot--peek {
    color: #000000 !important;
    text-shadow: none;
    background: #fffef8 !important;
    border: 1px solid rgba(0, 0, 0, 0.28) !important;
    box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.35);
}

.bws-page--parchment .vb-slots--pulse-reveal {
    box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.35);
}

/* Verse Builder — dark */
.bws-page--dark .vb-pane {
    background: rgba(6, 6, 12, 0.94);
    border: 1px solid rgba(251, 191, 36, 0.2);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.35) inset,
        0 8px 32px rgba(0, 0, 0, 0.55);
}

.bws-page--dark .vb-pane-title {
    color: #fde68a;
}

.bws-page--dark .vb-ref {
    color: #fcd34d;
}

.bws-page--dark .vb-hint,
.bws-page--dark .vb-bank-hint {
    color: rgba(226, 232, 240, 0.82);
}

.bws-page--dark .vb-slot--empty {
    color: rgba(253, 230, 168, 0.35);
    background: rgba(0, 0, 0, 0.35);
    border: 1px dashed rgba(251, 191, 36, 0.28);
}

.bws-page--dark .vb-slot--filled {
    color: #fef9c3;
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.bws-page--dark .vb-slot--peek {
    color: #000000 !important;
    text-shadow: none;
    background: #fffef5 !important;
    border: 1px solid rgba(0, 0, 0, 0.25) !important;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.45);
}

.bws-page--dark .vb-bank-btn {
    color: #0a0a0a;
    background: linear-gradient(180deg, #f4f1ec, #ddd8d0);
    border-color: rgba(251, 191, 36, 0.42);
}

.bws-page--dark .vb-bank-btn:hover,
.bws-page--dark .vb-bank-btn:focus-visible {
    background: linear-gradient(180deg, #fffefb, #e8e4df);
    border-color: rgba(253, 224, 71, 0.55);
}

.bws-page--dark .vb-bank-hint--easy {
    color: rgba(226, 232, 240, 0.92);
}

.bws-page--dark .vb-bank-btn--hint {
    box-shadow:
        0 0 0 2px rgba(251, 191, 36, 0.95),
        0 2px 16px rgba(251, 191, 36, 0.35);
    background: linear-gradient(180deg, #fffbeb, #fde68a);
    color: #0a0a0a;
    border-color: rgba(251, 191, 36, 0.55);
}

.bws-page--dark .vb-done {
    color: #86efac;
}

/* Verse Builder — light (darker panes, black type) */
.bws-page--light .vb-pane {
    background: #9aa6b8;
    border: 1px solid rgba(15, 23, 42, 0.28);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.bws-page--light .vb-pane-title {
    color: #000000;
}

.bws-page--light .vb-ref {
    color: #000000;
}

.bws-page--light .vb-hint,
.bws-page--light .vb-bank-hint {
    color: #000000;
    opacity: 0.95;
}

.bws-page--light .vb-slot--empty {
    color: rgba(0, 0, 0, 0.52);
    background: #d2dae6;
    border: 1px dashed rgba(15, 23, 42, 0.4);
}

.bws-page--light .vb-slot--filled {
    color: #000000;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.32);
}

.bws-page--light .vb-bank-btn {
    color: #000000;
    background: linear-gradient(180deg, #f8fafc, #e8edf5);
    border-color: rgba(15, 23, 42, 0.36);
}

.bws-page--light .vb-bank-hint--easy {
    color: #000000;
}

.bws-page--light .vb-bank-btn--hint {
    box-shadow:
        0 0 0 2px rgba(217, 119, 6, 0.9),
        0 2px 14px rgba(217, 119, 6, 0.28);
    background: linear-gradient(180deg, #fffbeb, #fde68a);
}

.bws-page--light .vb-done {
    color: #000000;
}

.bws-page--light .vb-slot--peek {
    color: #000000 !important;
    text-shadow: none;
    background: #fffef8 !important;
    border: 1px solid rgba(15, 23, 42, 0.3) !important;
    box-shadow: 0 0 0 1px rgba(30, 58, 95, 0.28);
}

.bws-page--light .vb-slots--pulse-reveal {
    box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.42);
}

/* Games flyout (home nav) */
.home-games-menu {
    position: relative;
    padding-bottom: 0.4rem;
}

.home-games-trigger {
    border: none;
    background: transparent;
    cursor: pointer;
}

.home-games-submenu {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 190px;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(11, 18, 32, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 30;
}

.home-games-menu:hover .home-games-submenu,
.home-games-menu:focus-within .home-games-submenu {
    display: block;
}

/* Bible Memory flyout (home nav) */
.home-memory-menu {
    position: relative;
    padding-bottom: 0.4rem;
}

.home-memory-trigger {
    border: none;
    background: transparent;
    cursor: pointer;
}

.home-memory-submenu {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 190px;
    padding: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(11, 18, 32, 0.96);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 30;
}

.home-memory-menu:hover .home-memory-submenu,
.home-memory-menu:focus-within .home-memory-submenu {
    display: block;
}

.nav-item-section-label .nav-section-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.35rem 0 0.1rem;
}

/* Trading nav — Bible Memory collapsible */
.nav-memory-dropdown {
    list-style: none;
    padding-bottom: 0.35rem;
}

.nav-memory-dropdown > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.5rem 0 0.35rem;
    user-select: none;
}

.nav-memory-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-memory-dropdown > summary::after {
    content: " ▾";
    font-size: 0.55rem;
    opacity: 0.85;
}

.nav-memory-dropdown[open] > summary::after {
    content: " ▴";
}

.nav-memory-panel {
    padding: 0.15rem 0 0.25rem 0.35rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    margin-left: 0.15rem;
}

.nav-memory-panel .nav-item {
    padding-bottom: 0.15rem;
}

.nav-memory-panel .nav-item:first-of-type {
    padding-top: 0;
}

/* Trading nav — Bible Games (unfinished) collapsible */
.nav-bible-games-unfinished-dropdown {
    list-style: none;
    padding-bottom: 0.35rem;
}

.nav-bible-games-unfinished-dropdown > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.5rem 0 0.35rem;
    user-select: none;
}

.nav-bible-games-unfinished-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-bible-games-unfinished-dropdown > summary::after {
    content: " ▾";
    font-size: 0.55rem;
    opacity: 0.85;
}

.nav-bible-games-unfinished-dropdown[open] > summary::after {
    content: " ▴";
}

.nav-bible-games-unfinished-panel {
    padding: 0.15rem 0 0.25rem 0.35rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    margin-left: 0.15rem;
}

.nav-bible-games-unfinished-panel .nav-item {
    padding-bottom: 0.15rem;
}

/* Trading nav — XRPL Tokenization collapsible */
.nav-xrpl-dropdown {
    list-style: none;
    padding-bottom: 0.35rem;
}

.nav-xrpl-dropdown > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.5rem 0 0.35rem;
    user-select: none;
}

.nav-xrpl-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-xrpl-dropdown > summary::after {
    content: " ▾";
    font-size: 0.55rem;
    opacity: 0.85;
}

.nav-xrpl-dropdown[open] > summary::after {
    content: " ▴";
}

.nav-xrpl-panel {
    padding: 0.15rem 0 0.25rem 0.35rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    margin-left: 0.15rem;
}

.nav-xrpl-panel .nav-item {
    padding-bottom: 0.15rem;
}

/* Trading nav — Admin (FileShare, etc.) */
.nav-admin-dropdown {
    list-style: none;
    padding-bottom: 0.35rem;
}

.nav-admin-dropdown > summary {
    list-style: none;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    padding: 0.5rem 0 0.35rem;
    user-select: none;
}

.nav-admin-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-admin-dropdown > summary::after {
    content: " ▾";
    font-size: 0.55rem;
    opacity: 0.85;
}

.nav-admin-dropdown[open] > summary::after {
    content: " ▴";
}

.nav-admin-panel {
    padding: 0.15rem 0 0.25rem 0.35rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    margin-left: 0.15rem;
}

.nav-admin-panel .nav-item {
    padding-bottom: 0.15rem;
}

/* Bible Tetris — scenic background by viewport aspect (landscape vs portrait art) */
.bible-tetris-page {
    position: fixed;
    inset: 0;
    z-index: 120;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    isolation: isolate;
    background-color: #050210;
    background-image: url("/images/games/bible-tetris-bg-landscape.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

@media (max-aspect-ratio: 1/1) {
    .bible-tetris-page {
        background-image: url("/images/games/bible-tetris-bg-portrait.png");
    }
}

.bible-tetris-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(3, 5, 16, 0.72) 0%,
        rgba(3, 5, 16, 0.38) 38%,
        rgba(3, 5, 16, 0.48) 100%
    );
}

.bible-tetris-page > .bible-cubes-header,
.bible-tetris-page > .bible-tetris-main {
    position: relative;
    z-index: 1;
}

.bible-tetris-page .bible-cubes-header {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    flex-shrink: 0;
}

.bible-tetris-header {
    padding-right: 0.65rem;
}

.bible-tetris-brand {
    flex-shrink: 0;
}

.bible-tetris-spacer {
    flex: 1 1 auto;
}

.bible-tetris-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

.bible-tetris-host {
    position: relative;
    flex: 0 0 min(52%, 28rem);
    max-width: min(52%, 28rem);
    min-height: 0;
    width: 100%;
    outline: none;
    touch-action: none;
}

.bible-tetris-verse-layer {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(8, 10, 22, 0.96), rgba(4, 6, 14, 0.99));
    border-left: 1px solid rgba(253, 230, 138, 0.12);
}

.bible-tetris-falling-verse {
    position: absolute;
    max-width: min(92%, 28rem);
    padding: 0.35rem 0.55rem 0.45rem;
    margin: 0;
    text-align: left;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(0.68rem, 1.1vw, 0.82rem);
    line-height: 1.35;
    color: #e8ecf8;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.45rem;
    box-shadow: 0 0.25rem 0.85rem rgba(0, 0, 0, 0.35);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.bible-tetris-falling-verse[data-faith-related="1"] {
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 0.5rem rgba(251, 191, 36, 0.12);
}

.bible-tetris-falling-verse__line {
    display: block;
    color: rgba(226, 232, 240, 0.95);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.bible-tetris-falling-verse__ref-inline {
    font-weight: 700;
    color: #fde68a;
}

@media (max-width: 720px) {
    .bible-tetris-main {
        flex-direction: column;
    }

    .bible-tetris-host {
        flex: 0 0 52vh;
        max-width: 100%;
        width: 100%;
    }

    .bible-tetris-verse-layer {
        flex: 1 1 auto;
        border-left: none;
        border-top: 1px solid rgba(253, 230, 138, 0.12);
        min-height: 8rem;
    }
}

.bible-tetris-host--intro .bible-tetris-canvas {
    visibility: hidden;
}

/* Bible Tetris intro instructions: white type on parchment + scenic wash (overrides global parchment black ink). */
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text h1,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text h2,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text h3,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text h4,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text p,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text li,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text ul,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text ol,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text span,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text em,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text div,
.bible-tetris-host .blasteroids-intro-overlay .bible-cubes-parchment-text strong {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}

.bible-tetris-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Leaderboard top-right so it does not cover canvas score (top-left) */
.bible-tetris-host .bible-tetris-hud-shell.blasteroids-hud-shell {
    left: auto;
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    align-items: flex-end;
    top: max(0.45rem, env(safe-area-inset-top, 0px));
}

.bible-tetris-hud-shell .game-highscore-panel {
    max-height: min(38vh, 14rem);
    overflow: auto;
    font-size: 0.78rem;
}

.bible-tetris-gameover {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    background: rgba(3, 3, 8, 0.78);
}

.bible-tetris-gameover-card {
    max-width: 22rem;
    width: 100%;
    padding: 1.2rem 1.35rem 1.35rem;
    border-radius: 0.65rem;
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.99));
    border: 1px solid rgba(253, 230, 138, 0.28);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.5);
    text-align: center;
}

.bible-tetris-gameover-title {
    margin: 0 0 0.55rem;
    font-size: clamp(1.05rem, 2.8vw, 1.35rem);
    font-weight: 700;
    color: #fef9c3;
}

.bible-tetris-gameover-score {
    margin: 0 0 1.1rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: rgba(254, 243, 199, 0.92);
}

.bible-tetris-gameover-score strong {
    color: #fde68a;
    font-size: 1.1em;
}

.bible-tetris-gameover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
}

.bible-tetris-gameover-btn {
    cursor: pointer;
    font-family: system-ui, "Segoe UI", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.45rem 1rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(226, 232, 240, 0.35);
    min-width: 7.5rem;
}

.bible-tetris-gameover-btn--primary {
    background: linear-gradient(180deg, #fde68a, #d97706);
    color: #1c1917;
    border-color: rgba(251, 191, 36, 0.5);
}

.bible-tetris-gameover-btn--primary:hover,
.bible-tetris-gameover-btn--primary:focus-visible {
    filter: brightness(1.06);
}

.bible-tetris-gameover-btn--ghost {
    background: rgba(15, 23, 42, 0.85);
    color: #e2e8f0;
}

.bible-tetris-gameover-btn--ghost:hover,
.bible-tetris-gameover-btn--ghost:focus-visible {
    background: rgba(30, 41, 59, 0.95);
}

/* Blaster game (Three.js — wwwroot/js/bibleBlaster.mjs) */
.blaster-page {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: #000;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.blaster-header .blasteroids-brand {
    text-transform: none;
    letter-spacing: 0.02em;
}

.blaster-header .blasteroids-tagline {
    flex: 1 1 100%;
    max-width: 100%;
    margin: 0.2rem 0 0 0;
    text-align: left;
    text-transform: none;
    letter-spacing: 0.03em;
}

.blaster-host {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    touch-action: none;
}

.blaster-host--intro .blaster-hud,
.blaster-host--intro canvas {
    visibility: hidden;
}

.blaster-host .blaster-hud {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 12;
    font-family: system-ui, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    color: #e2e8f0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    max-width: min(20rem, 52vw);
}

.blaster-hud-row {
    margin-bottom: 0.2rem;
}

.blaster-hud-label {
    opacity: 0.78;
    margin-right: 0.35rem;
}

.blaster-hud-hint {
    margin-top: 0.45rem;
    font-size: 0.68rem;
    line-height: 1.35;
    opacity: 0.82;
}

.blaster-hud-verse {
    margin-top: 0.35rem;
    font-size: 0.66rem;
    font-style: italic;
    opacity: 0.75;
}

.blaster-hud-go {
    margin-top: 0.45rem;
    font-weight: 700;
    color: #fca5a5;
}

.blaster-hud-shell {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
    pointer-events: none;
    max-width: min(20rem, 52vw);
}

.blaster-hud-shell .blaster-hud {
    position: relative;
    left: auto;
    top: auto;
}

.blaster-hud-shell .game-highscore-panel {
    pointer-events: auto;
}

/* After play begins: long hint, verse, and leaderboard tuck away so the view stays clear. */
.blaster-hud-shell--chrome-hidden .blaster-hud-hint,
.blaster-hud-shell--chrome-hidden .blaster-hud-verse,
.blaster-hud-shell--chrome-hidden .game-highscore-panel {
    display: none !important;
}

.game-highscore-panel {
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    background: rgba(6, 10, 28, 0.78);
    border: 1px solid rgba(255, 230, 180, 0.12);
    font-family: system-ui, "Segoe UI", sans-serif;
    font-size: 0.65rem;
    color: #e2e8f0;
    max-height: 11rem;
    overflow: auto;
    min-width: 9rem;
}

.game-highscore-title {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.58rem;
    color: #fde68a;
    margin-bottom: 0.25rem;
}

.game-highscore-empty {
    margin: 0;
    opacity: 0.75;
}

.game-highscore-row {
    display: grid;
    grid-template-columns: 1.1rem 1fr auto;
    gap: 0.25rem;
    align-items: baseline;
    padding: 0.12rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.game-highscore-row:last-child {
    border-bottom: none;
}

.game-highscore-rank {
    opacity: 0.65;
}

.game-highscore-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-highscore-val {
    font-weight: 800;
    color: #fde68a;
    font-variant-numeric: tabular-nums;
}

.blaster-fire-btn {
    position: absolute;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 14;
    padding: 0.55rem 1.15rem;
    border-radius: 12px;
    border: 2px solid rgba(251, 191, 36, 0.55);
    background: linear-gradient(180deg, rgba(40, 28, 8, 0.92), rgba(20, 14, 6, 0.96));
    color: #fde68a;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
    touch-action: manipulation;
    user-select: none;
}

.blaster-fire-btn:hover,
.blaster-fire-btn:focus-visible {
    outline: none;
    border-color: #fcd34d;
    color: #fffbeb;
}

@media (min-width: 900px) {
    .blaster-fire-btn {
        opacity: 0.88;
    }
}

@media (pointer: fine) and (min-width: 900px) {
    .blaster-fire-btn {
        opacity: 0.35;
        pointer-events: none;
    }
}

/* Bible Maze (canvas FP + minimap — wwwroot/js/bibleMaze.mjs) */
.bible-maze-page {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: radial-gradient(120% 100% at 50% 100%, #1a1028 0%, #0a0614 50%, #020308 100%);
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.bible-maze-header .blasteroids-tagline {
    max-width: min(24rem, 46vw);
}

.bible-maze-host {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    touch-action: none;
    outline: none;
}

/* Instructions overlay: Parchment.png stretched edge-to-edge (same asset + wash as Proverbs Wheel panel). */
.bible-maze-intro.blasteroids-intro-overlay::before {
    background-image:
        linear-gradient(165deg, rgba(255, 252, 245, 0.36) 0%, rgba(245, 236, 220, 0.44) 100%),
        url("/images/Parchment/Parchment.png");
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
}

.bible-maze-row {
    position: relative;
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.bible-maze-fp-wrap {
    position: relative;
    flex: 1 1 80%;
    min-width: 0;
    min-height: 0;
    display: flex;
}

.bible-maze-fp {
    display: block;
    width: 100%;
    height: 100%;
    flex: 1;
    touch-action: none;
    image-rendering: auto;
}

.bible-maze-fp-hud {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 6;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    background: rgba(8, 6, 22, 0.78);
    border: 1px solid rgba(255, 230, 180, 0.14);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.5);
    font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
    font-size: 0.82rem;
    color: #e2e8f0;
    pointer-events: none;
    max-width: min(17rem, 72vw);
}

.bible-maze-fp-hud .bible-maze-again {
    pointer-events: auto;
    margin-top: 0.55rem;
    cursor: pointer;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a0f06;
    padding: 0.4rem 1.1rem;
    border: 2px solid rgba(74, 44, 18, 0.45);
    border-radius: 8px;
    background: linear-gradient(180deg, #fde68a 0%, #f59e0b 50%, #d97706 100%);
}

.bible-maze-fp-hud .bible-maze-again:hover,
.bible-maze-fp-hud .bible-maze-again:focus-visible {
    outline: none;
    filter: brightness(1.06);
}

.bible-maze-sidebar {
    flex: 0 0 20%;
    width: 20%;
    max-width: 20%;
    min-width: 112px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.35rem 0.4rem 0.5rem;
    box-sizing: border-box;
    gap: 0.35rem;
    background: linear-gradient(180deg, rgba(12, 8, 24, 0.95) 0%, rgba(4, 3, 12, 0.98) 100%);
    border-left: 1px solid rgba(251, 191, 36, 0.12);
}

.bible-maze-minimap {
    display: block;
    width: 100%;
    flex: 1 1 auto;
    min-height: 120px;
    touch-action: none;
    border-radius: 8px;
    border: 1px solid rgba(255, 214, 128, 0.1);
}

.bible-maze-mapbtn {
    flex-shrink: 0;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.45rem 0.35rem;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(30, 22, 48, 0.9);
    color: #fde68a;
    touch-action: manipulation;
}

.bible-maze-mapbtn:hover,
.bible-maze-mapbtn:focus-visible {
    outline: none;
    border-color: #fcd34d;
    color: #fffbeb;
}

.bible-maze-host--intro .bible-maze-fp-hud {
    visibility: hidden;
}

/* —— Bible game suite (hub + canvas/DOM games) —— */
.bible-suite-page {
    position: fixed;
    inset: 0;
    z-index: 110;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: #0a0612;
    color: #f1e8dc;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.bible-suite-game-root {
    flex: 1 1 auto;
    position: relative;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.bible-suite-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.45rem 0.65rem;
    border-bottom: 1px solid rgba(251, 191, 36, 0.22);
    background: linear-gradient(180deg, rgba(18, 12, 32, 0.96), rgba(10, 6, 18, 0.88));
    backdrop-filter: blur(6px);
}

.bible-suite-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fde68a;
    text-decoration: none;
    font-weight: 800;
    background: rgba(30, 22, 48, 0.85);
}

.bible-suite-home:hover,
.bible-suite-home:focus-visible {
    outline: none;
    border-color: #fcd34d;
    color: #fffbeb;
}

.bible-suite-brand {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    letter-spacing: 0.04em;
    color: #fde68a;
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.25);
}

.bible-suite-tagline {
    margin: 0;
    flex: 1 1 12rem;
    font-size: 0.72rem;
    opacity: 0.82;
    line-height: 1.35;
}

.bible-suite-host {
    position: relative;
    min-height: calc(100vh - 52px);
    box-sizing: border-box;
}

.bible-suite-bg-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

.bible-suite-layer {
    position: relative;
    z-index: 1;
    padding: 0.5rem 0.65rem 1.25rem;
    min-height: calc(100vh - 52px);
    box-sizing: border-box;
}

/* Fruits Match-3 (Galatians 5) — scenic fills viewport; parchment panels + black type */
.bible-suite-page.fmg-page,
.bible-suite-page:has(.fmg-layer) {
    background: #0a0612;
    color: #000000;
}

.bible-suite-page.fmg-page .bible-suite-game-root,
.bible-suite-page:has(.fmg-layer) .bible-suite-game-root {
    color: #000000;
}

.bible-suite-page.fmg-page .bible-suite-header,
.bible-suite-page:has(.fmg-layer) .bible-suite-header {
    flex-shrink: 0;
    border-bottom-color: rgba(62, 44, 28, 0.28);
    background: linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(245, 238, 226, 0.96));
    color: #000000;
}

.bible-suite-page.fmg-page .bible-suite-brand,
.bible-suite-page:has(.fmg-layer) .bible-suite-brand {
    color: #000000;
    text-shadow: none;
}

.bible-suite-page.fmg-page .bible-suite-tagline,
.bible-suite-page:has(.fmg-layer) .bible-suite-tagline {
    color: #000000;
    opacity: 0.92;
}

.bible-suite-page.fmg-page .bible-suite-home,
.bible-suite-page:has(.fmg-layer) .bible-suite-home {
    color: #000000;
    border-color: rgba(62, 44, 28, 0.35);
    background: rgba(255, 252, 245, 0.88);
}

.bible-suite-page.fmg-page .bible-suite-home:hover,
.bible-suite-page.fmg-page .bible-suite-home:focus-visible,
.bible-suite-page:has(.fmg-layer) .bible-suite-home:hover,
.bible-suite-page:has(.fmg-layer) .bible-suite-home:focus-visible {
    color: #000000;
    border-color: rgba(62, 44, 28, 0.5);
    background: rgba(255, 250, 240, 0.98);
}

/* Game root is the same node as .bible-suite-host on Fruits page — stretch so bg canvas fills viewport */
.bible-suite-page.fmg-page .bible-suite-game-root.bible-suite-host:has(.fmg-layer),
.bible-suite-page.fmg-page .bible-suite-game-root:has(.fmg-layer),
.bible-suite-game-root.bible-suite-host:has(.fmg-layer),
.bible-suite-game-root:has(.fmg-layer) {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bible-suite-page.fmg-page .bible-suite-layer.fmg-layer,
.bible-suite-layer.fmg-layer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    flex: 1 1 auto;
    max-width: none;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding: 0.45rem 0.65rem 0.65rem;
    color: #000000;
}

.fmg-instructions {
    margin: 0 0 0.55rem 0;
    padding: 0.5rem 0.65rem;
    font-size: clamp(0.8rem, 2.2vw, 0.92rem);
    line-height: 1.45;
    color: #000000;
    flex-shrink: 0;
    position: relative;
    isolation: isolate;
    background-color: #e8dcc8;
    background-image: none;
    border: 1px solid rgba(62, 44, 28, 0.35);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.fmg-instructions::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        linear-gradient(180deg, rgba(255, 252, 245, 0.42), rgba(245, 236, 220, 0.48)),
        var(--bible-parchment-image);
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
}

.fmg-instructions > * {
    position: relative;
    z-index: 1;
}

.fmg-instructions strong {
    color: #000000;
}

.fmg-canvas-wrap {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.fmg-canvas {
    display: block;
    touch-action: manipulation;
    cursor: pointer;
    border-radius: 12px;
    border: 2px solid rgba(251, 191, 36, 0.4);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.fmg-hud {
    flex-shrink: 0;
    margin-top: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 10px;
    color: #000000;
    position: relative;
    isolation: isolate;
    background-color: #e8dcc8;
    background-image: none;
    border: 1px solid rgba(62, 44, 28, 0.35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.fmg-hud::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        linear-gradient(180deg, rgba(255, 252, 245, 0.42), rgba(245, 236, 220, 0.48)),
        var(--bible-parchment-image);
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
}

.fmg-hud > * {
    position: relative;
    z-index: 1;
}

.fmg-hud-score {
    font-size: 0.88rem;
    font-weight: 700;
    color: #000000;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.25rem;
}

.fmg-hud-msg {
    font-size: clamp(0.72rem, 2vw, 0.82rem);
    line-height: 1.4;
    color: #000000;
    opacity: 0.95;
}

/* Bible Jigsaw — sidebar + playfield (pile left, grid right); cube slide 1 + key verse */
.bible-suite-page.bj-page .bible-suite-game-root.bj-game-root,
.bible-suite-game-root.bj-game-root {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bible-suite-host.bj-host {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bible-suite-layer.bj-layer {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bj-split {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0.35rem 0.5rem 0.5rem;
}

.bj-sidebar {
    flex: 0 0 min(280px, 34vw);
    max-width: min(300px, 38vw);
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.bj-main {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 6, 18, 0.35);
    border-radius: 12px;
    border: 1px solid rgba(251, 191, 36, 0.18);
    padding: 6px;
    box-sizing: border-box;
}

.bj-controls {
    flex-shrink: 0;
}

.bj-label {
    display: block;
    font-size: 0.72rem;
    margin-bottom: 0.3rem;
    opacity: 0.9;
}

.bj-select {
    width: 100%;
    margin-bottom: 0.65rem;
}

.bj-slider-block {
    margin-bottom: 0.55rem;
}

.bj-slider-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    opacity: 0.85;
    margin-bottom: 0.2rem;
}

.bj-range {
    width: 100%;
    accent-color: #fbbf24;
}

.bj-grid-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.35rem;
    color: #fde68a;
}

.bj-help {
    font-size: 0.72rem;
    line-height: 1.45;
    opacity: 0.88;
    margin: 0 0 0.5rem 0;
}

.bj-shuffle {
    width: 100%;
    margin-bottom: 0.5rem;
}

.bj-verse-block {
    margin: 0.5rem 0 0 0;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    background: rgba(12, 10, 24, 0.55);
}

.bj-verse-ref {
    font-size: 0.78rem;
    font-weight: 700;
    font-style: normal;
    color: #fde68a;
    margin: 0 0 0.35rem 0;
}

.bj-verse-text {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.45;
    color: rgba(255, 248, 235, 0.92);
    font-style: italic;
}

.bj-board-canvas {
    display: block;
    cursor: grab;
    touch-action: none;
    border-radius: 12px;
    border: 2px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.35);
    max-width: 100%;
    max-height: 100%;
}

.bj-well-done-overlay {
    position: absolute;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    background: rgba(4, 2, 12, 0.72);
    backdrop-filter: blur(4px);
}

.bj-well-done-overlay[hidden] {
    display: none;
}

.bj-well-done-panel {
    width: min(22rem, 100%);
    padding: 1.15rem 1.25rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: linear-gradient(165deg, rgba(28, 22, 48, 0.98) 0%, rgba(12, 10, 24, 0.99) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.bj-well-done-title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.25rem, 3.5vw, 1.5rem);
    font-weight: 700;
    color: #fde68a;
    letter-spacing: 0.02em;
}

.bj-well-done-sub {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(253, 230, 138, 0.65);
}

.bj-well-done-msg {
    margin: 0 0 1.1rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(255, 248, 235, 0.9);
}

.bj-well-done-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
}

.bj-well-done-actions .bible-suite-btn {
    min-width: 6.5rem;
}

@media (max-width: 720px) {
    .bj-split {
        flex-direction: column;
    }

    .bj-sidebar {
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
    }

    .bj-main {
        flex: 1 1 auto;
        min-height: 240px;
    }
}

/* David vs Goliath — full-viewport playfield (no padded card / inner frame) */
.bible-suite-page:has(.dvg-david-host) {
    background: linear-gradient(180deg, #7eb8e8 0%, #4a5a8a 38%, #354a2a 72%, #141c12 100%);
}

.bible-suite-game-root.dvg-david-host {
    display: flex;
    flex-direction: column;
    flex: 1 1 0%;
    align-self: stretch;
    min-height: 0;
    overflow: hidden;
    background: transparent;
}

.dvg-david-host.bible-suite-host {
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.bible-suite-layer.dvg-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 0;
    margin: 0;
    min-height: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dvg-victory-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    background: rgba(4, 8, 18, 0.55);
    backdrop-filter: blur(3px);
    pointer-events: auto;
}

.dvg-victory-overlay[hidden] {
    display: none;
}

.dvg-victory-panel {
    max-width: min(20rem, 92vw);
    padding: 1.2rem 1.35rem 1.3rem;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.5);
    background: linear-gradient(165deg, rgba(30, 58, 90, 0.96) 0%, rgba(12, 28, 42, 0.98) 100%);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.dvg-victory-title {
    margin: 0 0 0.45rem;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    font-weight: 800;
    color: #fef9c3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.dvg-victory-msg {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(226, 242, 255, 0.92);
}

.dvg-victory-panel .dvg-victory-play {
    min-width: 8.5rem;
}

.dvg-defeat-overlay .dvg-defeat-panel {
    border-color: rgba(248, 113, 113, 0.42);
    background: linear-gradient(165deg, rgba(72, 22, 28, 0.96) 0%, rgba(18, 8, 12, 0.98) 100%);
}

.dvg-defeat-overlay .dvg-victory-title {
    color: #fecaca;
}

.dvg-defeat-overlay .dvg-victory-msg {
    color: rgba(254, 226, 226, 0.9);
}

/* Paul's Shipwreck — full-viewport storm deck */
.bible-suite-page:has(.psd-host),
.bible-suite-page.psd-page {
    background: linear-gradient(180deg, #152a3d 0%, #0a1520 50%, #050a10 100%);
}

.bible-suite-page.psd-page .bible-suite-game-root.psd-host {
    flex: 1 1 auto;
    min-height: calc(100dvh - 4.75rem);
}

.bible-suite-game-root.psd-host {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
}

.bible-suite-layer.psd-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 0;
    margin: 0;
    min-height: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.psd-hud .psd-hud-inner {
    pointer-events: auto;
}

.psd-hud .psd-hud-score {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fef9c3;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.psd-hud .psd-hud-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
    align-items: center;
}

.psd-hud .psd-hud-save,
.psd-hud .psd-hud-newgame {
    pointer-events: auto;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.55rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(15, 23, 42, 0.88);
    color: #fde68a;
}

.psd-hud .psd-hud-newgame {
    border-color: rgba(56, 189, 248, 0.5);
    color: #bae6fd;
    background: rgba(12, 38, 58, 0.9);
}

.psd-hud .psd-hud-save:hover,
.psd-hud .psd-hud-save:focus-visible,
.psd-hud .psd-hud-newgame:hover,
.psd-hud .psd-hud-newgame:focus-visible {
    background: rgba(30, 41, 59, 0.95);
    filter: brightness(1.05);
}

.psd-hud .game-highscore-panel {
    max-height: min(32vh, 11rem);
    overflow: auto;
    font-size: 0.74rem;
}

/* Bible Pairs — dark suite (no parchment sheet); header matches bible-suite bar */
.bible-suite-page.bp-parchment {
    position: relative;
    isolation: isolate;
    z-index: 0;
    background-color: #06040a;
    background-image: none;
    color: #e8ecf4;
    overflow: hidden;
}

.bible-suite-page.bp-parchment::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: none;
    transform: none;
    background:
        radial-gradient(ellipse 100% 70% at 50% 0%, rgba(72, 58, 110, 0.45) 0%, transparent 55%),
        linear-gradient(180deg, #0e0a16 0%, #08060e 50%, #030205 100%);
}

.bible-suite-page.bp-parchment > * {
    position: relative;
    z-index: 1;
}

.bible-suite-page.bp-parchment .bible-suite-header.bp-parchment-header {
    border-bottom-color: rgba(251, 191, 36, 0.22);
    background: linear-gradient(180deg, rgba(18, 12, 32, 0.97), rgba(10, 6, 18, 0.92));
    color: #f1e8dc;
}

.bible-suite-page.bp-parchment .bible-suite-brand {
    color: #fde68a;
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.25);
}

.bible-suite-page.bp-parchment .bible-suite-tagline {
    color: #cbd5e1;
    opacity: 0.92;
}

.bible-suite-page.bp-parchment .bible-suite-home {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.35);
    background: rgba(30, 22, 48, 0.85);
}

.bible-suite-page.bp-parchment .bible-suite-home:hover,
.bible-suite-page.bp-parchment .bible-suite-home:focus-visible {
    color: #fffbeb;
    border-color: #fcd34d;
    background: rgba(40, 30, 62, 0.95);
}

.bible-suite-page.bp-parchment .bible-suite-game-root {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
}

.bible-suite-page.bp-parchment .bible-suite-host {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    min-height: 0;
}

.bible-suite-layer.bp-layer {
    flex: 1 1 auto;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0.45rem 0.6rem 0.5rem;
    box-sizing: border-box;
    max-width: none;
    margin: 0 auto;
    width: 100%;
    background: transparent;
    color: #e2e8f0;
}

.bp-hud {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    padding: 0.45rem 0.55rem;
    border-radius: 12px;
    position: relative;
    isolation: isolate;
    background-color: #12101c;
    background-image: none;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.bp-hud::before {
    content: none;
}

.bp-hud > * {
    position: relative;
    z-index: 1;
}

.bp-hud-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
}

.bp-hud-row--hint {
    align-items: flex-start;
}

.bp-hud-row--pairs {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.bp-pairs-label {
    font-size: clamp(0.74rem, 1.9vw, 0.84rem);
    color: #cbd5e1;
    font-weight: 600;
}

.bp-pairs-slider {
    width: 100%;
    max-width: 100%;
    accent-color: #fcd34d;
    cursor: pointer;
}

.bp-hud-theme {
    font-weight: 800;
    color: #f8fafc;
    font-size: clamp(0.82rem, 2.2vw, 0.95rem);
}

.bp-hud-stats {
    font-size: clamp(0.74rem, 2vw, 0.84rem);
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
}

.bp-hud-hint {
    margin: 0;
    flex: 1 1 12rem;
    font-size: clamp(0.72rem, 1.9vw, 0.82rem);
    line-height: 1.4;
    color: #94a3b8;
}

.bp-hud-flash {
    font-size: 0.78rem;
    color: #fef9c3;
    font-weight: 600;
    margin: 0.25rem 0 0;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    background: rgba(120, 53, 15, 0.42);
    border: 1px solid rgba(251, 191, 36, 0.35);
}

.bp-board-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: 0.15rem 0;
}

.bp-grid {
    display: grid;
    grid-template-columns: repeat(var(--bp-cols, 4), minmax(0, 1fr));
    grid-template-rows: repeat(var(--bp-rows, 4), minmax(0, 1fr));
    gap: clamp(0.12rem, 0.75vmin, 0.38rem);
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    margin: 0;
    box-sizing: border-box;
}

.bp-card {
    min-height: 0;
    max-height: none;
    border-radius: 10px;
    border: 2px solid rgba(62, 44, 28, 0.35);
    font-weight: 600;
    font-size: clamp(0.8rem, 1.9vmin + 0.44vw, 1.56rem);
    line-height: 1.25;
    cursor: pointer;
    padding: 0.28rem 0.32rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    font-family: Georgia, "Times New Roman", serif;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.bp-card:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(40, 28, 18, 0.12);
}

.bp-card--back {
    background: linear-gradient(180deg, #5c4a3a, #3d3028);
    color: #fde68a;
}

.bp-card--verse {
    background: linear-gradient(180deg, #fffdf8, #f0e4d4);
    color: #000000;
}

.bp-card--ref {
    background: linear-gradient(180deg, #ede4f7, #d8cce8);
    color: #000000;
    font-family: system-ui, "Segoe UI", sans-serif;
    font-weight: 700;
}

.bp-card--matched {
    background: linear-gradient(180deg, #bbf7d0, #86efac);
    color: #14532d;
    border-color: rgba(21, 83, 45, 0.45);
}

.bp-card-q {
    font-size: clamp(2.2rem, 7vw, 3rem);
    line-height: 1;
    flex: 0 0 auto;
    align-self: center;
}

.bp-card-text {
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
    min-height: 0;
    max-height: 100%;
    /* Fill remaining card height so scrollHeight vs clientHeight reflects overflow. */
    flex: 1 1 auto;
    align-self: stretch;
    max-width: 100%;
    text-align: center;
}

.bp-card--ref .bp-card-text {
    -webkit-line-clamp: 6;
}

.bp-card-mark {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.2rem;
    flex: 0 0 auto;
    align-self: center;
}

/* app.css sets `span { color: #fff !important }` for Mud/dark UI — override on Pairs card faces */
.bp-card--verse .bp-card-text,
.bp-card--ref .bp-card-text,
.bp-card--matched .bp-card-text,
.bp-card--matched .bp-card-mark {
    color: #000000 !important;
}

.bp-btn {
    cursor: pointer;
    border-radius: 10px;
    padding: 0.4rem 0.85rem;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 2px solid rgba(62, 44, 28, 0.35);
}

.bp-btn--ink {
    color: #fffef8;
    background: linear-gradient(180deg, #5c3d1e, #3d2914);
    box-shadow: 0 2px 8px rgba(40, 28, 18, 0.2);
}

.bp-btn--ghost {
    color: #e2e8f0;
    background: rgba(30, 27, 42, 0.82);
    border-color: rgba(148, 163, 184, 0.35);
}

.bp-btn--small {
    font-size: 0.65rem;
    padding: 0.32rem 0.55rem;
}

.bp-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 120;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.72);
    box-sizing: border-box;
}

.bp-modal.bp-modal--open {
    display: flex;
}

.bp-modal-panel {
    max-width: 26rem;
    width: 100%;
    position: relative;
    isolation: isolate;
    background-color: #16131f;
    background-image: none;
    color: #e8ecf4;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    padding: 1rem 1.1rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    font-family: Georgia, "Times New Roman", serif;
}

.bp-modal-panel::before {
    content: none;
}

.bp-modal-panel > * {
    position: relative;
    z-index: 1;
}

.bp-modal-title {
    margin: 0 0 0.5rem 0;
    color: #f8fafc;
    font-size: 1.15rem;
}

.bp-modal-fact {
    margin: 0 0 0.65rem 0;
    line-height: 1.45;
    font-size: 0.88rem;
    color: #cbd5e1;
}

.bp-modal-verse {
    margin: 0 0 0.75rem 0;
    font-style: italic;
    font-size: 0.82rem;
    color: #94a3b8;
}

.bp-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* Armor of God TD — layout + shop */
.aotd-layer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    min-height: calc(100vh - 3.5rem);
    max-width: 56rem;
    margin: 0 auto;
    width: 100%;
}

.aotd-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1.2rem;
    font-size: 0.8rem;
    color: rgba(254, 243, 199, 0.9);
}

.aotd-stats strong {
    color: #fde68a;
    font-variant-numeric: tabular-nums;
}

.aotd-howto {
    margin: 0 0 0.35rem 0;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.22);
    background: rgba(22, 16, 38, 0.65);
    color: rgba(254, 243, 199, 0.88);
    font-size: 0.74rem;
    line-height: 1.48;
}

.aotd-howto-title {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    color: #fde68a;
    letter-spacing: 0.04em;
}

.aotd-howto-list {
    margin: 0;
    padding-left: 1.15rem;
}

.aotd-howto-list li {
    margin: 0.28em 0;
}

.aotd-howto-list li:first-child {
    margin-top: 0;
}

.aotd-howto-list li:last-child {
    margin-bottom: 0;
}

.aotd-armor-glance {
    margin: 0.35rem 0 0.15rem 0;
    padding: 0.4rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 12, 28, 0.5);
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.7rem;
    line-height: 1.45;
}

.aotd-armor-glance-summary {
    cursor: pointer;
    font-weight: 700;
    color: rgba(253, 230, 138, 0.95);
    padding: 0.15rem 0;
}

.aotd-armor-glance-list {
    margin: 0.4rem 0 0.15rem 0;
    padding-left: 0;
    list-style: none;
}

.aotd-armor-glance-list li {
    margin: 0.35em 0;
    padding-left: 0.55rem;
    border-left: 3px solid rgba(148, 163, 184, 0.5);
}

.aotd-hint {
    margin: 0.35rem 0 0.55rem 0;
    font-size: 0.76rem;
    line-height: 1.45;
    color: rgba(252, 211, 77, 0.88);
}

.aotd-shop {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.aotd-tower {
    display: grid;
    grid-template-columns: 1.35rem 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 0.06rem 0.45rem;
    align-items: start;
    text-align: left;
    padding: 0.42rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.28);
    border-left: 3px solid var(--aotd-c, #64748b);
    background: linear-gradient(145deg, rgba(40, 28, 62, 0.92), rgba(18, 12, 32, 0.96));
    color: #f5e9d6;
    cursor: pointer;
    font: inherit;
    font-size: 0.68rem;
    line-height: 1.25;
    box-sizing: border-box;
}

.aotd-tower:hover:not(:disabled),
.aotd-tower:focus-visible {
    outline: none;
    border-color: rgba(251, 191, 36, 0.5);
    filter: brightness(1.06);
}

.aotd-tower--sel {
    border-color: rgba(251, 191, 36, 0.65);
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.2);
}

.aotd-tower--broke:not(.aotd-tower--sel) {
    opacity: 0.52;
    cursor: not-allowed;
}

.aotd-tower-k {
    grid-column: 1;
    grid-row: 1 / span 4;
    align-self: center;
    justify-self: center;
    font-weight: 800;
    font-size: 1rem;
    color: var(--aotd-c, #94a3b8);
}

.aotd-tower-abbr {
    grid-column: 2;
    grid-row: 1;
    font-weight: 700;
    color: rgba(253, 230, 138, 0.95);
    font-size: 0.66rem;
}

.aotd-tower-name {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.62rem;
    color: rgba(245, 233, 216, 0.78);
}

.aotd-tower-meta {
    grid-column: 2;
    grid-row: 3;
    font-size: 0.58rem;
    color: rgba(203, 213, 225, 0.72);
}

.aotd-tower-cost {
    grid-column: 2;
    grid-row: 4;
    font-weight: 700;
    color: #fde68a;
    font-variant-numeric: tabular-nums;
    font-size: 0.65rem;
}

.aotd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.aotd-canvas-wrap {
    flex: 1 1 auto;
    min-height: min(52vh, 520px);
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(251, 191, 36, 0.22);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    background: rgba(8, 5, 18, 0.35);
}

.aotd-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.bible-suite-btn {
    cursor: pointer;
    border-radius: 10px;
    padding: 0.45rem 0.95rem;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1a0f06;
    border: 2px solid rgba(120, 80, 20, 0.5);
    background: linear-gradient(180deg, #fde68a, #d97706);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.bible-suite-btn:hover,
.bible-suite-btn:focus-visible {
    outline: none;
    filter: brightness(1.05);
}

.bible-suite-btn--ghost {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(30, 22, 48, 0.75);
}

/* Order timeline games (Creation + Ten Commandments) */
.otg-shell {
    max-width: 28rem;
    margin: 0 auto;
}

/* Order timeline games (Ten Commandments + Creation) — full-viewport scenic; wide grid */
.bible-suite-game-root:has(.otg-ten-host),
.bible-suite-game-root:has(.otg-creation-host) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.bible-suite-host.otg-ten-host,
.bible-suite-host.otg-creation-host {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
}

/* Ten Commandments — full-screen artwork at 10% opacity (no procedural scenic) */
.bible-suite-host.otg-ten-host .otg-ten-image-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("/images/games/ten-commandments-tablets.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.1;
}

@media (orientation: portrait) and (max-width: 720px) {
    .bible-suite-host.otg-ten-host .otg-ten-image-bg {
        background-image: url("/images/games/ten-commandments-tablets-portrait.png");
    }
}

/* Creation timeline — wide vs tall artwork by viewport aspect ratio; 35% opacity */
.bible-suite-host.otg-creation-host .otg-creation-image-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #050210;
    background-image: url("/images/games/creation-timeline-landscape.png");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0.35;
}

@media (max-aspect-ratio: 1/1) {
    .bible-suite-host.otg-creation-host .otg-creation-image-bg {
        background-image: url("/images/games/creation-timeline-portrait.png");
    }
}

.bible-suite-layer.otg-layer--ten,
.bible-suite-layer.otg-layer--creation {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    min-height: 0;
    padding:
        max(0.35rem, env(safe-area-inset-top, 0px))
        max(0.55rem, env(safe-area-inset-right, 0px))
        max(0.55rem, env(safe-area-inset-bottom, 0px))
        max(0.55rem, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Creation timeline — legible type over richer scenic */
.bible-suite-host.otg-creation-host .otg-layer--creation {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.bible-suite-host.otg-creation-host .otg-lead,
.bible-suite-host.otg-creation-host .otg-hud-hint {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.otg-layer--ten .otg-shell,
.otg-layer--creation .otg-shell {
    max-width: none;
    width: 100%;
    margin: 0;
}

/* Ten Commandments — drop zones stacked in one column, shuffled choices stacked in the other */
.otg-layer--ten .otg-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(0.45rem, 2vw, 1rem);
    align-items: start;
}

@media (max-width: 720px) {
    .otg-layer--ten .otg-board {
        grid-template-columns: 1fr;
    }
}

.otg-layer--ten .otg-slots {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0;
}

.otg-layer--ten .otg-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: clamp(2.55rem, 8.2vh, 3.45rem);
    font-size: clamp(0.81rem, 3.64vw, 0.96rem);
}

.otg-layer--ten .otg-pool {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.otg-layer--ten .otg-pool-card {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: clamp(2.55rem, 8.2vh, 3.45rem);
    padding: 0.45rem 0.5rem;
    font-size: clamp(0.81rem, 3.64vw, 0.96rem);
}

/* Creation timeline — drop zones in a vertical column on the left, shuffled cards on the right; row height shared */
.otg-layer--creation .otg-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(0.45rem, 2.2vw, 1.1rem);
    align-items: start;
    --otg-creation-row-h: clamp(3.35rem, 10vh, 5.75rem);
}

@media (max-width: 520px) {
    .otg-layer--creation .otg-board {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 0.35rem;
        --otg-creation-row-h: clamp(3.1rem, 11vw, 4.5rem);
    }
}

.otg-layer--creation .otg-slots {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0;
}

.otg-layer--creation .otg-slot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-height: var(--otg-creation-row-h, 4.25rem);
    padding: 0.5rem 0.55rem;
    font-size: clamp(0.82rem, 2.4vw, 0.98rem);
    line-height: 1.35;
}

.otg-layer--creation .otg-pool {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.otg-layer--creation .otg-pool-card {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: var(--otg-creation-row-h, 4.25rem);
    padding: 0.5rem 0.55rem;
    font-size: clamp(0.88rem, 2.6vw, 1.05rem);
    line-height: 1.35;
    font-weight: 600;
}

.otg-lead {
    margin: 0 0 0.55rem 0;
    font-size: clamp(0.76rem, 2vw, 0.88rem);
    line-height: 1.45;
    color: rgba(254, 243, 199, 0.94);
}

.otg-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.35rem;
}

.otg-timer {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.05rem;
    color: #fde68a;
    min-width: 2.75rem;
}

.otg-hud-hint {
    flex: 1 1 12rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: rgba(253, 230, 138, 0.82);
}

.otg-status {
    min-height: 1.25rem;
    margin: 0 0 0.5rem 0;
    font-size: 0.78rem;
    color: rgba(252, 211, 77, 0.95);
}

.otg-board {
    margin-bottom: 0.65rem;
}

.otg-board--locked {
    pointer-events: none;
    opacity: 0.92;
}

.otg-slots {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.otg-slot {
    width: 100%;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    color: #fde68a;
    background: rgba(0, 0, 0, 0.22);
    border: 2px dashed rgba(251, 191, 36, 0.45);
    font-size: 0.72rem;
    line-height: 1.35;
    transition: border-color 0.15s ease, border-style 0.15s ease, background 0.15s ease;
}

.otg-slot--correct {
    border-style: solid;
    border-color: rgba(252, 211, 77, 0.95);
    background: rgba(30, 50, 28, 0.45);
}

.otg-slot--wrong {
    animation: otg-slot-shake 0.38s ease;
    border-color: rgba(248, 113, 113, 0.9);
}

@keyframes otg-slot-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.otg-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.otg-pool-card {
    cursor: grab;
    padding: 0.38rem 0.55rem;
    border-radius: 8px;
    font-size: 0.7rem;
    line-height: 1.3;
    color: #fef3c7;
    background: rgba(30, 22, 48, 0.82);
    border: 1px solid rgba(251, 191, 36, 0.4);
    max-width: 100%;
    touch-action: manipulation;
}

.otg-pool-card:active {
    cursor: grabbing;
}

.otg-pool-card--selected {
    outline: 2px solid #fde68a;
    outline-offset: 2px;
}

.otg-pool-card--dragging {
    opacity: 0.75;
}

.otg-reset {
    margin-top: 0.15rem;
}

.otg-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.otg-modal[hidden] {
    display: none !important;
}

.otg-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.otg-modal-panel {
    position: relative;
    max-width: 22rem;
    width: 100%;
    margin: 0;
    padding: 1.15rem 1.25rem 1.25rem;
    border-radius: 0.65rem;
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.99));
    border: 1px solid rgba(253, 230, 138, 0.28);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.45);
    text-align: center;
}

.otg-modal-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: 700;
    color: #fef9c3;
}

.otg-modal-body {
    margin: 0 0 1rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(254, 243, 199, 0.9);
}

.otg-modal-btn {
    min-width: 8rem;
}

/* Dream Statue (Daniel 2) — game shell inside bible-suite-layer */
.ds-shell {
    max-width: 28rem;
    margin: 0 auto;
    text-align: center;
}

.ds-lead {
    margin: 0 0 0.65rem 0;
    font-size: clamp(0.76rem, 2vw, 0.88rem);
    line-height: 1.45;
    color: rgba(254, 243, 199, 0.92);
}

.ds-hint {
    margin: 0 0 0.4rem 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(253, 230, 138, 0.88);
}

.ds-word {
    font-size: clamp(1.15rem, 4vw, 1.45rem);
    letter-spacing: 0.18em;
    font-weight: 800;
    color: #fef9c3;
    margin-bottom: 0.25rem;
}

.ds-wrong {
    margin: 0 0 0.35rem 0;
    font-size: 0.72rem;
    color: rgba(251, 191, 136, 0.85);
}

.ds-canvas {
    display: block;
    margin: 0.35rem auto;
    width: min(92vw, 280px);
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.ds-msg {
    margin: 0.35rem 0 0.5rem;
    min-height: 2.6em;
    font-size: 0.8rem;
    line-height: 1.45;
    color: rgba(254, 249, 195, 0.95);
}

.ds-keys {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    justify-content: center;
    margin-top: 0.25rem;
}

.ds-key {
    padding: 0.32rem 0.42rem !important;
    font-size: 0.7rem !important;
}

.ds-new {
    margin-top: 0.65rem;
}

/* ——— The Great Physician (preview build) ——— */
.gp-layer {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.gp-shell {
    max-width: 52rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: calc(100vh - 120px);
}

.gp-topbar {
    flex-shrink: 0;
}

.gp-faith-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.25rem;
}

.gp-faith-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(254, 243, 199, 0.9);
}

.gp-faith-bar {
    flex: 1 1 140px;
    height: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(251, 191, 36, 0.35);
    overflow: hidden;
}

.gp-faith-fill {
    height: 100%;
    width: 0%;
    border-radius: 5px;
    background: linear-gradient(90deg, #22c55e, #fde68a, #f59e0b);
    transition: width 0.35s ease;
}

.gp-faith-num {
    font-weight: 800;
    font-size: 0.85rem;
    color: #fef9c3;
    min-width: 2.25rem;
}

.gp-tagline {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: rgba(226, 232, 240, 0.88);
}

.gp-map-viewport {
    position: relative;
    flex: 1 1 auto;
    min-height: 280px;
    max-height: min(58vh, 520px);
    overflow: hidden;
    border-radius: 14px;
    border: 2px solid rgba(251, 191, 36, 0.28);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), 0 8px 32px rgba(0, 0, 0, 0.35);
    touch-action: none;
    cursor: grab;
}

.gp-map-viewport:active {
    cursor: grabbing;
}

.gp-map-inner {
    position: absolute;
    width: 165%;
    min-width: 720px;
    height: 115%;
    min-height: 480px;
    left: -22%;
    top: -8%;
    transform: translate(0, 0);
    transition: transform 0.05s linear;
    background:
        radial-gradient(ellipse 80% 50% at 50% 20%, rgba(255, 252, 240, 0.14), transparent 55%),
        linear-gradient(165deg, #f5e6c8 0%, #e8d4b0 35%, #d4c4a0 70%, #c9b896 100%);
    border-radius: 12px;
    box-shadow: 0 0 0 2px rgba(62, 39, 18, 0.12) inset;
}

.gp-map-art {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image: repeating-linear-gradient(
        -12deg,
        transparent,
        transparent 18px,
        rgba(120, 83, 9, 0.06) 18px,
        rgba(120, 83, 9, 0.06) 20px
    );
    pointer-events: none;
}

.gp-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gp-markers > * {
    pointer-events: auto;
}

.gp-region-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 5.5rem;
    max-width: 9rem;
    padding: 0.28rem 0.4rem;
    border-radius: 8px;
    border: 1px solid rgba(62, 39, 18, 0.35);
    background: rgba(255, 252, 246, 0.88);
    cursor: pointer;
    font-size: 0.62rem;
    text-align: center;
    color: #292018;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.gp-region-pin--locked {
    opacity: 0.72;
    filter: grayscale(0.35);
}

.gp-region-pin--soon {
    background: rgba(254, 243, 199, 0.75);
}

.gp-pin-title {
    display: block;
    font-weight: 800;
    line-height: 1.2;
}

.gp-pin-tag {
    display: block;
    font-size: 0.58rem;
    opacity: 0.85;
}

.gp-patient {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 2px solid rgba(251, 191, 36, 0.85);
    background: radial-gradient(circle at 35% 30%, #fef9c3, #f59e0b 55%, #b45309);
    cursor: pointer;
    padding: 0;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.gp-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(253, 224, 71, 0.45);
    animation: gp-pulse-ring 1.6s ease-out infinite;
    pointer-events: none;
}

@keyframes gp-pulse-ring {
    0% {
        transform: scale(0.85);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

.gp-patient-label {
    position: absolute;
    bottom: -1.35rem;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.58rem;
    font-weight: 700;
    color: #fef9c3;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}

.gp-journal {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.45;
    color: rgba(254, 249, 195, 0.92);
    min-height: 2.5em;
}

.gp-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(6, 8, 18, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    overflow-y: auto;
}

.gp-overlay[hidden] {
    display: none !important;
}

.gp-panel {
    max-width: 26rem;
    width: 100%;
    border-radius: 16px;
    padding: 1.1rem 1.15rem 1.2rem;
    position: relative;
    isolation: isolate;
    background-color: #0d0a06;
    background-image: none;
    border: 2px solid rgba(120, 53, 15, 0.28);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    color: #000000;
}

.gp-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        linear-gradient(165deg, rgba(255, 250, 240, 0.93), rgba(232, 214, 188, 0.95)),
        var(--bible-parchment-image);
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
}

.gp-panel > * {
    position: relative;
    z-index: 1;
}

.gp-panel--wide {
    max-width: 28rem;
}

.gp-panel-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    font-family: Georgia, "Times New Roman", serif;
    color: #000000;
}

.gp-en-story {
    margin: 0 0 0.45rem 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

.gp-en-ref {
    margin: 0 0 0.65rem 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: #000000;
}

.gp-en-prompt {
    margin: 0 0 0.45rem 0;
    font-size: 0.78rem;
    font-weight: 600;
}

.gp-en-approaches {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.65rem;
}

.gp-approach-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 0.72rem;
    padding: 0.45rem 0.65rem;
}

.gp-ap-label {
    font-weight: 800;
    font-size: 0.78rem;
}

.gp-ap-blurb {
    font-weight: 500;
    opacity: 0.88;
    font-size: 0.68rem;
    margin-top: 0.12rem;
}

.gp-panel-close {
    width: 100%;
    margin-top: 0.25rem;
}

.gp-m3-sub {
    margin: 0 0 0.5rem 0;
    font-size: 0.76rem;
    line-height: 1.45;
}

.gp-m3-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(62, 39, 18, 0.25);
    touch-action: manipulation;
    cursor: pointer;
}

.gp-m3-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    margin-top: 0.65rem;
}

.bible-suite-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

.bible-suite-hub-unfinished {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0 1.25rem;
    border-top: 1px solid rgba(251, 191, 36, 0.2);
}

.bible-suite-hub-section-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: Georgia, serif;
    color: #fcd34d;
    letter-spacing: 0.03em;
}

.bible-suite-hub-section-lead {
    margin: 0 0 0.65rem;
    font-size: 0.74rem;
    line-height: 1.4;
    opacity: 0.82;
    max-width: 40rem;
}

.bible-suite-hub-grid--unfinished {
    padding-top: 0.15rem;
}

.bible-suite-hub-card--unfinished {
    border-style: dashed;
    border-color: rgba(251, 191, 36, 0.38);
    background: linear-gradient(145deg, rgba(48, 36, 72, 0.75), rgba(22, 16, 38, 0.88));
}

.bible-suite-hub-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(251, 191, 36, 0.28);
    background: linear-gradient(145deg, rgba(40, 28, 60, 0.92), rgba(18, 12, 32, 0.96));
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.bible-suite-hub-card:hover,
.bible-suite-hub-card:focus-visible {
    outline: none;
    transform: translateY(-2px);
    border-color: rgba(252, 211, 77, 0.55);
}

.bible-suite-hub-card h3 {
    margin: 0;
    font-size: 1rem;
    color: #fde68a;
    font-family: Georgia, serif;
}

.bible-suite-hub-card p {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.4;
    opacity: 0.88;
}

.bible-suite-hub-card .bible-suite-hub-go {
    margin-top: auto;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #86efac;
}

.bible-suite-page--hub {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99, 102, 241, 0.25), transparent),
        #0a0612;
}

/* Proverbs Wheel — dark page chrome, parchment panels, black type */
.bible-suite-page.pw-page {
    background: linear-gradient(180deg, #2a2418 0%, #1c1812 42%, #12100c 100%);
    color: #000000;
}

.bible-suite-page.pw-page .bible-suite-header {
    flex-shrink: 0;
    border-bottom-color: rgba(62, 44, 28, 0.35);
    background: linear-gradient(180deg, rgba(255, 254, 250, 0.98), rgba(236, 228, 212, 0.96));
    color: #000000;
}

.bible-suite-page.pw-page .bible-suite-brand {
    color: #000000;
    text-shadow: none;
}

.bible-suite-page.pw-page .bible-suite-tagline {
    color: #000000;
    opacity: 1;
}

.bible-suite-page.pw-page .bible-suite-home {
    color: #000000;
    border-color: rgba(62, 44, 28, 0.35);
    background: rgba(255, 252, 245, 0.88);
}

.bible-suite-page.pw-page .bible-suite-home:hover,
.bible-suite-page.pw-page .bible-suite-home:focus-visible {
    color: #000000;
    border-color: rgba(62, 44, 28, 0.5);
    background: rgba(255, 250, 240, 0.98);
}

/* Wheel of Wisdom — force black typography in chrome + game root (overrides suite defaults). */
.bible-suite-page.pw-page .bible-suite-game-root,
.bible-suite-page.pw-page .bible-suite-host,
.bible-suite-page.pw-page .bible-suite-layer.pw-layer {
    color: #000000;
}

.bible-suite-page.pw-page .bible-suite-header,
.bible-suite-page.pw-page .bible-suite-header * {
    color: #000000;
}

.bible-suite-page.pw-page .bible-suite-btn:hover,
.bible-suite-page.pw-page .bible-suite-btn:focus-visible {
    color: #000000 !important;
}

.bible-suite-game-root:has(.pw-layer) {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: transparent;
}

.bible-suite-host:has(.pw-layer) {
    flex: 1 1 auto;
    min-height: 0;
    background: transparent;
}

.bible-suite-layer.pw-layer {
    flex: 1 1 auto;
    min-height: 0;
    background: transparent;
}

.pw-layer {
    color: #000000;
}

.pw-parchment .bible-suite-btn {
    color: #000000;
}

/* Wheel of Wisdom — all on-screen type in pure black (overrides global suite button brown). */
.bible-suite-page.pw-page .bible-suite-btn,
.bible-suite-page.pw-page .pw-layer button {
    color: #000000 !important;
}

.bible-suite-page.pw-page .pw-result,
.bible-suite-page.pw-page .pw-result * {
    color: #000000;
}

.bible-suite-page.pw-page .pw-col--wheel,
.bible-suite-page.pw-page .pw-col--wheel .pw-space-hint,
.bible-suite-page.pw-page .pw-col--wheel .pw-space-hint kbd {
    color: #000000;
}

.pw-layer .pw-shell {
    max-width: 34rem;
    margin: 0 auto;
    padding: 0.35rem 0.5rem 1rem;
    box-sizing: border-box;
    min-height: 100%;
}

/* Wheel left, instructions + verse + quiz right */
.pw-layer .pw-shell.pw-shell--split {
    max-width: min(1120px, 100%);
    width: 100%;
    display: grid;
    grid-template-columns: minmax(220px, 40%) minmax(0, 1fr);
    gap: clamp(0.65rem, 2vw, 1.35rem);
    align-items: stretch;
    min-height: 100%;
}

@media (max-width: 760px) {
    .pw-layer .pw-shell.pw-shell--split {
        grid-template-columns: 1fr;
    }
}

.pw-col--wheel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    padding: 0.5rem 0.45rem 0.65rem;
    border-radius: 16px;
    border: 1px solid rgba(120, 53, 15, 0.28);
    background: rgba(228, 218, 198, 0.94);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    height: 100%;
}

.pw-col--copy {
    display: flex;
    min-height: 0;
}

.pw-col--copy .pw-parchment {
    width: 100%;
    box-sizing: border-box;
    height: 100%;
}

.pw-load-error {
    padding: 1.25rem 1rem;
    margin: 0.5rem;
    border-radius: 12px;
    background: rgba(254, 226, 226, 0.95);
    border: 1px solid rgba(185, 28, 28, 0.35);
    color: #000000;
    font-size: 0.95rem;
    max-width: 36rem;
}

/* Same asset path as BibleCubes tile overlays: wwwroot/images/Parchment/Parchment.png */
.pw-parchment {
    --pw-parchment-png: url("/images/Parchment/Parchment.png");
    position: relative;
    isolation: isolate;
    background-color: #d4c4a8;
    background-image: none;
    border: 2px solid rgba(180, 83, 9, 0.38);
    border-radius: 18px;
    box-shadow:
        0 6px 24px rgba(62, 44, 28, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.45);
    padding: 1rem 1.15rem 1.35rem;
    color: #000000;
    text-align: left;
}

.pw-parchment::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background-image:
        linear-gradient(165deg, rgba(255, 252, 245, 0.4) 0%, rgba(245, 236, 220, 0.46) 100%),
        var(--pw-parchment-png);
    background-size: 100% 100%, 100% 100%;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center;
    transform: rotate(var(--bible-parchment-aspect-rot, 0deg)) scale(var(--bible-parchment-bg-scale, 1));
    transform-origin: center center;
}

.pw-parchment > * {
    position: relative;
    z-index: 1;
}

.pw-parchment strong,
.pw-parchment kbd {
    color: #000000;
}

.pw-title {
    margin: 0 0 0.4rem 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.2rem, 3.2vw, 1.55rem);
    font-weight: 700;
    color: #000000;
    letter-spacing: 0.02em;
    text-align: center;
}

.pw-lead {
    margin: 0 0 0.65rem 0;
    font-size: clamp(0.78rem, 2.1vw, 0.92rem);
    line-height: 1.55;
    color: #000000;
}

.pw-steps {
    margin: 0 0 0.85rem 0;
    padding: 0;
    list-style: none;
    font-size: clamp(0.74rem, 2vw, 0.86rem);
    line-height: 1.45;
    color: #000000;
}

.pw-steps li {
    margin-bottom: 0.28rem;
}

.pw-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    margin-right: 0.35rem;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 800;
    color: #000000;
    background: linear-gradient(180deg, rgba(253, 224, 71, 0.95), rgba(245, 158, 11, 0.88));
    box-shadow: 0 0 0 1px rgba(120, 53, 15, 0.35);
    vertical-align: middle;
}

.pw-wheel-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0.15rem 0 0.35rem;
}

.pw-canvas {
    display: block;
    width: 100%;
    max-width: min(92vw, 480px);
    height: auto;
    border-radius: 50%;
    box-shadow: 0 6px 28px rgba(45, 28, 12, 0.35);
}

.pw-actions {
    text-align: center;
    margin-bottom: 0.85rem;
}

.pw-spin-btn {
    min-width: 12rem;
}

.pw-space-hint {
    margin: 0.45rem 0 0;
    font-size: 0.72rem;
    color: #000000;
}

.pw-space-hint kbd {
    padding: 0.12rem 0.35rem;
    border-radius: 4px;
    border: 1px solid rgba(120, 53, 15, 0.35);
    background: rgba(255, 252, 246, 0.9);
    font-size: 0.68rem;
}

.pw-result {
    min-height: 4.5rem;
    margin-bottom: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 252, 246, 0.65);
    border: 1px solid rgba(120, 53, 15, 0.22);
}

.pw-result-placeholder__title {
    margin: 0 0 0.35rem 0;
    font-weight: 800;
    font-size: 0.88rem;
    color: #000000;
}

.pw-result-placeholder__body {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #000000;
}

.pw-result-kicker {
    margin: 0 0 0.4rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #000000;
}

.pw-blockquote {
    margin: 0 0 0.45rem 0;
    padding: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(0.88rem, 2.4vw, 1.02rem);
    line-height: 1.45;
    font-style: italic;
    color: #000000;
    border: none;
}

.pw-ref {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    color: #000000;
}

.pw-quiz {
    padding: 0.65rem 0.75rem 0.75rem;
    border-radius: 12px;
    border: 2px solid rgba(120, 53, 15, 0.55);
    background: linear-gradient(180deg, rgba(30, 22, 48, 0.06), rgba(120, 53, 15, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pw-quiz-title {
    margin: 0 0 0.35rem 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #000000;
}

.pw-quiz-q {
    margin: 0 0 0.55rem 0;
    font-size: calc(1.68rem * 2 / 3);
    line-height: 1.45;
    font-weight: 600;
    color: #000000;
}

.pw-quiz-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pw-quiz-btn {
    flex: 1 1 42%;
    min-width: 8rem;
    cursor: pointer;
    padding: 0.5rem 0.65rem;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    border: 2px solid rgba(120, 53, 15, 0.38);
    color: #000000;
    background-color: #f5f3ef;
    box-shadow: 0 1px 4px rgba(45, 28, 12, 0.08);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        border-color 0.12s ease,
        background-color 0.12s ease;
}

.pw-quiz-btn:hover:not(:disabled),
.pw-quiz-btn:focus-visible:not(:disabled) {
    outline: none;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(45, 28, 12, 0.14);
    border-color: rgba(90, 70, 50, 0.55);
    background-color: #faf9f6;
}

.pw-quiz-btn:disabled {
    opacity: 0.72;
    cursor: default;
}

.pw-quiz--answered .pw-quiz-btn:disabled {
    opacity: 1;
}

@keyframes pw-quiz-btn-wrong-flash {
    0% {
        border-color: rgba(120, 53, 15, 0.38);
        background-color: #f5f3ef;
        box-shadow: 0 1px 4px rgba(45, 28, 12, 0.08);
    }
    22% {
        border-color: rgba(185, 28, 28, 0.95);
        background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
        box-shadow:
            0 0 0 2px rgba(239, 68, 68, 0.55),
            0 0 18px rgba(220, 38, 38, 0.45);
    }
    55% {
        border-color: rgba(220, 38, 38, 0.88);
        background: linear-gradient(180deg, #fecaca 0%, #fca5a5 100%);
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
    }
    100% {
        border-color: rgba(153, 27, 27, 0.65);
        background: linear-gradient(180deg, #fef2f2 0%, #fee2e2 100%);
        box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35);
    }
}

/* Wrong choice: red flash on the button that was clicked (correct answer gets gold separately). */
.pw-quiz-btn--picked-wrong:disabled {
    opacity: 1;
    animation: pw-quiz-btn-wrong-flash 0.85s ease-out forwards;
}

/* Correct answer: shiny gold border (no green fill). */
.pw-quiz-btn--picked-right:disabled {
    opacity: 1;
    color: #000000;
    background: linear-gradient(180deg, #fffef8 0%, #faf6e8 45%, #f3ead0 100%) !important;
    border: 2px solid #c9a227 !important;
    box-shadow:
        0 0 0 1px rgba(255, 248, 200, 0.95),
        0 0 14px rgba(212, 175, 55, 0.55),
        0 0 28px rgba(184, 134, 11, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(180, 140, 40, 0.2);
}

.pw-quiz-feedback {
    margin: 0.55rem 0 0;
    min-height: 2.75rem;
    font-size: 0.78rem;
    line-height: 1.45;
    color: #000000;
}

.pw-quiz-feedback--ok {
    color: #000000;
    font-weight: 600;
}

.pw-quiz-feedback--no {
    color: #000000;
    font-weight: 600;
}

/* Goliath's Gauntlet — DK-style canvas (also titled: Barrels of Babel / Samson's Smash in-game) */
.bible-suite-page.gg-page {
    background: radial-gradient(ellipse 90% 40% at 50% 0%, rgba(99, 102, 241, 0.22), transparent),
        #0a0612;
}

.bible-suite-page.gg-page .bible-suite-header.gg-header {
    border-bottom-color: rgba(251, 191, 36, 0.22);
}

.bible-suite-game-root.gg-game-root {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.35rem 0.5rem 0.65rem;
    box-sizing: border-box;
    overflow: auto;
    background: transparent;
}

.bible-suite-layer.gg-layer {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    max-width: min(680px, 100%);
    display: flex;
    justify-content: center;
}

.gg-intro-ui {
    position: absolute;
    left: 50%;
    bottom: clamp(0.75rem, 4vh, 1.5rem);
    transform: translateX(-50%);
    z-index: 4;
    pointer-events: none;
    display: flex;
    justify-content: center;
    width: calc(100% - 2rem);
    max-width: 28rem;
}

.gg-intro-ui[hidden] {
    display: none !important;
}

.gg-start-btn {
    pointer-events: auto;
    cursor: pointer;
    min-width: 8.5rem;
    padding: 0.55rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    border-radius: 12px;
    border: 2px solid rgba(251, 191, 36, 0.65);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.2);
}

.gg-start-btn:hover,
.gg-start-btn:focus-visible {
    outline: none;
    filter: brightness(1.08);
    border-color: #fcd34d;
}

.gg-canvas {
    display: block;
    width: 100%;
    max-width: 640px;
    height: auto;
    border-radius: 14px;
    border: 2px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Kingdom Quest — Mario-style platformer (Exodus Odyssey / Promised Platformers / Heroes of the Faith) */
.bible-suite-page.kq-page {
    background: radial-gradient(ellipse 90% 45% at 50% 0%, rgba(34, 197, 94, 0.2), transparent),
        #0a0612;
}

.bible-suite-game-root.kq-game-root {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.35rem 0.5rem 0.65rem;
    box-sizing: border-box;
    overflow: auto;
    background: transparent;
}

.bible-suite-layer.kq-layer {
    flex: 0 0 auto;
    width: 100%;
    max-width: min(760px, 100%);
    display: flex;
    justify-content: center;
}

.kq-canvas {
    display: block;
    width: 100%;
    max-width: 720px;
    height: auto;
    border-radius: 14px;
    border: 2px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* XRPL RWA Tokenization — high-contrast professional console */
.rwa-shell {
    --rwa-bg: #0a0f18;
    /* Step panels + help sidebar — lifted from near-black for easier reading */
    --rwa-panel: #243652;
    /* Tab outline + strip baseline; strip row background stays --rwa-page-canvas (see .rwa-tabs-strip). */
    --rwa-tab-border: rgba(180, 192, 214, 0.55);
    --rwa-tab-border-width: 1px;
    --rwa-tab-surface: var(--rwa-panel);
    --rwa-tab-surface-hover: #2d4268;
    /* Main column, tab strip, active tab only — not panels, sidebar, or buttons */
    --rwa-page-canvas: #02001f;
    --rwa-border: rgba(56, 189, 248, 0.28);
    --rwa-text: #e8edf7;
    --rwa-muted: #94a3b8;
    --rwa-accent: #38bdf8;
    --rwa-accent2: #a5f3fc;
    --rwa-warn-bg: rgba(251, 191, 36, 0.12);
    --rwa-warn-border: rgba(251, 191, 36, 0.45);
    /* Five stacked, fading drop shadows (blur grows, opacity falls) for raised controls */
    --rwa-fade-drops-5:
        0 1px 0 rgba(2, 6, 23, 0.22),
        0 2px 2px rgba(2, 6, 23, 0.17),
        0 3px 5px rgba(2, 6, 23, 0.12),
        0 4px 10px rgba(2, 6, 23, 0.075),
        0 5px 18px rgba(2, 6, 23, 0.045);
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-width: min(96rem, 100%);
    margin: 0 auto;
    box-sizing: border-box;
    min-height: 100dvh;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
    color: var(--rwa-text);
}

.rwa-shell__main {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    z-index: 1;
    background: var(--rwa-page-canvas);
    overflow-x: clip;
}

/* Guidance in-flow on the right: ~35px strip when unpinned + not hovered; expands on hover or when pinned/open */
.rwa-guidance-column {
    position: relative;
    z-index: 0;
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
    width: 35px;
    min-width: 35px;
    max-width: min(22rem, min(34vw, 100%));
    box-sizing: border-box;
    transition: width 0.6s ease, min-width 0.6s ease;
    cursor: pointer;
}

.rwa-guidance-column.rwa-guidance-column--expanded {
    cursor: default;
}

.rwa-guidance-column:hover,
.rwa-guidance-column.rwa-guidance-column--expanded {
    width: min(22rem, min(34vw, 100%));
}

/* Row layout: main column vs guidance scroll independently (viewport-tall shell); collapsed strip keeps title only (vertical) */
@media (min-width: 52.0625rem) {
    .rwa-shell {
        height: 100dvh;
        min-height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    .rwa-shell__main {
        min-height: 0;
        overflow-y: auto;
    }

    .rwa-guidance-column {
        min-height: 0;
    }

    .rwa-help-sidebar {
        min-height: 0;
        height: 100%;
        max-height: 100%;
    }

    .rwa-guidance-column:not(:hover):not(.rwa-guidance-column--expanded) .rwa-help-sidebar__actions,
    .rwa-guidance-column:not(:hover):not(.rwa-guidance-column--expanded) .rwa-help-sidebar__scroll {
        display: none;
    }

    .rwa-guidance-column:not(:hover):not(.rwa-guidance-column--expanded) .rwa-help-sidebar__header {
        flex: 1 1 auto;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 0.85rem 0.35rem 0.65rem;
        border-bottom: none;
    }

    .rwa-guidance-column:not(:hover):not(.rwa-guidance-column--expanded) .rwa-help-sidebar__title {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        font-size: 0.88rem;
        font-weight: 800;
        letter-spacing: 0.04em;
    }
}

.rwa-page {
    min-height: 100dvh;
    color: var(--rwa-text);
    padding: 0 1rem 2.5rem;
    max-width: 72rem;
    margin: 0 auto;
    box-sizing: border-box;
    font-family: inherit;
}

.rwa-page--lead {
    min-height: 0;
    padding-bottom: 0;
}

.rwa-page--body {
    min-height: 0;
    padding-top: 0;
    position: relative;
    z-index: 0;
}

.rwa-help-sidebar {
    position: relative;
    box-sizing: border-box;
    flex: 0 0 auto;
    width: min(22rem, min(34vw, 100%));
    min-height: 100dvh;
    background: var(--rwa-panel);
    border-left: 1px solid var(--rwa-border);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    color: var(--rwa-text);
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.25);
}

.rwa-help-sidebar__sheet {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

@media (prefers-reduced-motion: reduce) {
    .rwa-guidance-column {
        transition: none;
    }
}

.rwa-help-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--rwa-border);
    flex-shrink: 0;
}

.rwa-help-sidebar__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #f0f9ff;
}

.rwa-help-sidebar__actions {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.rwa-help-sidebar__scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.75rem 0.85rem 1.25rem;
    font-size: 0.82rem;
    line-height: 1.5;
}

.rwa-help-sidebar__overview {
    margin: -0.15rem 0 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(56, 189, 248, 0.22);
}

.rwa-help-overview-link {
    display: inline-block;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--rwa-accent2);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rwa-help-overview-link:hover,
.rwa-help-overview-link:focus-visible {
    color: #e0f2fe;
    outline: none;
}

.rwa-help-overview-meta {
    margin: 0.4rem 0 0;
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--rwa-muted);
}

.rwa-help-code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.85em;
    color: #bae6fd;
}

/* XRPL RWA overview (/XRPL-RWA-Overview): ordered-list copy inside rwa-panel */
.rwa-copy-ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--rwa-muted);
}

.rwa-copy-ol li {
    margin: 0.65rem 0;
    line-height: 1.55;
}

.rwa-copy-ol strong {
    color: var(--rwa-text);
}

.rwa-copy-ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--rwa-muted);
}

.rwa-copy-ul li {
    margin: 0.45rem 0;
    line-height: 1.55;
}

.rwa-copy-ul strong {
    color: var(--rwa-text);
}

/* Case-study screenshot placeholders (/XRPL-RWA-Ice-Cream-Example) */
.rwa-case-shot {
    margin: 0.75rem 0 1.25rem;
    padding: 1.25rem 1rem;
    border-radius: 10px;
    border: 1px dashed rgba(148, 163, 184, 0.55);
    background: rgba(8, 12, 22, 0.45);
    text-align: center;
}

.rwa-case-shot figcaption {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.95);
}

/* Glossary hover targets (e.g. XRPL-RWA-Overview) — same cursor-tip popup as XRPL Tokenization tabs */
.rwa-term-tip-target {
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
}

.rwa-help-sidebar__lede {
    margin: 0 0 0.85rem;
    color: var(--rwa-muted);
}

.rwa-help-sidebar__details {
    margin-bottom: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
    background: rgba(15, 23, 42, 0.5);
}

.rwa-help-sidebar__details summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--rwa-accent2);
}

.rwa-help-sidebar__h3 {
    margin: 0 0 0.5rem;
    font-size: 0.92rem;
    font-weight: 800;
    color: #e0f2fe;
}

.rwa-help-block {
    margin-bottom: 0.85rem;
}

.rwa-help-block__h {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--rwa-accent);
}

.rwa-help-block__p {
    margin: 0;
    color: var(--rwa-muted);
}

.rwa-help-block__ul {
    margin: 0.35rem 0 0;
    padding-left: 1.2rem;
    color: var(--rwa-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.rwa-help-block__ul li {
    margin: 0.25rem 0;
}

.rwa-header-actions {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Circular help / pin controls — slightly darker than default Mud surface */
.rwa-shell button.mud-icon-button.rwa-header-help-btn,
.rwa-shell button.mud-icon-button.rwa-panel-help-btn,
.rwa-shell button.mud-icon-button.rwa-help-sidebar__pin {
    background-color: rgba(4, 8, 14, 0.96) !important;
    border: 1px solid rgba(48, 58, 74, 0.65) !important;
    color: var(--rwa-accent2) !important;
    box-shadow: var(--rwa-fade-drops-5) !important;
    transition: box-shadow 0.15s ease, filter 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.rwa-shell button.mud-icon-button.rwa-header-help-btn:hover,
.rwa-shell button.mud-icon-button.rwa-panel-help-btn:hover,
.rwa-shell button.mud-icon-button.rwa-help-sidebar__pin:hover {
    background-color: rgba(3, 6, 12, 0.98) !important;
    filter: brightness(1.04);
}

.rwa-panel__toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.rwa-panel__title {
    flex: 1 1 auto;
    margin-bottom: 0.25rem;
}

.rwa-panel-help-btn {
    flex-shrink: 0;
    margin-top: -0.15rem;
}

.rwa-header {
    padding: 1.25rem 0 0.75rem;
    border-bottom: 1px solid var(--rwa-border);
    margin-bottom: 1rem;
}

/* Tokenization lab: tab strip already has a baseline rule — omit header underline under the warn box */
.rwa-header.rwa-header--tabbed {
    border-bottom: none;
    margin-bottom: 0;
}

.rwa-header-row-rule {
    border: 0;
    border-top: 1px solid var(--rwa-border);
    margin: 0.35rem 0 0.55rem;
}

.rwa-header-row-rule + .rwa-subtitle {
    margin-top: 0;
}

.rwa-header-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    align-content: flex-start;
}

.rwa-header-row--with-actions {
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.rwa-header-main {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    flex: 1 1 12rem;
    min-width: 0;
}

.rwa-testnet-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-shrink: 0;
    padding: 0.45rem 0.65rem;
    min-width: auto;
    min-height: 2.35rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    line-height: 1;
    color: #f8fafc;
    box-shadow: var(--rwa-fade-drops-5);
    transition: border-color 0.15s ease, background 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.rwa-testnet-toggle:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.rwa-testnet-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rwa-testnet-toggle__label {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    user-select: none;
}

.rwa-testnet-toggle__icon {
    flex-shrink: 0;
    font-size: 1.15rem !important;
    opacity: 1;
}

.rwa-testnet-toggle--connected {
    background: rgba(22, 163, 74, 0.55);
    border-color: rgba(34, 197, 94, 0.65);
}

.rwa-testnet-toggle--connected:hover:not(:disabled) {
    background: rgba(22, 163, 74, 0.72);
    border-color: rgba(134, 239, 172, 0.85);
    filter: brightness(1.03);
}

.rwa-testnet-toggle--disconnected {
    background: rgba(185, 28, 28, 0.45);
    border-color: rgba(248, 113, 113, 0.55);
}

.rwa-testnet-toggle--disconnected:hover:not(:disabled) {
    background: rgba(185, 28, 28, 0.62);
    border-color: rgba(252, 165, 165, 0.75);
    filter: brightness(1.03);
}

@media (max-width: 36rem) {
    /* Column stack: reset header-main flex-grow (1 1 12rem is for row axis only). */
    .rwa-header-row--with-actions {
        flex-direction: column;
        justify-content: flex-start;
        align-content: flex-start;
    }

    .rwa-header-row--with-actions .rwa-header-main {
        flex: 0 1 auto;
        width: 100%;
    }

    .rwa-header-actions {
        margin-left: 0;
        align-self: flex-end;
    }
}

@media (max-width: 52rem) {
    .rwa-shell {
        flex-direction: column;
    }

    .rwa-guidance-column {
        width: 100% !important;
        max-width: none;
        min-width: 0;
        justify-content: stretch;
        overflow: visible;
    }

    .rwa-guidance-column:hover {
        width: 100% !important;
    }

    .rwa-help-sidebar {
        width: 100%;
        min-height: 0;
        max-height: min(42vh, 22rem);
        flex-direction: column;
        border-left: none;
        border-top: 1px solid var(--rwa-border);
    }

    .rwa-help-sidebar__sheet {
        min-height: 0;
    }
}

.rwa-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--rwa-border);
    color: var(--rwa-accent2);
    text-decoration: none;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: var(--rwa-fade-drops-5);
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.rwa-back:hover,
.rwa-back:focus-visible {
    outline: none;
    border-color: #7dd3fc;
    color: #fff;
}

.rwa-brand-block {
    flex: 1 1 12rem;
    min-width: 0;
}

.rwa-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #f0f9ff;
}

.rwa-header > .rwa-subtitle {
    margin-top: 0.5rem;
}

.rwa-subtitle {
    margin: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--rwa-muted);
}

.rwa-subtitle strong {
    color: var(--rwa-accent2);
}

.rwa-warn {
    margin-top: 0.85rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--rwa-warn-border);
    background: var(--rwa-warn-bg);
    color: #fef3c7;
    font-size: 0.82rem;
    line-height: 1.45;
}

.rwa-btn {
    cursor: pointer;
    border-radius: 9px;
    padding: 0.45rem 0.85rem;
    font-weight: 700;
    font-size: 0.8rem;
    border: 1px solid rgba(71, 85, 105, 0.55);
    background: rgba(8, 12, 22, 0.97);
    color: #e2e8f0;
    box-shadow: var(--rwa-fade-drops-5);
    transition: box-shadow 0.15s ease, filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

a.rwa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

button.rwa-btn.rwa-btn--with-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.rwa-btn__icon {
    flex-shrink: 0;
    font-size: 1.1rem !important;
    opacity: 0.95;
}

.rwa-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rwa-btn--primary {
    border-color: rgba(56, 189, 248, 0.55);
    background: linear-gradient(165deg, rgba(14, 116, 144, 0.95), rgba(8, 47, 73, 0.98));
    color: #ecfeff;
}

.rwa-btn--sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
}

.rwa-btn:hover:not(:disabled),
.rwa-btn:focus-visible:not(:disabled) {
    outline: none;
    filter: brightness(1.06);
}

/*
 * Tab strip: under .rwa-shell__main — width follows the main column so steps stay visible
 * as the guidance column peeks or expands (in-flow layout; no viewport breakout).
 */
.rwa-tabs-strip {
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 0.85rem;
    padding: 0.5rem 0 0;
    position: relative;
    background: var(--rwa-page-canvas);
    border-bottom: var(--rwa-tab-border-width) solid var(--rwa-tab-border);
}

/* Full strip width; horizontal gutter matches .rwa-page body padding */
.rwa-tabs-strip__inner {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.rwa-tabs-flex {
    container-type: inline-size;
    container-name: rwa-tabs;
    display: flex;
    flex-wrap: wrap;
    /* Bottom-align tabs to the strip baseline; do not stretch flex lines (avoids a gap above border-bottom when layout width changes, e.g. sidebar closed + zoom). */
    align-items: flex-end;
    align-content: flex-start;
    row-gap: 0;
    column-gap: 0;
    width: 100%;
    margin: 0;
    padding: 0 1rem;
    box-sizing: border-box;
}

.rwa-tab-spacer {
    box-sizing: border-box;
    flex: 0 0 0.35rem;
    width: 0.35rem;
    max-width: 0.35rem;
    align-self: flex-end;
    min-height: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0;
    line-height: 0;
}

.rwa-tab-spacer--start {
    flex: 0 0 0.25rem;
    width: 0.25rem;
    max-width: 0.25rem;
    min-width: 0.25rem;
}

.rwa-tab-spacer--end {
    flex: 1 1 2rem;
    width: auto;
    max-width: none;
    min-width: 0.75rem;
}

/* Narrow tab bar: hide “Step N” first (full step text remains in aria-label on each button) */
@container rwa-tabs (max-width: 56rem) {
    .rwa-tabs-flex .rwa-tab__step {
        display: none;
    }
}

.rwa-tab-cursor-tip {
    position: fixed;
    z-index: 12500;
    max-width: min(18rem, calc(100vw - 1.5rem));
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.35;
    color: #ecfeff;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    transform: translate(0, 0);
}

/* Step 1 issuer / holder wallet panels — cursor-follow safety copy */
.rwa-wallet-seed-panel-tip {
    max-width: min(22rem, calc(100vw - 1.5rem));
}

.rwa-wallet-seed-panel-tip--warn {
    color: #fef2f2 !important;
    background: rgba(127, 29, 29, 0.96) !important;
    border-color: rgba(252, 165, 165, 0.55) !important;
}

.rwa-wallet-seed-panel-tip__lead {
    display: block;
    font-weight: 700;
}

.rwa-wallet-seed-panel {
    cursor: help;
}

.rwa-tab {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    flex: 0 1 auto;
    border-radius: 8px 8px 0 0;
    padding: 0.45rem 0.65rem;
    font: inherit;
    font-weight: 700;
    font-size: 0.76rem;
    border: var(--rwa-tab-border-width) solid var(--rwa-tab-border);
    border-bottom: none;
    background: var(--rwa-tab-surface);
    color: #f8fafc;
    box-shadow: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rwa-tab:not(.rwa-tab--on) {
    padding-top: calc(0.45rem - 1px);
    padding-bottom: calc(0.45rem - 1px);
}

.rwa-tab:hover:not(.rwa-tab--on) {
    background: var(--rwa-tab-surface-hover);
    color: #ffffff;
}

.rwa-tab--on {
    position: relative;
    z-index: 2;
    transform: translateY(1px);
    color: #f0f9ff;
    background: var(--rwa-page-canvas);
    border-left: var(--rwa-tab-border-width) solid var(--rwa-tab-border);
    border-top: var(--rwa-tab-border-width) solid var(--rwa-tab-border);
    border-right: var(--rwa-tab-border-width) solid var(--rwa-tab-border);
    /* Same color as fill: closes the corner with the side borders and paints over the strip baseline. */
    border-bottom: var(--rwa-tab-border-width) solid var(--rwa-page-canvas);
    box-shadow: none;
}

.rwa-tab__step {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--rwa-accent2);
}

.rwa-tab--on .rwa-tab__step {
    color: var(--rwa-accent);
}

.rwa-tab:not(.rwa-tab--on) .rwa-tab__step {
    color: #f8fafc;
}

.rwa-panel__step {
    display: inline-block;
    margin-right: 0.45rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--rwa-accent);
}

.rwa-panel {
    background: var(--rwa-panel);
    border: 1px solid var(--rwa-border);
    border-top: none;
    border-radius: 12px;
    padding: 1rem 1.1rem 1.15rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* Stacked panels (e.g. Activity log under the step panel) keep a top edge */
.rwa-panel + .rwa-panel {
    border-top: 1px solid var(--rwa-border);
}

.rwa-log-panel {
    border-color: rgba(148, 163, 184, 0.35);
}

.rwa-h2 {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    color: #f8fafc;
}

.rwa-h3 {
    margin: 0 0 0.45rem;
    font-size: 0.92rem;
    color: var(--rwa-accent2);
}

.rwa-mt {
    margin-top: 1rem;
}

.rwa-p {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #cbd5e1;
}

.rwa-hint {
    margin: 0.5rem 0 0;
    font-size: 0.76rem;
    color: var(--rwa-muted);
    line-height: 1.45;
}

.rwa-grid2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

.rwa-fieldset {
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(51, 65, 85, 0.65);
    background: rgba(8, 12, 22, 0.55);
}

/* Step 3 issuance: each step in its own bordered card (no <hr> dividers) */
.rwa-issue-step-groups {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 48rem;
    margin-top: 0.15rem;
}

.rwa-issue-step-groups .rwa-fieldset {
    border: 1px solid var(--rwa-border);
    background: rgba(6, 12, 24, 0.72);
    box-shadow: inset 0 1px 0 rgba(56, 189, 248, 0.06);
}

.rwa-issue-step-groups .rwa-fieldset > .rwa-row--issue-first {
    margin-top: 0;
}

.rwa-issue-mint-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.rwa-label {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 0.45rem;
}

.rwa-label__format {
    display: block;
    font-size: 0.68rem;
    font-weight: 500;
    color: rgba(148, 163, 184, 0.95);
    line-height: 1.4;
    margin: 0 0 0.08rem;
    max-width: 48rem;
}

.rwa-label__format code {
    font-size: 0.9em;
    color: #bae6fd;
}

/* Extra breathing room below helper copy (e.g. before a tall textarea + float hint) */
.rwa-label__format--gap-below {
    margin-bottom: 0.75rem;
}

.rwa-inline-label-block {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

/* Step 4 DEX: title + helper left, input right; stacked under each other (not grid columns). */
.rwa-label.rwa-label--dex-offer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem 1rem;
    width: 100%;
    max-width: 48rem;
    box-sizing: border-box;
}

.rwa-label.rwa-label--dex-offer .rwa-dex-offer-copy {
    flex: 1 1 14rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.rwa-label.rwa-label--dex-offer .rwa-input.rwa-input--dex-offer {
    flex: 0 1 14rem;
    width: 14rem;
    max-width: min(14rem, 100%);
    align-self: center;
}

@media (max-width: 32rem) {
    .rwa-label.rwa-label--dex-offer .rwa-input.rwa-input--dex-offer {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
        align-self: stretch;
    }
}

/* Step 4 DEX: separate “place offer” from cancel-by-sequence */
.rwa-dex-cancel__rule {
    border: 0;
    border-top: 1px solid var(--rwa-border);
    margin: 0.95rem 0 0.5rem;
    max-width: 48rem;
}

.rwa-dex-cancel {
    max-width: 48rem;
}

.rwa-label.rwa-label--dex-cancel {
    margin-bottom: 0.25rem;
}

.rwa-row.rwa-row--dex-cancel-actions {
    margin-top: 0.35rem;
    flex-wrap: wrap;
    align-items: center;
}

/* RWA DEX marketplace (/RWA-DEX) */
.rwa-mkt-body {
    max-width: 56rem;
}

.rwa-mkt-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.rwa-mkt-catalog {
    flex: 1 1 14rem;
    max-width: 22rem;
}

.rwa-mkt-detail {
    flex: 2 1 22rem;
    min-width: 0;
}

.rwa-mkt-catalog-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.rwa-mkt-catalog-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--rwa-border);
    background: rgba(8, 12, 22, 0.55);
    color: #e2e8f0;
    font: inherit;
    cursor: pointer;
}

.rwa-mkt-catalog-item:hover {
    border-color: rgba(56, 189, 248, 0.55);
}

.rwa-mkt-catalog-item--on {
    border-color: rgba(56, 189, 248, 0.95);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.rwa-mkt-catalog-item__name {
    font-weight: 700;
    font-size: 0.82rem;
}

.rwa-mkt-catalog-item__meta {
    font-size: 0.68rem;
    color: rgba(148, 163, 184, 0.95);
}

.rwa-mkt-desc {
    white-space: pre-wrap;
}

.rwa-mkt-dl {
    margin: 0.5rem 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.rwa-mkt-dl > div {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

.rwa-mkt-dl dt {
    margin: 0;
    color: #94a3b8;
    font-weight: 600;
}

.rwa-mkt-dl dd {
    margin: 0;
    color: #e2e8f0;
}

.rwa-mkt-seeds {
    margin-bottom: 0.75rem;
}

.rwa-mkt-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.65rem 0 0.5rem;
}

.rwa-mkt-subtab {
    border: 1px solid rgba(71, 85, 105, 0.95);
    background: rgba(15, 23, 42, 0.65);
    color: #cbd5e1;
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
}

.rwa-mkt-subtab--on {
    border-color: rgba(56, 189, 248, 0.65);
    color: #f0f9ff;
}

.rwa-mkt-subpanel {
    padding: 0.35rem 0 0.5rem;
}

.rwa-mkt-ack {
    margin-bottom: 0.55rem;
}

.rwa-mkt-log {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.72rem;
    color: rgba(203, 213, 225, 0.92);
    max-height: 14rem;
    overflow-y: auto;
}

.rwa-mkt-admin {
    margin-top: 1rem;
}

.rwa-mkt-app-table-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
}

.rwa-mkt-app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}

.rwa-mkt-app-table th,
.rwa-mkt-app-table td {
    border: 1px solid rgba(51, 65, 85, 0.75);
    padding: 0.35rem 0.45rem;
    vertical-align: top;
    text-align: left;
}

.rwa-mkt-app-table th {
    background: rgba(8, 12, 22, 0.75);
    color: #cbd5e1;
}

.rwa-mkt-app-msg {
    max-width: 14rem;
    word-break: break-word;
}

.rwa-label.rwa-inline {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
}

.rwa-label.rwa-inline .rwa-inline-label-block {
    flex: 0 1 auto;
}

.rwa-input,
.rwa-textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(71, 85, 105, 0.95);
    background: #0b1220;
    color: #f1f5f9;
    padding: 0.45rem 0.55rem;
    font-size: 0.85rem;
}

/* Auto height with content (Chromium / recent Firefox); others keep resizable min height */
.rwa-textarea.rwa-textarea--autosize {
    min-height: 4.5rem;
    max-height: min(70vh, 28rem);
    resize: none;
    overflow-y: auto;
    field-sizing: content;
}

@supports not (field-sizing: content) {
    .rwa-textarea.rwa-textarea--autosize {
        /* Height adjusted via ltRwaAutosizeTextarea (scrollHeight); avoid misleading manual-only resize */
        resize: none;
        min-height: 5.5rem;
    }
}

.rwa-input:focus-visible,
.rwa-textarea:focus-visible {
    outline: 2px solid var(--rwa-accent);
    outline-offset: 1px;
}

.rwa-input--narrow {
    max-width: 10rem;
    width: auto;
}

/* Watermark / example text: inside the field at rest, top-right on border when focused or filled */
.rwa-input-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.rwa-label__title {
    display: block;
}

.rwa-float-hint {
    position: absolute;
    z-index: 2;
    left: 0.55rem;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
    color: rgba(148, 163, 184, 0.88);
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition:
        top 0.2s ease,
        right 0.2s ease,
        left 0.2s ease,
        transform 0.2s ease,
        font-size 0.2s ease,
        color 0.2s ease,
        background-color 0.2s ease,
        padding 0.2s ease;
}

.rwa-input-wrap:focus-within .rwa-float-hint,
.rwa-input-wrap:has(.rwa-input:not(:placeholder-shown)) .rwa-float-hint,
.rwa-input-wrap:has(.rwa-textarea:not(:placeholder-shown)) .rwa-float-hint {
    top: 0;
    right: 0.5rem;
    left: auto;
    transform: translateY(-52%);
    box-sizing: border-box;
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #94a3b8;
    max-width: min(70%, 16rem);
    background: #0b1220;
    border: 1px solid rgba(71, 85, 105, 0.95);
    border-radius: 6px;
    /* Room for descenders (g, p, y); overflow visible overrides base ellipsis clipping */
    padding: 0.06rem 0.22rem 0.1rem;
    line-height: 1.28;
    overflow: visible;
    text-overflow: clip;
}

.rwa-input-wrap .rwa-input,
.rwa-input-wrap .rwa-textarea {
    position: relative;
    z-index: 1;
}

.rwa-input-wrap .rwa-input::placeholder,
.rwa-input-wrap .rwa-textarea::placeholder {
    color: transparent;
}

.rwa-input-wrap:focus-within .rwa-textarea,
.rwa-input-wrap:has(.rwa-textarea:not(:placeholder-shown)) .rwa-textarea {
    padding-top: 0.7rem;
}

/* Textarea: at rest, hint reads like a normal left watermark inside the field. Floats to top-right when focused or once it has text. */
.rwa-input-wrap:has(.rwa-textarea):not(:focus-within):has(.rwa-textarea:placeholder-shown) .rwa-float-hint {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-height: 2.8em;
    text-align: left;
    left: 0.55rem;
    right: 0.55rem;
}

/* Floated textarea label: top-right inset (matches single-line chip behavior) */
.rwa-input-wrap:has(.rwa-textarea):focus-within .rwa-float-hint,
.rwa-input-wrap:has(.rwa-textarea:not(:placeholder-shown)) .rwa-float-hint {
    left: auto;
    right: 0.5rem;
    text-align: right;
    max-height: none;
    display: block;
    -webkit-line-clamp: unset;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: min(88%, 22rem);
}

.rwa-label.rwa-inline .rwa-input-wrap {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 12rem;
}

.rwa-label.rwa-inline .rwa-float-hint {
    right: 2rem;
    max-width: 8rem;
}

.rwa-label.rwa-inline .rwa-input-wrap:focus-within .rwa-float-hint,
.rwa-label.rwa-inline .rwa-input-wrap:has(.rwa-input:not(:placeholder-shown)) .rwa-float-hint {
    right: 0.35rem;
    max-width: 9rem;
    font-size: 0.52rem;
    line-height: 1.28;
    overflow: visible;
    text-overflow: clip;
}

.rwa-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.55rem;
}

.rwa-row--wrap {
    align-items: flex-start;
}

.rwa-wallet-export {
    margin-top: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.rwa-wallet-export > button.rwa-btn {
    align-self: flex-end;
}

.rwa-xrp-qr-wrap {
    margin-top: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--rwa-border);
    background: rgba(8, 12, 22, 0.45);
    max-width: 20rem;
}

.rwa-xrp-qr-wrap img {
    display: block;
    border-radius: 8px;
}

.rwa-xrp-qr-meta {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.rwa-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #e2e8f0;
    cursor: pointer;
}

.rwa-mono {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.78rem;
    word-break: break-all;
    color: #bae6fd;
    margin: 0.35rem 0 0;
}

.rwa-kv {
    font-size: 0.78rem;
    color: var(--rwa-muted);
    margin: 0.25rem 0 0;
}

.rwa-kv strong {
    color: #fef08a;
}

.rwa-drop-zone {
    margin: 0.65rem 0;
    min-height: 5.5rem;
    border: 2px dashed rgba(56, 189, 248, 0.45);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--rwa-accent2);
    font-weight: 700;
    font-size: 0.88rem;
    background: rgba(8, 47, 73, 0.25);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rwa-drop-zone--active {
    border-color: #7dd3fc;
    background: rgba(14, 116, 144, 0.22);
}

.rwa-drop-icon {
    font-size: 1.5rem;
    opacity: 0.85;
}

.rwa-file-input {
    margin: 0.35rem 0 0.65rem;
    font-size: 0.78rem;
    color: var(--rwa-muted);
}

.rwa-doc-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
}

.rwa-doc-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(51, 65, 85, 0.75);
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
    background: rgba(8, 12, 22, 0.45);
}

.rwa-muted {
    color: var(--rwa-muted);
    font-size: 0.74rem;
}

.rwa-pre {
    margin: 0.65rem 0 0;
    padding: 0.65rem 0.75rem;
    max-height: 22rem;
    overflow: auto;
    border-radius: 10px;
    background: #050810;
    color: #d1fae5;
    border: 1px solid rgba(51, 65, 85, 0.85);
    font-size: 0.72rem;
    line-height: 1.4;
}

.rwa-log {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.76rem;
    line-height: 1.45;
    color: #cbd5e1;
    max-height: 16rem;
    overflow: auto;
}

.rwa-log li {
    margin: 0.25em 0;
}

/* Testnet connect prompt (Load issuer / Load holder when disconnected) */
.rwa-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 13500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(2px);
}

.rwa-modal {
    width: 100%;
    max-width: 26rem;
    border-radius: 12px;
    padding: 1.2rem 1.35rem 1.35rem;
    background: var(--rwa-panel);
    border: 1px solid var(--rwa-border);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    color: var(--rwa-text);
    box-sizing: border-box;
}

.rwa-modal-title {
    margin: 0 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #f0f9ff;
}

.rwa-modal-hint {
    margin: 0 0 0.85rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--rwa-muted);
}

.rwa-modal-connected {
    margin: 0.35rem 0 0.15rem;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #4ade80;
    text-shadow: 0 0 18px rgba(74, 222, 128, 0.35);
}

.rwa-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.25rem;
}

.rwa-modal-actions--split {
    justify-content: space-between;
    align-items: center;
}

.rwa-modal-error-label {
    display: block;
    margin: 0.85rem 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fecaca;
}

.rwa-modal-error-text {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(15, 23, 42, 0.85);
    color: #fecaca;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 0.82rem;
    line-height: 1.45;
    resize: vertical;
    min-height: 5rem;
}

/* —— FileShare —— */
.fs-page {
    max-width: 1100px;
    margin: 0 auto;
}

.fs-header {
    margin-bottom: 1.25rem;
}

.fs-header .home-panel-title {
    margin: 0.35rem 0 0.25rem;
}

.fs-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 880px) {
    .fs-columns {
        grid-template-columns: 1fr;
    }
}

.fs-section-title {
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
    font-weight: 650;
}

.fs-left,
.fs-right {
    min-width: 0;
}

.fs-right--stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fs-right--stack > .fs-section-title {
    margin-bottom: 0.75rem;
}

.fs-empty {
    opacity: 0.85;
    font-size: 0.95rem;
}

.fs-batch {
    margin-bottom: 1.35rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fs-batch-title {
    font-size: 1.05rem;
    margin: 0;
    font-weight: 650;
}

.fs-batch-meta {
    font-size: 0.82rem;
    opacity: 0.88;
    margin: 0;
    line-height: 1.35;
}

.fs-batch-foot {
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.fs-batch-foot-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    align-items: stretch;
}

.fs-batch-foot-left,
.fs-batch-foot-right {
    flex: 1 1 140px;
    min-width: 0;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(248, 113, 113, 0.42);
    display: flex;
    align-items: center;
}

.fs-batch-foot-right {
    justify-content: flex-end;
    text-align: right;
}

.fs-file-list {
    list-style: none;
    margin: 0 0 0.35rem;
    padding: 0;
}

.fs-file-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: baseline;
    margin: 0.3rem 0;
    font-size: 0.92rem;
}

.fs-file-link {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fs-file-size {
    font-size: 0.82rem;
    opacity: 0.75;
}

.fs-label {
    display: block;
    margin: 0.85rem 0 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.fs-label--foot {
    margin: 0 0 0.35rem;
}

.fs-upload-foot {
    margin-top: auto;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.fs-upload-foot-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    align-items: stretch;
}

.fs-upload-foot-left,
.fs-upload-foot-right {
    flex: 1 1 160px;
    min-width: 0;
    padding: 0.5rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(248, 113, 113, 0.42);
}

.fs-upload-foot-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.fs-upload-foot-msg {
    font-size: 0.9rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.95);
}

.fs-upload-complete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    border: 1px solid rgba(248, 113, 113, 0.55);
    background: rgba(220, 38, 38, 0.28);
    color: rgba(255, 255, 255, 0.96);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: default;
}

.fs-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.2);
    color: inherit;
}

.fs-drop-wrap {
    position: relative;
    min-height: 168px;
    margin-top: 0.35rem;
    border: 2px dashed rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.12);
}

.fs-drop-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
    padding: 1rem;
    font-size: 0.95rem;
}

.fs-input-file {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.fs-staged {
    font-size: 0.86rem;
    opacity: 0.88;
    margin: 0.5rem 0 0;
    padding-left: 1.2rem;
}

.fs-check {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin: 1rem 0;
    font-size: 0.92rem;
    line-height: 1.35;
}

.fs-check input {
    margin-top: 0.2rem;
}

.fs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}

.fs-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.fs-btn--primary {
    background: rgba(59, 130, 246, 0.35);
    border-color: rgba(59, 130, 246, 0.55);
    font-weight: 600;
}

.fs-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.55);
}

.fs-modal {
    width: 100%;
    max-width: 520px;
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    background: var(--home-panel-bg, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.fs-modal-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.fs-modal-hint {
    margin: 0 0 0.65rem;
    font-size: 0.88rem;
    opacity: 0.88;
    line-height: 1.4;
}

.fs-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 7rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font-family: inherit;
    font-size: 0.92rem;
}

.fs-error {
    color: #fecaca;
    font-size: 0.88rem;
    margin: 0.45rem 0 0;
}

.fs-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
}

/* --- Chat page (full viewport) --- */
.full-viewport-layout {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.social-chat-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 0.75rem 1rem 1rem;
    background: linear-gradient(165deg, #1e2a4a 0%, #121a2e 42%, #1a2438 100%);
    color: #f1f5f9;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.social-chat-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.social-chat-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.social-chat-brand {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.social-chat-brand-icon {
    font-size: 2rem;
    line-height: 1;
}

.social-chat-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.social-chat-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.88rem;
    opacity: 0.88;
    max-width: 36rem;
    line-height: 1.35;
}

.social-chat-topbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.social-chat-select {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.65);
    color: #f8fafc;
    padding: 0.35rem 0.6rem;
    font-size: 0.9rem;
}

.social-chat-conn {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.social-chat-conn--ok {
    background: rgba(34, 197, 94, 0.2);
    color: #bbf7d0;
}

.social-chat-conn--warn {
    background: rgba(251, 191, 36, 0.18);
    color: #fef9c3;
}

.social-chat-conn--bad {
    background: rgba(248, 113, 113, 0.2);
    color: #fecaca;
}

.social-chat-home-link {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.92rem;
}

.social-chat-home-link:hover {
    text-decoration: underline;
}

.social-chat-grid {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(200px, 260px);
    grid-template-rows: minmax(0, 1fr);
    gap: 0.75rem;
    min-height: 0;
}

/* Tablet (~700-960 px wide): keep 3-col layout but trim side panels so the chat fits. */
@media (min-width: 700px) and (max-width: 960px) {
    .social-chat-grid {
        grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) minmax(150px, 210px);
        gap: 0.5rem;
    }
}

/* Phones / very narrow: stack panels vertically. */
@media (max-width: 699px) {
    .social-chat-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .social-chat-main {
        min-height: 0;
    }
}

.social-chat-panel {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 0;
}

.social-chat-panel-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.85);
}

.social-chat-room-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.social-chat-room-btn {
    width: 100%;
    text-align: left;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
    padding: 0.5rem 0.65rem;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.social-chat-room-btn:hover {
    background: rgba(51, 65, 85, 0.75);
}

.social-chat-room-btn.is-active {
    border-color: rgba(147, 197, 253, 0.55);
    background: rgba(59, 130, 246, 0.22);
}

.social-chat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.9);
}

.social-chat-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(2, 6, 23, 0.45);
    color: #f8fafc;
    padding: 0.45rem 0.55rem;
    font-size: 0.92rem;
}

.social-chat-search {
    margin-top: 0.25rem;
}

.social-chat-hint {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.75;
    line-height: 1.35;
}

.social-chat-name-block {
    margin-top: 0.5rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.social-chat-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 0.75rem 0.85rem;
    font-size: 1.1em;
}

.social-chat-main-head {
    flex: 0 0 auto;
}

.social-chat-room-label {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: rgba(147, 197, 253, 0.95);
}

.social-chat-feed {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-top: 0.5rem;
    padding: 0.35rem 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.social-chat-empty {
    margin: auto;
    text-align: center;
    opacity: 0.8;
    font-size: 0.95rem;
    padding: 1rem;
}

.social-chat-bubble {
    background: rgba(30, 41, 59, 0.85);
    border-radius: 12px;
    padding: 0.45rem 0.65rem 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.social-chat-bubble--notice {
    width: 96%;
    max-width: 96%;
    align-self: center;
    margin-left: auto;
    margin-right: auto;
    /* Aligned with .bws-page--red (burgundy panel + rose border) */
    background: linear-gradient(165deg, rgba(47, 17, 27, 0.96) 0%, rgba(36, 16, 25, 0.96) 45%, rgba(59, 23, 35, 0.96) 100%);
    border-color: rgba(251, 191, 203, 0.42);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.12);
}

.social-chat-bubble--notice .social-chat-author {
    color: #fecdd3;
}

.social-chat-bubble--notice .social-chat-time {
    color: rgba(254, 226, 231, 0.75);
    opacity: 0.9;
}

.social-chat-bubble--notice .social-chat-body--notice {
    color: rgba(255, 248, 250, 0.96);
}

.social-chat-bubble--mine {
    width: 90%;
    max-width: 90%;
    align-self: flex-start;
    margin-right: auto;
    border-color: rgba(56, 189, 248, 0.28);
    background: rgba(12, 74, 110, 0.38);
}

.social-chat-bubble--other {
    width: 90%;
    max-width: 90%;
    align-self: flex-end;
    margin-left: auto;
}

.social-chat-body--notice {
    font-size: 0.88rem;
    line-height: 1.5;
    opacity: 0.95;
}

.social-chat-ai-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    padding: 0.08rem 0.38rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
    background: rgba(99, 102, 241, 0.35);
    border: 1px solid rgba(165, 180, 252, 0.45);
    color: #e0e7ff;
}

.social-chat-ai-pill--sm {
    margin-left: 0.3rem;
    font-size: 0.58rem;
    padding: 0.05rem 0.32rem;
}

.social-chat-bubble-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    margin-bottom: 0.25rem;
}

.social-chat-author {
    font-weight: 700;
    color: #fde68a;
}

.social-chat-time {
    opacity: 0.65;
    white-space: nowrap;
}

.social-chat-body {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.95rem;
    line-height: 1.45;
}

.social-chat-bubble--ai-pending {
    border-color: rgba(129, 140, 248, 0.55);
    background: rgba(30, 27, 58, 0.92);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2), 0 4px 20px rgba(79, 70, 229, 0.15);
}

.social-chat-ai-composing {
    margin: 0.12rem 0 0;
    font-size: 0.84rem;
    font-style: italic;
    color: rgba(199, 210, 254, 0.98);
    letter-spacing: 0.02em;
    animation: social-chat-composing-fade 1.35s ease-in-out infinite;
}

@keyframes social-chat-composing-fade {
    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.social-chat-ai-dots {
    display: flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 1.15em;
    margin: 0.1rem 0 0;
}

.social-chat-ai-dot {
    display: inline-block;
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    background: rgba(165, 180, 252, 0.95);
    animation: social-chat-ai-dot-pulse 1.05s ease-in-out infinite;
}

.social-chat-ai-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.social-chat-ai-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes social-chat-ai-dot-pulse {
    0%,
    100% {
        opacity: 0.25;
        transform: scale(0.88);
    }

    45% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.social-chat-compose {
    margin-top: 0.65rem;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.social-chat-smiles {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.social-chat-smiles-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.social-chat-smiles-hint {
    font-size: 0.72rem;
    opacity: 0.7;
}

.social-chat-smile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.social-chat-chip {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.72);
    color: #fefce8;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.social-chat-chip:hover {
    background: rgba(51, 65, 85, 0.88);
    border-color: rgba(186, 230, 253, 0.35);
}

.social-chat-chip--emoji {
    padding: 0.28rem 0.62rem;
    min-width: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-chat-chip-emoji {
    font-size: 1.28rem;
    line-height: 1;
}

/* Single bordered compose region: rendered (emoticon-expanded) preview + raw draft textarea */
.social-chat-compose-editor {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(2, 6, 23, 0.5);
    overflow: hidden;
}

.social-chat-textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 4.5rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #f8fafc;
    padding: 0.55rem 0.65rem;
    font-size: 0.95rem;
    font-family: inherit;
}

.social-chat-textarea:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
}

.social-chat-send-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-chat-enter-send {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: auto;
    font-size: 0.82rem;
    font-weight: 500;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.social-chat-enter-send input {
    cursor: pointer;
    width: 1rem;
    height: 1rem;
    accent-color: #60a5fa;
}

.social-chat-send {
    border: none;
    border-radius: 11px;
    padding: 0.45rem 1.1rem;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.social-chat-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.social-chat-secondary {
    border-radius: 11px;
    padding: 0.45rem 0.85rem;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 41, 59, 0.6);
    color: #e2e8f0;
}

.social-chat-contact-list {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    overflow-y: auto;
    max-height: min(48dvh, 480px);
}

.social-chat-contacts-head {
    margin-bottom: 0.35rem;
}

.social-chat-contacts-head--auth {
    margin-bottom: 0.45rem;
}

.social-chat-contacts-book-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
}

.social-chat-contacts-head--auth .social-chat-contacts-label {
    margin-bottom: 0;
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.86rem;
    font-weight: 600;
    color: #cbd5e1;
}

.social-chat-contacts-head--guest .social-chat-panel-title {
    margin-bottom: 0.25rem;
}

.social-chat-contacts-guest-hint {
    margin: 0 0 0.35rem 0;
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0.72;
    color: #cbd5e1;
}

.social-chat-contacts-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.social-chat-contacts-mode {
    display: block;
}

.social-chat-contacts-select {
    width: 100%;
    max-width: 100%;
}

.social-chat-contact {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
}

.social-chat-contact-main {
    position: relative;
    flex: 1;
    min-width: 0;
    padding-right: 1.65rem;
}

.social-chat-contact-main--ai {
    padding-right: 0;
}

.social-chat-contact--ai {
    align-items: center;
}

.social-chat-contact-header--ai {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: nowrap;
    width: 100%;
}

.social-chat-contact-header--ai .social-chat-contact-name {
    flex: 1;
    min-width: 0;
}

.social-chat-mini--ai-chat {
    flex-shrink: 0;
    margin-left: auto;
}

.social-chat-contact-header {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.social-chat-contact-name {
    flex: 1;
    min-width: 0;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.social-chat-contact-star {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    margin: 0;
    padding: 0.15rem 0.2rem;
    border: none;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
}

.social-chat-contact-star.is-hollow {
    color: rgba(226, 232, 240, 0.42);
}

.social-chat-contact-star.is-hollow:hover {
    color: rgba(250, 250, 250, 0.75);
    background: rgba(255, 255, 255, 0.06);
}

.social-chat-contact-star:hover {
    background: rgba(255, 255, 255, 0.08);
}

.social-chat-contact-star.is-solid {
    color: #fbbf24;
    opacity: 1;
}

.social-chat-contact-empty {
    list-style: none;
    margin: 0;
    padding: 0.75rem 0.35rem;
    font-size: 0.85rem;
    opacity: 0.72;
    line-height: 1.45;
}

.social-chat-contact-avatar {
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 10px;
    background: linear-gradient(145deg, #6366f1, #4338ca);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
}

.social-chat-contact-body {
    flex: 1;
    min-width: 0;
}

.social-chat-contact-status {
    font-size: 0.75rem;
    opacity: 0.65;
    margin-top: 0.1rem;
}

.social-chat-contact-status.is-online {
    color: #86efac;
    opacity: 1;
}

.social-chat-contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
    align-items: center;
}

.social-chat-mini {
    font-size: 0.75rem;
    padding: 0.2rem 0.45rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(15, 23, 42, 0.55);
    color: #e2e8f0;
    cursor: pointer;
}

.social-chat-mini:hover {
    background: rgba(51, 65, 85, 0.65);
}

.social-chat-tel {
    font-size: 1rem;
    text-decoration: none;
    line-height: 1;
    padding: 0.15rem 0.25rem;
}

.social-chat-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.55);
}

.social-chat-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2001;
    width: min(92vw, 420px);
    padding: 1rem 1.15rem 1.1rem;
    border-radius: 16px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: #f1f5f9;
}

.social-chat-modal-title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.social-chat-modal-hint {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    line-height: 1.4;
    opacity: 0.88;
}

.social-chat-video {
    width: 100%;
    border-radius: 12px;
    background: #020617;
    max-height: 240px;
}

.social-chat-audio-placeholder {
    text-align: center;
    font-size: 3rem;
    padding: 1.25rem 0;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
}

.social-chat-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 0.75rem;
}

.social-chat-modal-actions--wrap {
    justify-content: flex-start;
}

.social-chat-modal--wide {
    width: min(94vw, 520px);
    max-height: 90vh;
    overflow-y: auto;
}

.social-chat-ai-settings-wrap {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    /* Invisible hover bridge: keeps :hover true while moving from the button to the menu (no dead zone). */
    padding-bottom: 12px;
    margin-bottom: -12px;
}

.social-chat-ai-hover-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 11.5rem;
    padding: 0.35rem 0;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.social-chat-ai-settings-wrap:hover .social-chat-ai-hover-menu,
.social-chat-ai-settings-wrap:focus-within .social-chat-ai-hover-menu {
    display: block;
}

.social-chat-ai-hover-menu-title {
    padding: 0.15rem 0.8rem 0.3rem;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(148, 163, 184, 0.95);
}

.social-chat-ai-hover-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.48rem 0.85rem;
    border: none;
    background: transparent;
    color: #f1f5f9;
    font-size: 0.88rem;
    cursor: pointer;
}

.social-chat-ai-hover-menu-item:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.78);
}

.social-chat-ai-hover-menu-item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.social-chat-ai-settings-btn {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.75);
    color: #e2e8f0;
    border-radius: 10px;
    padding: 0.32rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.social-chat-ai-settings-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: rgba(186, 230, 253, 0.35);
}

.social-chat-ai-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.social-chat-ai-form .social-chat-label {
    margin-top: 0.25rem;
}

.social-chat-ai-checkbox {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    cursor: pointer;
}

.social-chat-code {
    font-size: 0.78rem;
    padding: 0.1rem 0.25rem;
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    word-break: break-all;
}

/* --- Dream interpretation (full viewport) --- */
.dream-page {
    --dream-page-bg: linear-gradient(175deg, #1a1528 0%, #12101c 40%, #1e1a30 100%);
    --dream-text: #f1f5f9;
    --dream-header-bg: rgba(18, 16, 28, 0.92);
    --dream-header-border: rgba(251, 191, 36, 0.22);
    --dream-title-color: #fefce8;
    --dream-instructions-bg: linear-gradient(112deg, rgba(68, 52, 112, 0.46) 0%, rgba(52, 40, 90, 0.4) 58%, rgba(33, 26, 58, 0.34) 100%);
    --dream-instructions-text: #fef3c7;
    --dream-empty-text: #f8fafc;
    --dream-user-bg: rgba(67, 97, 167, 0.36);
    --dream-user-border: rgba(186, 230, 253, 0.42);
    --dream-ai-bg: rgba(125, 78, 202, 0.34);
    --dream-ai-border: rgba(221, 214, 254, 0.4);
    --dream-ai-text: #fffbeb;
    --dream-compose-border: rgba(255, 255, 255, 0.1);
    --dream-textarea-border: rgba(147, 197, 253, 0.45);
    --dream-textarea-bg: rgba(59, 130, 246, 0.2);
    --dream-textarea-color: #f8fafc;
    --dream-textarea-placeholder: rgba(248, 250, 252, 0.48);
    min-height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 5.8rem 1rem 1rem;
    background: var(--dream-page-bg);
    color: var(--dream-text);
    font-family: Georgia, "Times New Roman", serif;
}

.dream-page--red {
    --dream-page-bg: linear-gradient(175deg, #2a0f19 0%, #1c0d13 42%, #30121e 100%);
    --dream-header-bg: rgba(35, 10, 18, 0.92);
    --dream-header-border: rgba(251, 113, 133, 0.35);
    --dream-title-color: #ffe4e6;
    --dream-instructions-bg: linear-gradient(112deg, rgba(127, 29, 29, 0.45) 0%, rgba(113, 19, 50, 0.38) 56%, rgba(69, 10, 10, 0.34) 100%);
    --dream-instructions-text: #ffe4e6;
    --dream-user-bg: rgba(190, 24, 93, 0.3);
    --dream-user-border: rgba(253, 164, 175, 0.45);
    --dream-ai-bg: rgba(225, 29, 72, 0.24);
    --dream-ai-border: rgba(254, 205, 211, 0.4);
    --dream-ai-text: #fff1f2;
}

.dream-page--dark {
    --dream-page-bg: linear-gradient(175deg, #121726 0%, #0c1320 44%, #161d2f 100%);
    --dream-header-bg: rgba(10, 16, 30, 0.92);
    --dream-header-border: rgba(147, 197, 253, 0.24);
    --dream-title-color: #e2e8f0;
    --dream-instructions-bg: linear-gradient(112deg, rgba(37, 99, 235, 0.22) 0%, rgba(30, 64, 175, 0.2) 58%, rgba(15, 23, 42, 0.3) 100%);
    --dream-instructions-text: #e2e8f0;
    --dream-user-bg: rgba(30, 64, 175, 0.28);
    --dream-user-border: rgba(147, 197, 253, 0.35);
    --dream-ai-bg: rgba(14, 116, 144, 0.25);
    --dream-ai-border: rgba(125, 211, 252, 0.32);
    --dream-ai-text: #e0f2fe;
}

.dream-page--blue {
    --dream-page-bg: linear-gradient(175deg, #0d1b36 0%, #0b1225 40%, #13284c 100%);
    --dream-header-bg: rgba(11, 18, 37, 0.92);
    --dream-header-border: rgba(96, 165, 250, 0.3);
    --dream-title-color: #dbeafe;
    --dream-instructions-bg: linear-gradient(112deg, rgba(30, 64, 175, 0.4) 0%, rgba(30, 58, 138, 0.34) 58%, rgba(15, 23, 42, 0.32) 100%);
    --dream-instructions-text: #dbeafe;
    --dream-user-bg: rgba(29, 78, 216, 0.3);
    --dream-user-border: rgba(147, 197, 253, 0.45);
    --dream-ai-bg: rgba(8, 145, 178, 0.24);
    --dream-ai-border: rgba(103, 232, 249, 0.38);
    --dream-ai-text: #e0f2fe;
}

.dream-page--light {
    --dream-page-bg: linear-gradient(175deg, #c1ccdc 0%, #b5c1d3 48%, #a5b4cb 100%);
    --dream-text: #000000;
    --dream-header-bg: rgba(241, 245, 249, 0.96);
    --dream-header-border: rgba(100, 116, 139, 0.42);
    --dream-title-color: #000000;
    --dream-instructions-bg: linear-gradient(112deg, rgba(191, 219, 254, 0.62) 0%, rgba(203, 213, 225, 0.72) 58%, rgba(226, 232, 240, 0.82) 100%);
    --dream-instructions-text: #000000;
    --dream-empty-text: #000000;
    --dream-user-bg: rgba(147, 197, 253, 0.62);
    --dream-user-border: rgba(59, 130, 246, 0.58);
    --dream-ai-bg: rgba(196, 181, 253, 0.62);
    --dream-ai-border: rgba(99, 102, 241, 0.48);
    --dream-ai-text: #000000;
    --dream-compose-border: rgba(51, 65, 85, 0.2);
    --dream-textarea-border: rgba(148, 163, 184, 0.55);
    --dream-textarea-bg: rgba(241, 245, 249, 0.92);
    --dream-textarea-color: #000000;
    --dream-textarea-placeholder: rgba(0, 0, 0, 0.55);
}

.dream-page--light .dream-session-time,
.dream-page--light .dream-theme-label,
.dream-page--light .dream-home,
.dream-page--light .dream-donate-btn {
    color: #000000;
}

/* Force maximum readability in Light theme: all text renders black. */
.dream-page--light,
.dream-page--light * {
    color: #000000 !important;
}

.dream-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.dream-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem 0.65rem;
    background: var(--dream-header-bg);
    border-bottom: 1px solid var(--dream-header-border);
    backdrop-filter: blur(4px);
}

.dream-title {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 600;
    color: var(--dream-title-color);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.dream-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
}

.dream-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.dream-theme-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: inherit;
}

.dream-theme-select {
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(15, 23, 42, 0.45);
    color: #f8fafc;
    padding: 0.32rem 0.5rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.dream-page--light .dream-theme-select {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
}

.dream-session-time {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.62rem;
    border-radius: 10px;
    border: 1px solid rgba(147, 197, 253, 0.35);
    background: rgba(30, 58, 138, 0.25);
    color: #dbeafe;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}

.dream-session-tooltip {
    position: fixed;
    z-index: 1300;
    max-width: min(34rem, calc(100vw - 2rem));
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    border: 1px solid rgba(147, 197, 253, 0.35);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    font-size: 0.82rem;
    line-height: 1.35;
    pointer-events: none;
}


.dream-donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(192, 132, 252, 0.45);
    background: rgba(139, 92, 246, 0.18);
    color: #f5f3ff;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
}

.dream-donate-btn:hover {
    background: rgba(139, 92, 246, 0.28);
}

.dream-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.15);
    color: #fef9c3;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.4rem 0.75rem;
    border-radius: 10px;
    cursor: pointer;
}

.dream-pdf-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.dream-pdf-icon {
    font-size: 1.1rem;
}

.dream-home {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.dream-home:hover {
    text-decoration: underline;
}

.dream-home--back {
    font-size: 0.86rem;
}

.dream-instructions {
    background: var(--dream-instructions-bg);
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 12px;
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.5rem;
}

.dream-instructions-text {
    margin: 0;
    font-size: clamp(1rem, 2.2vw, 1.1rem);
    line-height: 1.42;
    color: var(--dream-instructions-text);
    font-family: Georgia, "Times New Roman", serif;
}

.dream-banner {
    border-radius: 10px;
    padding: 0.5rem 0.7rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.45;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.dream-banner--warn {
    background: rgba(251, 113, 133, 0.18);
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: #fecdd3;
}

.dream-banner--info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #dbeafe;
}

.dream-banner--error {
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fecaca;
}

.dream-feed {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.35rem 0.15rem 0.75rem;
}

.dream-empty {
    margin: 1rem auto;
    max-width: 36rem;
    text-align: center;
    opacity: 0.85;
    font-size: 1.1rem;
    line-height: 1.58;
    color: var(--dream-empty-text);
}

.dream-row--user {
    display: flex;
    justify-content: flex-start;
}

.dream-row--ai {
    display: flex;
    justify-content: flex-end;
}

.dream-bubble {
    width: 90%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    padding: 0.65rem 0.85rem 0.75rem;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.dream-bubble--user {
    background: var(--dream-user-bg);
    border: 1px solid var(--dream-user-border);
}

.dream-bubble--ai {
    background: var(--dream-ai-bg);
    border: 1px solid var(--dream-ai-border);
}

.dream-bubble-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.75;
    margin-bottom: 0.3rem;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.dream-bubble-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 1.08rem;
    line-height: 1.58;
    color: var(--dream-text);
}

.dream-bubble--ai .dream-bubble-text {
    color: var(--dream-ai-text);
}

.dream-bubble--ai .dream-md.chat-md-body {
    margin-top: 0;
    font-size: 1.08rem;
    line-height: 1.58;
    color: var(--dream-ai-text);
    overflow-x: auto;
}

.dream-bubble--ai .dream-md.chat-md-body .chat-md-h {
    color: var(--dream-ai-text);
}

.dream-bubble--ai .dream-md.chat-md-body .chat-md-p,
.dream-bubble--ai .dream-md.chat-md-body .chat-md-ul li {
    color: var(--dream-ai-text);
}

.dream-bubble--ai .dream-md.chat-md-body .chat-md-code {
    background: rgba(15, 23, 42, 0.55);
    color: #ede9fe;
}

.dream-bubble--ai .dream-md.chat-md-body .chat-md-pre {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(216, 180, 254, 0.35);
    color: #fefce8;
}

.dream-typing {
    margin: 0;
    font-style: italic;
    opacity: 0.75;
    font-size: 1rem;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.dream-compose {
    flex-shrink: 0;
    padding-top: 0.35rem;
    border-top: 1px solid var(--dream-compose-border);
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
}

.dream-textarea {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid var(--dream-textarea-border);
    background: var(--dream-textarea-bg);
    color: var(--dream-textarea-color);
    padding: 0.6rem 0.7rem;
    font-size: 1.06rem;
    resize: vertical;
    min-height: 9rem;
}

.dream-textarea::placeholder {
    color: var(--dream-textarea-placeholder);
    font-style: italic;
}

.dream-compose-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.45rem;
}

.dream-send {
    border: none;
    border-radius: 11px;
    padding: 0.45rem 1.2rem;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fffbeb;
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.35);
}

.dream-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* PDF export progress (modal over dream page) */
.dream-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.dream-pdf-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.dream-pdf-modal__panel {
    position: relative;
    z-index: 1;
    max-width: 22rem;
    width: 100%;
    border-radius: 14px;
    padding: 1.35rem 1.5rem 1.5rem;
    background: linear-gradient(165deg, #0b1b45 0%, #111f4e 100%);
    border: 1px solid #d4af37;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
    text-align: center;
}

.dream-pdf-modal__title {
    margin: 0 0 0.65rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
}

.dream-pdf-modal__status {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #ffffff;
    min-height: 2.6rem;
}

.dream-pdf-modal__spinner {
    width: 2.25rem;
    height: 2.25rem;
    margin: 0 auto;
    border-radius: 50%;
    border: 3px solid rgba(180, 83, 9, 0.25);
    border-top-color: #b45309;
    animation: dream-pdf-spin 0.75s linear infinite;
}

.dream-exports-table-wrap {
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.9);
}

.dream-exports-table {
    width: 100%;
    border-collapse: collapse;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
    color: #111827;
}

.dream-exports-table th,
.dream-exports-table td {
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    text-align: left;
    font-size: 0.9rem;
}

.dream-exports-table thead th {
    background: rgba(226, 232, 240, 0.85);
    font-weight: 700;
    white-space: nowrap;
}

.dream-exports-table tbody tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.72);
}

@keyframes dream-pdf-spin {
    to {
        transform: rotate(360deg);
    }
}