/* Bible passage rendering */
.bible-passage p {
    margin-bottom: 0.25rem;
    line-height: 1.6;
}

.bible-passage .v {
    font-size: 0.7em;
    font-weight: 700;
    vertical-align: super;
    color: var(--bs-secondary);
    margin-right: 2px;
}

.bible-passage .wj {
    color: inherit;
}

.bible-passage .nd,
.bible-passage .add {
    font-style: italic;
}

/* Ensure file inputs stay clickable (avoid accidental overlay/pointer rules) */
input[type="file"].form-control {
    position: relative;
    z-index: 1;
}


/* ── Verse Lookup Modal – dynamic fill layout ─────────────────────────────
   Height budget (desktop, modal-lg):
     dialog margin top+bottom : 3.5rem  (~56px)
     .modal-header             : ~57px
     .modal-body padding t+b   : ~32px
     Bible version selector    : ~74px  (label + select + mb-3)
     Tab btn-group             : ~54px  (btn-group + mb-3)
   ─────────────────────────────────────────────────────────────────────── */

/* Make dialog fill viewport minus its own margins */
#verseLookupModal .modal-dialog {
    height: calc(100vh - 3.5rem);
}

/* Content fills the dialog height via flex column */
#verseLookupModal .modal-content {
    height: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
}

/* Body grows to fill remaining space, clips overflow so only results scroll */
#verseLookupModal .modal-body {
    -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
            flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
}

/* Each tab pane is also a flex column so it can pass remaining height down */
.verse-modal-tab {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
            flex: 1 1 auto;
    min-height: 0;
}

/* Results scroll container – calc subtracts fixed elements above it:
   ref tab    : header(57) + body-pad(32) + version(74) + tabs(54) + input(54) = ~271px  → use 300px
   keyword tab: same + paging-bar(~50px)                                        = ~321px  → use 350px */
.verse-results-ref {
    -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
            flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    height: calc(100vh - 300px);
}

.verse-results-kw {
    -webkit-box-flex: 1;
        -ms-flex: 1 1 auto;
            flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    height: calc(100vh - 350px);
}

/* ── Teams page ─────────────────────────────────────────────────────────── */

.team-builder {
    border: 2px dashed var(--bs-primary);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.04) 0%, rgba(25, 135, 84, 0.04) 100%);
}

.team-pool {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.team-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.team-user-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.12);
}

.team-user-card:active {
    cursor: pointer;
    transform: scale(0.98);
}

.team-user-card--disabled {
    opacity: 0.45;
    pointer-events: none;
}

.team-user-card--in-team {
    cursor: default;
    pointer-events: none;
}

.team-user-card--in-team .btn {
    pointer-events: auto;
}

.team-user-card__avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bs-secondary);
    flex-shrink: 0;
}

.team-user-card__avatar--filled {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.team-user-card__info {
    min-width: 0;
    flex: 1;
}

.team-drop-zone {
    min-height: 280px;
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.75rem;
    background: #fff;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.team-drop-zone:has(.team-user-card--in-team) {
    border-style: solid;
    border-color: rgba(25, 135, 84, 0.4);
    background: rgba(25, 135, 84, 0.03);
}

.team-drop-zone__empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--bs-secondary);
    padding: 2rem 1rem;
    pointer-events: none;
}

.team-card {
    border-left: 4px solid var(--bs-success);
}

.team-member-chips {
    display: flex;
    flex-wrap: wrap;
}

/* Hunt map cards on home page */
#map_masonry {
    width: 100%;
}

.hunt-map-masonry-item {
    box-sizing: border-box;
}

.hunt-map-masonry-form {
    width: 100%;
    margin: 0;
}

.hunt-map-card-wrap {
    cursor: pointer;
    display: block;
    width: 100%;
}

.hunt-map-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    min-height: 8.5rem;
}

.hunt-map-card__body {
    display: flex;
    flex-direction: column;
    min-height: 8.5rem;
}

.hunt-map-card__value {
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.hunt-map-card__creator-wrap {
    margin-top: auto;
    padding-top: 0.65rem;
}

.hunt-map-card__creator {
    font-size: 0.72rem;
    font-weight: 500;
    background-color: var(--bs-light);
    color: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
}

.hunt-map-card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
}

.hunt-map-card--filled {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.hunt-map-card--filled:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(13, 110, 253, 0.35);
}

.hunt-map-card--filled .hunt-map-card__type {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.hunt-map-card--filled .hunt-map-card__map-notes {
    color: rgba(255, 255, 255, 0.75);
}

.hunt-map-card--filled .hunt-map-card__creator {
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.hunt-map-card:not(.hunt-map-card--filled) .hunt-map-card__type {
    background-color: var(--bs-primary);
    color: #fff;
}

.hunt-map-card:not(.hunt-map-card--filled) .hunt-map-card__map-notes {
    color: var(--bs-secondary-color);
}

.hunt-map-card__badges {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.35rem;
    z-index: 2;
}

.hunt-map-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    background-color: var(--bs-primary);
    color: #fff;
    border: 1px solid transparent;
}

.hunt-map-card--filled .hunt-map-card__badge {
    background-color: #fff;
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.hunt-map-card__badge--note,
.hunt-map-card__badge--location {
    padding: 0;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: lowercase;
}

.hunt-map-card--selected {
    box-shadow: 0 0.25rem 1rem rgba(13, 110, 253, 0.15);
}

/* Event schedule fields — split date + time pickers */
.event-datetime-group .input-group-text {
    color: var(--bs-secondary-color);
    background-color: var(--bs-light);
}

.event-datetime-group input[type="date"],
.event-datetime-group input[type="time"] {
    min-height: calc(1.5em + 0.75rem + 2px);
}

.event-datetime-group input[type="date"]::-webkit-calendar-picker-indicator,
.event-datetime-group input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.65;
}

.event-datetime-group input[type="date"]:hover::-webkit-calendar-picker-indicator,
.event-datetime-group input[type="time"]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

.hunt-map-card .stretched-link::after {
    z-index: 1;
}

.hunt-map-card__map,
.dmx-leaflet-map {
    min-height: 90px;
    z-index: 0;
}

/* ── App design system (main, dashboard, auth, share) ───────────────────── */

:root {
    --th-bg-gradient: linear-gradient(165deg, #fff9f0 0%, #f4f7fb 45%, #eef6f1 100%);
    --th-title-color: #1a2e1a;
    --th-text-muted: #6c757d;
    --th-card-bg: rgba(255, 255, 255, 0.92);
    --th-card-border: rgba(255, 255, 255, 0.8);
    --th-card-shadow: 0 4px 20px rgba(26, 46, 26, 0.06);
    --th-gold: #8b6914;
    --th-gold-bg: linear-gradient(145deg, #ffe8a3, #f5c842);
    --th-icon-size: 3.5rem;
}

.th-layout {
    background: var(--th-bg-gradient);
    min-height: 100vh;
}

.th-navbar {
    background: linear-gradient(180deg, #1a2e1a 0%, #243b24 100%) !important;
    box-shadow: 0 2px 12px rgba(26, 46, 26, 0.15);
}

.th-navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.th-navbar .nav-link.active {
    color: #f5c842 !important;
}

.th-main {
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

.th-page {
    width: 100%;
}

.th-page--narrow {
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

/* Square icon blocks — page headers, auth, cards, empty states */
.th-icon-block,
.th-page-header__icon,
.th-stat-card__icon,
.th-auth-card__logo,
.share-page__logo,
.share-card__icon {
    flex-shrink: 0;
    width: var(--th-icon-size);
    height: var(--th-icon-size);
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.th-icon-block--compass,
.th-page-header__icon--compass,
.th-page-header__icon--gold,
.th-auth-card__logo--compass {
    color: var(--th-gold);
    background: var(--th-gold-bg);
    box-shadow: 0 6px 18px rgba(181, 137, 26, 0.2);
}

.th-icon-block--map,
.th-page-header__icon--map,
.share-card__icon--map {
    color: #0d6efd;
    background: linear-gradient(145deg, #e7f1ff, #cfe2ff);
}

.th-icon-block--archive,
.th-page-header__icon--archive {
    color: #495057;
    background: linear-gradient(145deg, #f1f3f5, #dee2e6);
}

.th-icon-block--events,
.th-page-header__icon--events,
.th-stat-card__icon--events {
    color: #0d6efd;
    background: linear-gradient(145deg, #e7f1ff, #cfe2ff);
}

.th-icon-block--users,
.th-page-header__icon--users,
.th-stat-card__icon--users {
    color: #0dcaf0;
    background: linear-gradient(145deg, #e7f9fc, #cff4fc);
}

.th-icon-block--teams,
.th-page-header__icon--teams {
    color: #198754;
    background: linear-gradient(145deg, #e8f5ec, #d1e7dd);
}

.th-icon-block--dashboard,
.th-page-header__icon--dashboard {
    color: #6f42c1;
    background: linear-gradient(145deg, #f3ebff, #e2d4f7);
}

.th-icon-block--verses,
.share-card__icon--verses {
    color: #6f42c1;
    background: linear-gradient(145deg, #f3ebff, #e2d4f7);
}

.th-icon-block--note,
.share-card__icon--note {
    color: #198754;
    background: linear-gradient(145deg, #e8f5ec, #d1e7dd);
}

.th-icon-block--muted {
    color: #868e96;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
}

.th-page-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
    animation: th-fade-in 0.4s ease-out;
}

.th-page-header--split {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.th-page-header__main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.th-page-header__body {
    flex: 1;
    min-width: 0;
}

.th-page-header__title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--th-title-color);
    margin-bottom: 0.25rem;
}

.th-page-header__subtitle {
    color: var(--th-text-muted);
    margin-bottom: 0;
    font-size: 0.95rem;
}

.th-page-header__actions {
    flex-shrink: 0;
}

.th-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--th-title-color);
    margin-bottom: 0.25rem;
}

.th-section-lead {
    color: var(--th-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card.th-card,
.th-card {
    background: var(--th-card-bg);
    border: 1px solid var(--th-card-border);
    border-radius: 1rem;
    box-shadow: var(--th-card-shadow);
    backdrop-filter: blur(6px);
}

.card.th-card > .card-header,
.th-card > .card-header {
    background: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-weight: 600;
    font-size: 1rem;
}

.th-info-panel {
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.85rem;
    color: #495057;
    font-size: 0.95rem;
}

.th-empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.th-empty-state .th-icon-block {
    margin: 0 auto 1rem;
}

.th-stat-card {
    background: var(--th-card-bg);
    border: 1px solid var(--th-card-border);
    border-radius: 1rem;
    box-shadow: var(--th-card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.th-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(26, 46, 26, 0.1);
}

.th-stat-card__icon {
    margin: 0 auto 1rem;
}

.th-auth-card {
    background: var(--th-card-bg);
    border: 1px solid var(--th-card-border);
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(26, 46, 26, 0.08);
    backdrop-filter: blur(8px);
    overflow: hidden;
    animation: th-fade-in 0.45s ease-out;
}

.th-auth-card__header {
    text-align: center;
    padding: 1.75rem 1.5rem 0.5rem;
}

.th-auth-card__logo {
    margin: 0 auto 0.75rem;
}

.th-auth-card__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--th-title-color);
    margin-bottom: 0.35rem;
}

.th-auth-card__subtitle {
    color: var(--th-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.th-auth-card__body {
    padding: 0.75rem 1.5rem 1.5rem;
}

.th-auth-card__footer {
    padding: 0 1.5rem 1.25rem;
}

.th-auth-choice {
    border-radius: 0.85rem !important;
    border-width: 1px;
}

.th-auth-card--welcome .th-auth-card__header {
    padding-bottom: 0.25rem;
}

.th-auth-card--welcome .th-auth-card__logo {
    width: 4.25rem;
    height: 4.25rem;
    font-size: 1.85rem;
}

.th-auth-card--welcome .th-auth-card__title {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.th-auth-card--welcome .th-auth-card__subtitle {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.th-welcome-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    padding: 0.5rem 1.5rem 0.25rem;
}

.th-welcome-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.85rem 0.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.85rem;
}

.th-welcome-feature__icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
}

.th-welcome-feature__label {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--th-title-color);
}

.th-auth-card--welcome .th-auth-card__body {
    padding-top: 1rem;
}

@media (max-width: 380px) {
    .th-welcome-features {
        grid-template-columns: 1fr;
    }

    .th-welcome-feature {
        flex-direction: row;
        text-align: left;
        padding: 0.75rem 0.85rem;
    }
}

.th-back-link {
    color: var(--th-text-muted);
    font-size: 0.875rem;
    text-decoration: none;
}

.th-back-link:hover {
    color: var(--th-title-color);
}

@keyframes th-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Share page (standalone layout) ─────────────────────────────────────── */

.share-layout {
    background: var(--th-bg-gradient);
    min-height: 100vh;
}

.share-page__header {
    animation: th-fade-in 0.5s ease-out;
}

.share-page__logo {
    margin: 0 auto 1rem;
}

.share-page__title {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--th-title-color);
}

.share-page__subtitle {
    color: var(--th-text-muted);
    font-size: 0.95rem;
}

.share-page__stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: th-fade-in 0.6s ease-out 0.1s both;
}

.share-card {
    display: flex;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    background: var(--th-card-bg);
    border: 1px solid var(--th-card-border);
    border-radius: 1rem;
    box-shadow: var(--th-card-shadow);
    backdrop-filter: blur(6px);
}

.share-card__body {
    flex: 1;
    min-width: 0;
}

.share-card__body--wide {
    flex: 1;
}

.share-card__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #868e96;
    margin-bottom: 0;
}

.share-card__type {
    background: #0d6efd !important;
    font-weight: 600;
    font-size: 0.75rem;
}

.share-card__lead {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
    color: #212529;
}

.share-card__meta {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
}

.share-card__note {
    font-size: 1rem;
    line-height: 1.65;
    color: #343a40;
}

.share-verse {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.share-verse:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.share-verse__ref {
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 0.35rem;
}

.share-verse__text {
    font-size: 0.95rem;
    color: #212529;
}

.share-verse__bible {
    background: #e9ecef !important;
    color: #495057 !important;
    font-weight: 500;
    font-size: 0.7rem;
}

.share-page__footer {
    margin-top: 0.5rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 1rem;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.share-page__qr {
    border-radius: 0.35rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.share-page__qr-label {
    font-size: 0.85rem;
    color: #6c757d;
}