@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
    --bg: #f3f6fb;
    --bg-strong: #edf2fb;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-strong: rgba(255, 255, 255, 0.94);
    --surface-muted: rgba(246, 248, 252, 0.88);
    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.14);
    --text: #101828;
    --muted: #667085;
    --blue: #0a84ff;
    --blue-deep: #0066d6;
    --blue-soft: rgba(10, 132, 255, 0.12);
    --green: #30d158;
    --red: #ff453a;
    --red-soft: rgba(255, 69, 58, 0.12);
    --gray-bubble: #edf1f7;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.07);
    --radius-xl: 34px;
    --radius-lg: 26px;
    --radius-md: 20px;
    --radius-sm: 16px;
    --font-ui: "Manrope", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family: var(--font-ui);
    font-feature-settings: "ss01" 1, "cv01" 1;
    background:
        radial-gradient(circle at top left, rgba(10, 132, 255, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(48, 209, 88, 0.12), transparent 24%),
        linear-gradient(180deg, #fbfdff 0%, var(--bg) 46%, #edf2fb 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 72%);
}

a {
    color: inherit;
    text-decoration: none;
}

img,
audio,
video {
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
}

:focus-visible {
    outline: 3px solid rgba(10, 132, 255, 0.22);
    outline-offset: 2px;
}

.page-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.backdrop {
    position: fixed;
    width: 32rem;
    height: 32rem;
    border-radius: 50%;
    filter: blur(42px);
    opacity: 0.9;
    pointer-events: none;
    z-index: 0;
}

.backdrop-one {
    top: -12rem;
    left: -10rem;
    background: rgba(10, 132, 255, 0.16);
}

.backdrop-two {
    right: -12rem;
    bottom: -14rem;
    background: rgba(48, 209, 88, 0.12);
}

.site-header,
.container,
.site-footer {
    position: relative;
    z-index: 1;
}

.site-header {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.2rem 1.25rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand,
.site-nav,
.site-nav form {
    display: inline-flex;
    align-items: center;
}

.brand {
    gap: 0.95rem;
    padding: 0.65rem 0.8rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px);
}

.brand strong {
    display: block;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.brand-mark {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.82), transparent 38%),
        linear-gradient(135deg, #31a3ff 0%, #007aff 54%, #0061d0 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 0 12px 28px rgba(10, 132, 255, 0.3);
}

.site-nav {
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 0.4rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px);
}

.site-nav a,
.link-button {
    padding: 0.75rem 1rem;
    max-width: 100%;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    white-space: normal;
}

.site-nav a,
.link-button,
.button,
.pill,
.status-badge,
.eyebrow,
.tiny-label,
.field span,
.list-row strong,
.book-kicker,
.guest-badge {
    font-family: var(--font-ui);
}

.site-nav a:hover,
.link-button:hover {
    background: rgba(15, 23, 42, 0.05);
}

.link-button {
    background: transparent;
    cursor: pointer;
}

.guest-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    color: var(--blue-deep);
    font-size: 0.94rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1.6rem 1.25rem 4rem;
}

.site-footer {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 1.25rem 2rem;
    color: var(--muted);
    font-size: 0.94rem;
}

.hero-panel,
.panel {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    animation: card-enter 0.55s ease both;
}

.panel:not(.event-card):not(.message-mode):not(.guest-intro-card):not(.empty-state) {
    padding: 1.25rem;
}

.hero-panel::before,
.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95), transparent);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 1.5rem;
    padding: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 1.5rem;
}

.hero-panel.compact {
    grid-template-columns: minmax(0, 1.1fr) auto;
    align-items: center;
}

.hero-copy,
.panel > * {
    position: relative;
    z-index: 1;
}

.hero-panel,
.panel,
.feature-card,
.event-card,
.note-card,
.guest-intro-card,
.stat-card,
.message-bubble,
.recorder-box,
.list-row,
.plain-card,
.book-page,
.book-chat-row,
.book-chat-bubble,
.book-thread,
.book-thread-bubble,
.book-video-card,
.book-photo-card {
    min-width: 0;
}

.hero-panel > *,
.panel > *,
.feature-card > *,
.event-card > *,
.note-card > *,
.guest-intro-card > *,
.stat-card > *,
.message-bubble > *,
.recorder-box > *,
.list-row > *,
.plain-card > *,
.book-page > *,
.book-chat-row > *,
.book-chat-bubble > *,
.book-thread > *,
.book-thread-bubble > *,
.book-video-card > *,
.book-photo-card > *,
.event-card-head > *,
.message-head > *,
.section-heading > *,
.book-page-head > *,
.book-thread-head > *,
.book-photo-meta > *,
.book-video-meta > *,
.book-page-footer > * {
    min-width: 0;
}

.hero-copy h1,
.section-heading h1,
.section-heading h2,
.feature-card h2,
.note-card h2,
.event-card h2,
.message-card h3,
.guest-intro-card h2,
.book-cover-art h2,
.book-page-head h2,
.book-thread-head h3,
.book-photo-meta h3,
.book-video-meta h3,
.home-book-cover h2 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.04;
    font-optical-sizing: auto;
}

.hero-copy h1 {
    max-width: 11ch;
    font-size: clamp(1.55rem, 2.3vw, 2.15rem);
}

.lead,
.hero-copy p,
.panel p,
.steps,
.prose {
    color: var(--muted);
    line-height: 1.72;
}

.hero-copy h1,
.section-heading h1,
.section-heading h2,
.feature-card h2,
.note-card h2,
.event-card h2,
.message-card h3,
.guest-intro-card h2,
.book-cover-art h2,
.book-page-head h2,
.book-thread-head h3,
.book-photo-meta h3,
.book-video-meta h3,
.home-book-cover h2,
.lead,
.hero-copy p,
.panel p,
.steps,
.prose,
.muted,
.list-row,
.data-table th,
.data-table td,
.book-page-footer span {
    overflow-wrap: anywhere;
}

.eyebrow,
.tiny-label {
    margin: 0 0 0.55rem;
    color: var(--blue-deep);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tiny-label {
    margin-bottom: 0.35rem;
}

.actions,
.actions-right {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.actions-right {
    justify-content: flex-end;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    max-width: 100%;
    padding: 0.95rem 1.35rem;
    border-radius: 999px;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.compact {
    min-height: 40px;
    padding: 0.75rem 1rem;
}

.button-primary {
    color: #ffffff;
    background: linear-gradient(180deg, #31a3ff 0%, #0a84ff 50%, #0066d6 100%);
    box-shadow: 0 16px 36px rgba(10, 132, 255, 0.28);
}

.button-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.pill-row,
.mini-stats {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.pill,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 100%;
    padding: 0.48rem 0.88rem;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    overflow-wrap: anywhere;
    white-space: normal;
}

.pill {
    color: var(--blue-deep);
    background: rgba(10, 132, 255, 0.08);
    border: 1px solid rgba(10, 132, 255, 0.1);
}

.status-badge.is-open {
    color: #12793a;
    background: rgba(48, 209, 88, 0.14);
}

.status-badge.is-pending {
    color: #9a6700;
    background: rgba(255, 159, 10, 0.16);
}

.status-badge.is-expired,
.status-badge.is-rejected,
.status-badge.is-closed {
    color: #c33228;
    background: rgba(255, 69, 58, 0.12);
}

.phone-preview,
.hero-card,
.feature-card,
.note-card,
.guest-intro-card,
.stat-card,
.message-bubble,
.event-card,
.recorder-box,
.list-row,
.plain-card {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.phone-preview,
.hero-card,
.feature-card,
.note-card,
.guest-intro-card,
.stat-card,
.event-card,
.recorder-box,
.list-row,
.plain-card {
    border-radius: calc(var(--radius-xl) - 8px);
}

.phone-preview,
.hero-card,
.feature-card,
.note-card,
.guest-intro-card {
    padding: 1.35rem;
}

.phone-preview {
    display: grid;
    place-items: center;
}

.phone-frame {
    width: min(100%, 360px);
    padding: 12px;
    border-radius: 42px;
    background:
        linear-gradient(180deg, rgba(20, 20, 20, 0.98), rgba(55, 55, 55, 0.96));
    box-shadow:
        0 28px 60px rgba(15, 23, 42, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.phone-screen {
    min-height: 580px;
    padding: 1rem 0.95rem 0.95rem;
    border-radius: 32px;
    background:
        linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(240, 244, 250, 0.98));
}

.phone-notch {
    width: 38%;
    height: 30px;
    margin: 0 auto 0.85rem;
    border-radius: 999px;
    background: #090909;
}

.phone-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0 0.35rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.phone-topbar strong {
    color: var(--text);
}

.chat-stack {
    display: grid;
    gap: 0.7rem;
}

.compact-chat {
    margin-top: 1rem;
}

.chat-row {
    display: flex;
}

.chat-row.incoming {
    justify-content: flex-start;
}

.chat-row.outgoing {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 84%;
    padding: 0.82rem 1rem;
    border-radius: 22px;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.chat-bubble.incoming {
    color: var(--text);
    background: var(--gray-bubble);
    border-bottom-left-radius: 10px;
}

.chat-bubble.outgoing {
    color: #ffffff;
    background: linear-gradient(180deg, #31a3ff, #0a84ff 60%, #0066d6);
    border-bottom-right-radius: 10px;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: var(--muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.inline-input-bar {
    margin-top: 0;
}

.send-dot {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: linear-gradient(180deg, #31a3ff, #007aff);
    box-shadow: 0 10px 20px rgba(10, 132, 255, 0.24);
}

.book-kicker {
    margin: 0;
    color: #8b6c42;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.home-book-teaser {
    display: grid;
    align-items: center;
}

.home-book-frame {
    width: min(100%, 760px);
    justify-self: end;
    padding: 1rem;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.12);
}

.home-book-surface {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1rem;
    min-height: 360px;
    padding: 1rem 1rem 1rem 1.8rem;
    border-radius: 28px;
    background: linear-gradient(135deg, #8c5e42 0%, #a67752 18%, #bb8b5f 22%, #e7d6b3 22.5%, #f5ecd8 100%);
    border: 1px solid rgba(104, 71, 39, 0.16);
    overflow: hidden;
}

.home-book-surface::before {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

.home-book-spine {
    position: absolute;
    top: 1rem;
    bottom: 1rem;
    left: 0.9rem;
    width: 22px;
    border-radius: 18px;
    background: linear-gradient(180deg, #6d432a 0%, #8c6243 26%, #5b341f 100%);
    box-shadow:
        inset 1px 0 0 rgba(255, 255, 255, 0.2),
        inset -5px 0 10px rgba(41, 24, 10, 0.28),
        10px 0 18px rgba(65, 46, 24, 0.16);
}

.home-book-page {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    min-height: 0;
    padding: 1rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(251, 248, 241, 0.98), rgba(244, 236, 221, 0.96));
    border: 1px solid rgba(124, 95, 54, 0.14);
    box-shadow:
        0 18px 34px rgba(64, 45, 22, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.home-book-cover h2 {
    margin: 0;
    color: #24190d;
    font-size: clamp(1.75rem, 2.4vw, 2.7rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.home-book-subtitle {
    margin: -0.35rem 0 0;
    color: #715b3f;
    font-size: 1rem;
    line-height: 1.5;
}

.home-book-cover .pill {
    color: #654a28;
    background: rgba(255, 255, 255, 0.66);
    border: 1px solid rgba(124, 95, 54, 0.14);
}

.home-book-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-top: auto;
}

.home-book-stats div {
    padding: 0.85rem 0.9rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(124, 95, 54, 0.12);
}

.home-book-stats strong {
    display: block;
    margin-bottom: 0.15rem;
    color: #24190d;
    font-size: 1.45rem;
    letter-spacing: -0.04em;
}

.home-book-stats span {
    color: #7c6c55;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-book-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.85rem;
    color: #7f6e57;
    font-size: 0.88rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(124, 95, 54, 0.14);
}

.home-book-bubbles {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 0;
    justify-content: center;
}

.home-book-message {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: min(100%, 17rem);
}

.home-book-message.incoming {
    align-self: flex-start;
}

.home-book-message.outgoing {
    align-self: flex-end;
}

.home-book-name {
    color: #7f6e57;
    font-size: 0.82rem;
    font-weight: 700;
}

.home-book-bubble {
    position: relative;
    padding: 0.82rem 0.95rem;
    border-radius: 22px 22px 22px 10px;
    color: #ffffff;
    font-size: 0.93rem;
    line-height: 1.5;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.home-book-bubble.incoming {
    background: linear-gradient(180deg, #49d17d, #34c759 60%, #28a745);
}

.home-book-bubble.outgoing {
    border-radius: 22px 22px 10px 22px;
    background: linear-gradient(180deg, #31a3ff, #0a84ff 58%, #0066d6);
}

.steps {
    margin: 1rem 0 0;
    padding-left: 1.2rem;
}

.grid-three,
.cards-grid,
.stats-grid,
.grid-two {
    display: grid;
    gap: 1.25rem;
}

.grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.cards-grid-events {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    align-items: start;
}

.grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.feature-card h2,
.note-card h2,
.event-card h2,
.section-heading h1,
.section-heading h2 {
    font-size: clamp(1.2rem, 1.7vw, 1.55rem);
}

.event-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
    padding: 1.25rem;
    background:
        radial-gradient(circle at top right, rgba(10, 132, 255, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 253, 0.96));
}

.event-card::after {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(10, 132, 255, 0.95), rgba(48, 209, 88, 0.78));
}

.event-card-top,
.event-card-head,
.message-head,
.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.event-card-titleblock {
    min-width: 0;
    display: flex;
    flex: 1 1 260px;
    flex-direction: column;
    gap: 0.45rem;
}

.event-card-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.event-card-badges {
    justify-content: flex-end;
    align-self: flex-start;
}

.event-card h2 {
    margin: 0;
    line-height: 1.06;
}

.event-card-summary {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.event-card-summary a {
    color: #14478f;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.event-card-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.event-card-meta {
    min-width: 0;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 246, 252, 0.94));
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.event-card-meta strong {
    display: block;
    margin-top: 0.28rem;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere;
}

.event-card-meta small {
    display: block;
    margin-top: 0.32rem;
    color: var(--muted);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.event-card-meta-code strong {
    color: #11478d;
    font-size: 1.3rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.event-card-foot {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.event-card-stats {
    flex: 1 1 240px;
}

.event-card-stats span {
    padding: 0.68rem 0.88rem;
    border-radius: 999px;
    color: #184c95;
    font-weight: 700;
    background: rgba(10, 132, 255, 0.08);
    border: 1px solid rgba(10, 132, 255, 0.08);
}

.event-card-actions {
    flex: 1 1 280px;
    justify-content: flex-end;
}

.event-card-actions .button {
    white-space: normal;
}

.event-card-compact {
    gap: 0.95rem;
}

.event-card-quickfacts {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.event-card-quickfacts span {
    padding: 0.5rem 0.78rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.4;
    background: rgba(244, 248, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.event-card-compact .event-card-foot {
    justify-content: flex-end;
}

.event-page-quickfacts {
    margin-top: 0.1rem;
}

.section-heading {
    align-items: end;
    margin-bottom: 1rem;
}

.section-heading.tight {
    margin-bottom: 1.15rem;
}

.muted {
    color: var(--muted);
}

.link-box {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(244, 248, 255, 0.95), rgba(238, 243, 251, 0.96));
    border: 1px solid rgba(10, 132, 255, 0.08);
}

.event-reference-code {
    display: block;
    margin: 0.15rem 0 0.2rem;
    color: #14478f;
    font-size: clamp(1.6rem, 3vw, 2.15rem);
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.link-box small {
    display: block;
    color: var(--muted);
    line-height: 1.5;
}

.link-box code {
    display: block;
    font-size: 0.92rem;
    color: #14478f;
    overflow-wrap: anywhere;
}

.form-shell {
    max-width: 920px;
}

.form-shell.narrow {
    max-width: 680px;
}

.form-panel,
.stacked,
.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
}

.welcome-message-display {
    padding: 1rem 1.1rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.welcome-message-display .prose {
    margin: 0;
}

.welcome-editor {
    display: grid;
    gap: 1rem;
}

.welcome-editor summary {
    list-style: none;
    width: fit-content;
}

.welcome-editor summary::-webkit-details-marker {
    display: none;
}

.welcome-editor[open] summary {
    margin-bottom: 0.15rem;
}

.event-hero-panel .hero-copy {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.event-hero-pills {
    margin: 0;
}

.event-hero-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.event-page-intro {
    margin: 0;
}

.event-page-layout {
    align-items: start;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.link-box-prominent code {
    margin-top: 0.55rem;
}

.event-share-card .qr-layout {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 1rem;
}

.event-share-card .qr-image {
    max-width: 160px;
    padding: 0.75rem;
    border-radius: 24px;
}

.event-share-card .actions {
    justify-content: flex-start;
}

.event-inline-note {
    padding: 0.95rem 1rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(244, 248, 255, 0.96), rgba(238, 243, 251, 0.96));
    border: 1px solid rgba(10, 132, 255, 0.08);
}

.event-inline-note strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 800;
}

.event-inline-note p {
    margin: 0;
}

.event-inline-note.is-warning {
    background: rgba(255, 249, 241, 0.98);
    border-color: rgba(255, 159, 10, 0.22);
}

.event-book-overview {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.event-book-current {
    flex: 1 1 320px;
}

.event-book-current strong {
    display: block;
    margin-top: 0.3rem;
    color: var(--text);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
}

.event-book-current p {
    margin: 0.35rem 0 0;
}

.event-book-actions {
    justify-content: flex-end;
}

.event-stats-grid {
    margin-top: 0.25rem;
}

.event-config-card {
    padding: 1rem 1.05rem;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(244, 248, 255, 0.8), rgba(238, 243, 251, 0.84));
    border: 1px solid rgba(10, 132, 255, 0.08);
}

.inline-editor {
    display: grid;
    gap: 1rem;
}

.inline-editor summary {
    list-style: none;
    width: fit-content;
}

.inline-editor summary::-webkit-details-marker {
    display: none;
}

.inline-editor[open] summary {
    margin-bottom: 0.15rem;
}

.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field span {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 0.98rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: rgba(10, 132, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.12);
    outline: none;
}

.field textarea {
    min-height: 7rem;
    resize: vertical;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
}

.checkbox-row input {
    width: 1.05rem;
    height: 1.05rem;
}

.file-field input {
    padding: 0.4rem 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.native-upload-field {
    padding: 1rem 1.05rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.native-file-control {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    font-size: 16px;
    color: var(--text);
    appearance: auto;
    -webkit-appearance: auto;
}

.upload-form-card {
    padding: 0;
}

.file-field small,
.stat-card small {
    color: var(--muted);
}

.alert {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 22px;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.alert-success {
    color: #12793a;
    background: rgba(48, 209, 88, 0.12);
    border: 1px solid rgba(48, 209, 88, 0.2);
}

.alert-error {
    color: #b42318;
    background: rgba(255, 69, 58, 0.12);
    border: 1px solid rgba(255, 69, 58, 0.18);
}

.empty-state {
    text-align: center;
    padding: 2rem;
}

.qr-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
}

.qr-image {
    width: 100%;
    max-width: 220px;
    padding: 0.9rem;
    border-radius: 30px;
    background: #ffffff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
}

.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stats-grid-wide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.15rem;
}

.stat-card strong {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.05em;
}

.messages-list {
    display: grid;
    gap: 1rem;
}

.message-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.message-avatar {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.8), transparent 34%),
        linear-gradient(180deg, #31a3ff, #0a84ff 60%, #0066d6);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 16px 28px rgba(10, 132, 255, 0.22);
}

.message-bubble {
    position: relative;
    padding: 1rem 1.1rem;
    border-radius: 28px 28px 28px 12px;
}

.message-bubble::before {
    content: "";
    position: absolute;
    left: -8px;
    bottom: 10px;
    width: 18px;
    height: 18px;
    border-radius: 0 0 14px 0;
    background: inherit;
    border-left: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    transform: rotate(28deg);
}

.message-card[data-message-type="text"] .message-bubble {
    color: #ffffff;
    background: linear-gradient(180deg, #31a3ff, #0a84ff 62%, #0066d6);
    border: 0;
}

.message-card[data-message-type="text"] .message-bubble h3,
.message-card[data-message-type="text"] .message-bubble .prose,
.message-card[data-message-type="text"] .message-bubble .muted,
.message-card[data-message-type="text"] .message-bubble a {
    color: #ffffff;
}

.message-card[data-message-type="text"] .message-bubble .muted {
    color: rgba(255, 255, 255, 0.8);
}

.message-card[data-message-type="text"] .pill {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.message-head {
    align-items: start;
    margin-bottom: 0.8rem;
}

.message-head h3 {
    margin-top: 0.4rem;
    font-size: 1.1rem;
}

.message-bubble audio,
.message-bubble video,
.message-bubble img {
    width: 100%;
    margin-top: 0.4rem;
    border-radius: 22px;
}

.message-bubble audio,
.message-bubble video {
    background: #0f172a;
}

.message-bubble img {
    display: block;
    max-height: min(68vh, 540px);
    object-fit: cover;
    background: rgba(255, 255, 255, 0.72);
}

.message-mode {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}

.message-mode .section-heading {
    align-items: start;
}

.message-mode .section-heading h2 {
    font-size: 1.55rem;
}

.split-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 1.2rem;
}

.recorder-box {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    background:
        linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(237, 243, 251, 0.98));
}

.recorder-box.is-recording {
    border-radius: 24px;
    border: 1px solid rgba(10, 132, 255, 0.16);
    box-shadow:
        0 18px 32px rgba(10, 132, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.recording-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    width: fit-content;
    max-width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 999px;
    color: #9b1c1c;
    font-weight: 700;
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.12);
}

.recording-label {
    color: var(--text);
    font-size: 0.95rem;
}

.recording-dot {
    width: 0.8rem;
    height: 0.8rem;
    flex: none;
    border-radius: 50%;
    background: #ff453a;
    box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.35);
    animation: recording-pulse 1.25s ease infinite;
}

.recording-wave {
    display: inline-flex;
    align-items: end;
    gap: 0.24rem;
    min-height: 1.8rem;
}

.recording-wave span {
    width: 0.28rem;
    height: 0.8rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #31a3ff 0%, #0a84ff 58%, #0066d6 100%);
    animation: recording-wave 1s ease-in-out infinite;
    transform-origin: center bottom;
}

.recording-wave span:nth-child(2) {
    animation-delay: 0.1s;
}

.recording-wave span:nth-child(3) {
    animation-delay: 0.22s;
}

.recording-wave span:nth-child(4) {
    animation-delay: 0.34s;
}

.recording-wave span:nth-child(5) {
    animation-delay: 0.46s;
}

.recorder-box [data-preview] {
    width: 100%;
    border-radius: 24px;
    background: #0f172a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.recorder-box video[data-preview] {
    min-height: 260px;
    object-fit: cover;
}

.recorder-box video[data-preview][data-preview-state="live"] {
    transform: scaleX(-1);
}

@keyframes recording-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.38);
        transform: scale(0.95);
    }

    70% {
        box-shadow: 0 0 0 12px rgba(255, 69, 58, 0);
        transform: scale(1);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 69, 58, 0);
        transform: scale(0.95);
    }
}

@keyframes recording-wave {
    0%,
    100% {
        transform: scaleY(0.5);
        opacity: 0.6;
    }

    50% {
        transform: scaleY(1.35);
        opacity: 1;
    }
}

.plain-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.plain-card {
    max-width: 600px;
    padding: 2rem;
}

.filters-bar {
    display: flex;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 220px auto auto;
}

.filters-grid-large {
    grid-template-columns: minmax(0, 2fr) 180px 180px 180px auto auto;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem 0.85rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--blue-deep);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
}

.admin-area .hero-panel,
.admin-area .panel {
    background: rgba(255, 255, 255, 0.82);
}

.admin-area .brand-mark {
    background:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.82), transparent 34%),
        linear-gradient(180deg, #88a9ff 0%, #5377ff 56%, #3559e7 100%);
}

.public-area .home-hero {
    grid-template-columns: minmax(0, 0.86fr) minmax(540px, 1.14fr);
    align-items: center;
    min-height: 500px;
}

.guest-area .site-header {
    max-width: 760px;
    padding-top: calc(env(safe-area-inset-top) + 0.9rem);
}

.guest-area .site-nav {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.guest-area .brand {
    padding-inline: 1rem;
}

.guest-area .brand small {
    display: none;
}

.guest-area .container {
    max-width: 760px;
    padding-top: 1rem;
    padding-bottom: calc(4rem + env(safe-area-inset-bottom));
}

.guest-area .hero-panel:first-child {
    min-height: 0;
}

.guest-area .hero-panel,
.guest-area .hero-panel.compact {
    grid-template-columns: 1fr;
}

.guest-area .hero-copy h1 {
    max-width: none;
    font-size: clamp(2.2rem, 8vw, 3.4rem);
}

.guest-area .actions-right {
    justify-content: flex-start;
}

.guest-area .button {
    min-height: 54px;
}

.guest-area .button.compact {
    min-height: 48px;
}

.guest-area .field input,
.guest-area .field textarea,
.guest-area .field select {
    font-size: 16px;
}

.guest-area .field textarea {
    min-height: 8rem;
}

.guest-shell .hero-panel {
    align-items: stretch;
}

.guest-meta-row {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin: 0.9rem 0 0.4rem;
}

.guest-composer {
    display: grid;
    gap: 1rem;
}

.guest-composer-bar {
    display: grid;
    gap: 1rem;
}

.guest-composer-summary {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem 1.1rem;
    border-radius: calc(var(--radius-xl) - 8px);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(20px);
}

.guest-composer-summary strong {
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.guest-composer-summary span {
    color: var(--muted);
    line-height: 1.6;
}

.guest-mode-switcher {
    position: sticky;
    top: calc(env(safe-area-inset-top) + 0.75rem);
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.45rem;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(24px);
}

.guest-mode-tab {
    min-height: 50px;
    padding: 0.8rem 0.9rem;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    background: transparent;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.guest-mode-tab.is-active {
    color: #ffffff;
    background: linear-gradient(180deg, #31a3ff 0%, #0a84ff 58%, #0066d6 100%);
    box-shadow: 0 12px 24px rgba(10, 132, 255, 0.24);
}

.guest-mode-panels {
    display: grid;
    gap: 1rem;
}

.guest-mode-panels > .message-mode[hidden] {
    display: none !important;
}

.guest-mobile-tip {
    padding: 0.8rem 0.9rem;
    border-radius: 18px;
    color: var(--blue-deep);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
    background: rgba(10, 132, 255, 0.08);
    border: 1px solid rgba(10, 132, 255, 0.08);
}

.photo-upload-box {
    align-items: start;
}

.photo-preview-shell {
    width: 100%;
    border-radius: 26px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(10, 132, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.photo-preview-shell img {
    display: block;
    width: 100%;
    max-height: min(58vh, 460px);
    object-fit: contain;
    background: linear-gradient(180deg, rgba(247, 250, 255, 0.96), rgba(240, 245, 251, 0.96));
}

.book-hero .hero-copy h1 {
    max-width: none;
}

.book-shell {
    --book-stage-bg: linear-gradient(135deg, #8c5e42 0%, #a67752 18%, #bb8b5f 22%, #e7d6b3 22.5%, #f5ecd8 100%);
    --book-stage-border: rgba(104, 71, 39, 0.18);
    --book-stage-shadow:
        0 34px 80px rgba(65, 46, 24, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    --book-stage-highlight-border: rgba(255, 255, 255, 0.18);
    --book-stage-overlay:
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 35%),
        repeating-linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.04) 0,
            rgba(255, 255, 255, 0.04) 2px,
            transparent 2px,
            transparent 10px
        );
    --book-spine-bg: linear-gradient(180deg, #6d432a 0%, #8c6243 26%, #5b341f 100%);
    --book-spine-shadow:
        inset 1px 0 0 rgba(255, 255, 255, 0.2),
        inset -5px 0 10px rgba(41, 24, 10, 0.28),
        12px 0 22px rgba(65, 46, 24, 0.18);
    --book-page-bg: linear-gradient(180deg, rgba(251, 248, 241, 0.98), rgba(244, 236, 221, 0.96));
    --book-page-border: rgba(124, 95, 54, 0.14);
    --book-page-shadow:
        0 26px 56px rgba(64, 45, 22, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    --book-page-overlay: linear-gradient(90deg, rgba(171, 138, 90, 0.08), transparent 10%, transparent 92%, rgba(126, 93, 45, 0.06));
    --book-page-text: #342515;
    --book-title-color: #24190d;
    --book-subtitle-color: #715b3f;
    --book-muted: #7f6e57;
    --book-chip-bg: rgba(255, 255, 255, 0.66);
    --book-chip-border: rgba(124, 95, 54, 0.14);
    --book-chip-color: #654a28;
    --book-chip-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
    --book-stat-bg: rgba(255, 255, 255, 0.66);
    --book-stat-border: rgba(124, 95, 54, 0.14);
    --book-stat-shadow: 0 10px 20px rgba(84, 63, 37, 0.08);
    --book-stat-label: #7c6c55;
    --book-cover-message-bg: rgba(255, 255, 255, 0.58);
    --book-cover-message-border: rgba(124, 95, 54, 0.14);
    --book-cover-message-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
    --book-cover-message-label: #8b6c42;
    --book-cover-message-text: #584e42;
    --book-divider: rgba(124, 95, 54, 0.16);
    --book-chat-meta: #7f6e57;
    --book-chat-name: #3d2f1c;
    --book-avatar-outgoing-bg:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.84), transparent 34%),
        linear-gradient(180deg, #31a3ff, #0a84ff 60%, #0066d6);
    --book-avatar-outgoing-shadow: 0 14px 28px rgba(10, 132, 255, 0.18);
    --book-avatar-incoming-bg:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.84), transparent 34%),
        linear-gradient(180deg, #49d17d, #34c759 60%, #28a745);
    --book-avatar-incoming-shadow: 0 14px 28px rgba(52, 199, 89, 0.18);
    --book-incoming-bubble-bg: linear-gradient(180deg, #49d17d, #34c759 60%, #28a745);
    --book-incoming-bubble-shadow: 0 16px 30px rgba(52, 199, 89, 0.18);
    --book-outgoing-bubble-bg: linear-gradient(180deg, #31a3ff, #0a84ff 58%, #0066d6);
    --book-outgoing-bubble-shadow: 0 16px 32px rgba(10, 132, 255, 0.2);
    --book-media-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 238, 225, 0.92));
    --book-media-card-border: rgba(124, 95, 54, 0.12);
    --book-media-card-shadow: 0 18px 34px rgba(77, 56, 30, 0.11);
    --book-photo-frame-bg: rgba(255, 255, 255, 0.62);
    --book-media-image-shadow: 0 12px 24px rgba(77, 56, 30, 0.08);
    --book-footer-text: #7f6e57;
    display: grid;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.book-shell[data-book-theme="nuit"] {
    --book-stage-bg: linear-gradient(135deg, #0d1530 0%, #17254a 22%, #243a69 22.5%, #152140 56%, #0b1224 100%);
    --book-stage-border: rgba(154, 177, 228, 0.16);
    --book-stage-shadow:
        0 34px 80px rgba(7, 12, 28, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --book-stage-highlight-border: rgba(255, 255, 255, 0.08);
    --book-stage-overlay:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 35%),
        repeating-linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 2px,
            transparent 2px,
            transparent 10px
        );
    --book-spine-bg: linear-gradient(180deg, #091024 0%, #152140 26%, #060b18 100%);
    --book-spine-shadow:
        inset 1px 0 0 rgba(255, 255, 255, 0.08),
        inset -5px 0 10px rgba(0, 0, 0, 0.28),
        12px 0 22px rgba(5, 10, 25, 0.24);
    --book-page-bg: linear-gradient(180deg, rgba(23, 33, 61, 0.98), rgba(12, 18, 34, 0.97));
    --book-page-border: rgba(207, 220, 247, 0.1);
    --book-page-shadow:
        0 26px 56px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --book-page-overlay: linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent 12%, transparent 90%, rgba(255, 225, 169, 0.05));
    --book-page-text: #eef3fb;
    --book-title-color: #f8f3e9;
    --book-subtitle-color: #c8d3ea;
    --book-muted: #b7c4dc;
    --book-chip-bg: rgba(255, 255, 255, 0.08);
    --book-chip-border: rgba(255, 255, 255, 0.1);
    --book-chip-color: #f7e3b9;
    --book-chip-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --book-stat-bg: rgba(255, 255, 255, 0.07);
    --book-stat-border: rgba(255, 255, 255, 0.1);
    --book-stat-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    --book-stat-label: #c7d2e8;
    --book-cover-message-bg: rgba(255, 255, 255, 0.07);
    --book-cover-message-border: rgba(255, 255, 255, 0.1);
    --book-cover-message-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --book-cover-message-label: #f2d8a5;
    --book-cover-message-text: #dce6f7;
    --book-divider: rgba(255, 255, 255, 0.1);
    --book-chat-meta: #becce3;
    --book-chat-name: #f6efe2;
    --book-avatar-outgoing-bg:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.84), transparent 34%),
        linear-gradient(180deg, #7ab8ff, #4287ff 60%, #2859d8);
    --book-avatar-outgoing-shadow: 0 14px 28px rgba(66, 135, 255, 0.2);
    --book-avatar-incoming-bg:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.84), transparent 34%),
        linear-gradient(180deg, #61dec0, #33c7a0 60%, #1f9877);
    --book-avatar-incoming-shadow: 0 14px 28px rgba(51, 199, 160, 0.2);
    --book-incoming-bubble-bg: linear-gradient(180deg, #5ed8bb, #33c7a0 60%, #21977b);
    --book-incoming-bubble-shadow: 0 16px 30px rgba(51, 199, 160, 0.2);
    --book-outgoing-bubble-bg: linear-gradient(180deg, #71b8ff, #4287ff 58%, #2859d8);
    --book-outgoing-bubble-shadow: 0 16px 32px rgba(66, 135, 255, 0.22);
    --book-media-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    --book-media-card-border: rgba(255, 255, 255, 0.08);
    --book-media-card-shadow: 0 18px 34px rgba(0, 0, 0, 0.16);
    --book-photo-frame-bg: rgba(255, 255, 255, 0.06);
    --book-media-image-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    --book-footer-text: #becce3;
}

.book-shell[data-book-theme="jardin"] {
    --book-stage-bg: linear-gradient(135deg, #41604b 0%, #608267 18%, #88a97f 22%, #d9dbc0 22.5%, #eef0d9 100%);
    --book-stage-border: rgba(61, 85, 58, 0.18);
    --book-stage-shadow:
        0 34px 80px rgba(44, 62, 41, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    --book-stage-highlight-border: rgba(255, 255, 255, 0.18);
    --book-stage-overlay:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 35%),
        repeating-linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.04) 0,
            rgba(255, 255, 255, 0.04) 2px,
            transparent 2px,
            transparent 10px
        );
    --book-spine-bg: linear-gradient(180deg, #31503e 0%, #486c54 26%, #22392b 100%);
    --book-spine-shadow:
        inset 1px 0 0 rgba(255, 255, 255, 0.18),
        inset -5px 0 10px rgba(21, 38, 25, 0.28),
        12px 0 22px rgba(44, 62, 41, 0.18);
    --book-page-bg: linear-gradient(180deg, rgba(247, 249, 239, 0.98), rgba(233, 239, 224, 0.97));
    --book-page-border: rgba(102, 125, 80, 0.14);
    --book-page-shadow:
        0 26px 56px rgba(50, 67, 46, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.66);
    --book-page-overlay: linear-gradient(90deg, rgba(110, 143, 99, 0.08), transparent 10%, transparent 92%, rgba(126, 141, 97, 0.06));
    --book-page-text: #20301f;
    --book-title-color: #1f2f1f;
    --book-subtitle-color: #5d7558;
    --book-muted: #60705a;
    --book-chip-bg: rgba(255, 255, 255, 0.66);
    --book-chip-border: rgba(102, 125, 80, 0.14);
    --book-chip-color: #48604a;
    --book-chip-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
    --book-stat-bg: rgba(255, 255, 255, 0.7);
    --book-stat-border: rgba(102, 125, 80, 0.12);
    --book-stat-shadow: 0 10px 20px rgba(61, 85, 58, 0.08);
    --book-stat-label: #66785f;
    --book-cover-message-bg: rgba(255, 255, 255, 0.58);
    --book-cover-message-border: rgba(102, 125, 80, 0.14);
    --book-cover-message-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
    --book-cover-message-label: #607655;
    --book-cover-message-text: #4d5d47;
    --book-divider: rgba(102, 125, 80, 0.16);
    --book-chat-meta: #64735d;
    --book-chat-name: #2a3c27;
    --book-avatar-outgoing-bg:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.84), transparent 34%),
        linear-gradient(180deg, #6ebbf5, #3e98de 60%, #256bb9);
    --book-avatar-outgoing-shadow: 0 14px 28px rgba(62, 152, 222, 0.18);
    --book-avatar-incoming-bg:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.84), transparent 34%),
        linear-gradient(180deg, #84d789, #58b96a 60%, #378b49);
    --book-avatar-incoming-shadow: 0 14px 28px rgba(88, 185, 106, 0.18);
    --book-incoming-bubble-bg: linear-gradient(180deg, #84d789, #58b96a 60%, #378b49);
    --book-incoming-bubble-shadow: 0 16px 30px rgba(88, 185, 106, 0.18);
    --book-outgoing-bubble-bg: linear-gradient(180deg, #6ebbf5, #3e98de 58%, #256bb9);
    --book-outgoing-bubble-shadow: 0 16px 32px rgba(62, 152, 222, 0.18);
    --book-media-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(235, 242, 227, 0.94));
    --book-media-card-border: rgba(102, 125, 80, 0.12);
    --book-media-card-shadow: 0 18px 34px rgba(61, 85, 58, 0.11);
    --book-photo-frame-bg: rgba(255, 255, 255, 0.68);
    --book-media-image-shadow: 0 12px 24px rgba(61, 85, 58, 0.08);
    --book-footer-text: #60705a;
}

.book-shell[data-book-theme="rose"] {
    --book-stage-bg: linear-gradient(135deg, #9b6f70 0%, #bd8d8f 18%, #d8b1a5 22%, #edd7cf 22.5%, #fbefe7 100%);
    --book-stage-border: rgba(124, 83, 88, 0.16);
    --book-stage-shadow:
        0 34px 80px rgba(93, 64, 67, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    --book-stage-highlight-border: rgba(255, 255, 255, 0.18);
    --book-stage-overlay:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 35%),
        repeating-linear-gradient(
            120deg,
            rgba(255, 255, 255, 0.04) 0,
            rgba(255, 255, 255, 0.04) 2px,
            transparent 2px,
            transparent 10px
        );
    --book-spine-bg: linear-gradient(180deg, #7a5658 0%, #946d72 26%, #5b3f42 100%);
    --book-spine-shadow:
        inset 1px 0 0 rgba(255, 255, 255, 0.18),
        inset -5px 0 10px rgba(54, 33, 37, 0.28),
        12px 0 22px rgba(93, 64, 67, 0.18);
    --book-page-bg: linear-gradient(180deg, rgba(254, 248, 244, 0.98), rgba(247, 235, 230, 0.97));
    --book-page-border: rgba(144, 101, 104, 0.14);
    --book-page-shadow:
        0 26px 56px rgba(100, 69, 72, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    --book-page-overlay: linear-gradient(90deg, rgba(214, 168, 170, 0.08), transparent 10%, transparent 92%, rgba(182, 140, 141, 0.06));
    --book-page-text: #3e2b2b;
    --book-title-color: #342020;
    --book-subtitle-color: #896769;
    --book-muted: #887072;
    --book-chip-bg: rgba(255, 255, 255, 0.7);
    --book-chip-border: rgba(144, 101, 104, 0.14);
    --book-chip-color: #80585a;
    --book-chip-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
    --book-stat-bg: rgba(255, 255, 255, 0.7);
    --book-stat-border: rgba(144, 101, 104, 0.12);
    --book-stat-shadow: 0 10px 20px rgba(100, 69, 72, 0.08);
    --book-stat-label: #8b7274;
    --book-cover-message-bg: rgba(255, 255, 255, 0.62);
    --book-cover-message-border: rgba(144, 101, 104, 0.14);
    --book-cover-message-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
    --book-cover-message-label: #94696c;
    --book-cover-message-text: #6d5052;
    --book-divider: rgba(144, 101, 104, 0.16);
    --book-chat-meta: #8c7275;
    --book-chat-name: #4b3436;
    --book-avatar-outgoing-bg:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.84), transparent 34%),
        linear-gradient(180deg, #74a5ff, #5478ff 60%, #3e57d6);
    --book-avatar-outgoing-shadow: 0 14px 28px rgba(84, 120, 255, 0.18);
    --book-avatar-incoming-bg:
        radial-gradient(circle at 26% 26%, rgba(255, 255, 255, 0.84), transparent 34%),
        linear-gradient(180deg, #f08caa, #e9678f 60%, #c74a73);
    --book-avatar-incoming-shadow: 0 14px 28px rgba(233, 103, 143, 0.18);
    --book-incoming-bubble-bg: linear-gradient(180deg, #f08caa, #e9678f 60%, #c74a73);
    --book-incoming-bubble-shadow: 0 16px 30px rgba(233, 103, 143, 0.18);
    --book-outgoing-bubble-bg: linear-gradient(180deg, #74a5ff, #5478ff 58%, #3e57d6);
    --book-outgoing-bubble-shadow: 0 16px 32px rgba(84, 120, 255, 0.18);
    --book-media-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(250, 239, 235, 0.95));
    --book-media-card-border: rgba(144, 101, 104, 0.12);
    --book-media-card-shadow: 0 18px 34px rgba(100, 69, 72, 0.1);
    --book-photo-frame-bg: rgba(255, 255, 255, 0.7);
    --book-media-image-shadow: 0 12px 24px rgba(100, 69, 72, 0.08);
    --book-footer-text: #8c7275;
}

.book-stage {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    position: relative;
    height: clamp(580px, 78vh, 860px);
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border-radius: 38px;
    background: var(--book-stage-bg);
    border: 1px solid var(--book-stage-border);
    box-shadow: var(--book-stage-shadow);
    overflow: hidden;
    isolation: isolate;
}

.book-stage::before,
.book-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.book-stage::before {
    inset: 14px;
    border-radius: 30px;
    border: 1px solid var(--book-stage-highlight-border);
}

.book-stage::after {
    background: var(--book-stage-overlay);
    opacity: 0.5;
}

.book-spine {
    position: absolute;
    top: 1.1rem;
    bottom: 1.1rem;
    left: 1rem;
    width: clamp(18px, 2.8vw, 32px);
    border-radius: 20px;
    background: var(--book-spine-bg);
    box-shadow: var(--book-spine-shadow);
}

.book-page {
    display: none;
    grid-area: 1 / 1;
    position: relative;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    min-height: 0;
    margin-left: clamp(1.1rem, 4vw, 3.2rem);
    padding: clamp(1.2rem, 3vw, 1.8rem);
    border-radius: 26px 30px 28px 22px;
    color: var(--book-page-text);
    background: var(--book-page-bg);
    border: 1px solid var(--book-page-border);
    box-shadow: var(--book-page-shadow);
    overflow: hidden;
}

.book-page[hidden] {
    display: none !important;
}

.book-page::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--book-page-overlay);
    pointer-events: none;
}

.book-page.is-active {
    display: flex;
    animation: book-page-enter 0.38s ease both;
}

.book-cover-art,
.book-empty {
    position: relative;
    z-index: 1;
    min-height: 0;
}

.book-page-cover .book-cover-art,
.book-page-collection .book-chat-list,
.book-page-photo .book-thread-media,
.book-page-video .book-thread-media,
.book-page-empty .book-empty {
    flex: 1;
}

.book-cover-art {
    display: grid;
    gap: 1.2rem;
    height: 100%;
    align-content: start;
    overflow: auto;
    padding-right: 0.25rem;
}

.book-cover-art h2,
.book-page-head h2 {
    margin: 0;
    color: var(--book-title-color);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 0.98;
}

.book-cover-art h2 {
    max-width: 10ch;
    font-size: clamp(2.6rem, 6vw, 4.8rem);
}

.book-subtitle {
    margin: -0.15rem 0 0;
    color: var(--book-subtitle-color);
    font-size: 1.15rem;
    line-height: 1.55;
}

.book-cover-meta {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.book-cover-meta span,
.book-page-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    color: var(--book-chip-color);
    font-size: 0.9rem;
    font-weight: 700;
    background: var(--book-chip-bg);
    border: 1px solid var(--book-chip-border);
    box-shadow: var(--book-chip-shadow);
}

.book-cover-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: auto;
}

.book-cover-stats div {
    padding: 1rem;
    border-radius: 22px;
    background: var(--book-stat-bg);
    border: 1px solid var(--book-stat-border);
    box-shadow: var(--book-stat-shadow);
}

.book-cover-stats strong {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.book-cover-stats span {
    color: var(--book-stat-label);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.book-cover-message {
    margin-top: auto;
    padding: 1rem 1.1rem;
    border-radius: 24px;
    background: var(--book-cover-message-bg);
    border: 1px solid var(--book-cover-message-border);
    box-shadow: var(--book-cover-message-shadow);
}

.book-cover-message .tiny-label {
    color: var(--book-cover-message-label);
}

.book-cover-message .prose {
    margin: 0;
    color: var(--book-cover-message-text);
}

.book-page-head,
.book-thread-head,
.book-photo-meta,
.book-video-meta,
.book-page-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.book-page-head {
    position: relative;
    z-index: 1;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--book-divider);
}

.book-page-head h2 {
    font-size: clamp(1.85rem, 4vw, 2.8rem);
}

.book-chat-list {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    min-height: 0;
    overflow: auto;
    padding-right: 0.3rem;
}

.book-chat-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: min(100%, 32rem);
}

.book-chat-row.is-incoming {
    align-self: flex-start;
    align-items: flex-start;
}

.book-chat-row.is-outgoing {
    align-self: flex-end;
    align-items: flex-end;
}

.book-chat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    align-items: baseline;
    color: var(--book-chat-meta);
    font-size: 0.9rem;
}

.book-chat-meta strong {
    color: var(--book-chat-name);
    font-size: 1rem;
    font-weight: 700;
}

.book-chat-bubble {
    position: relative;
    display: grid;
    gap: 0.7rem;
    width: 100%;
    padding: 0.9rem 1rem;
    color: #ffffff;
    border-radius: 24px 24px 24px 12px;
    background: var(--book-incoming-bubble-bg);
    box-shadow: var(--book-incoming-bubble-shadow);
}

.book-chat-bubble::after {
    content: "";
    position: absolute;
    left: -7px;
    bottom: 10px;
    width: 16px;
    height: 16px;
    border-radius: 0 0 12px 0;
    background: inherit;
    transform: rotate(26deg);
}

.book-chat-row.is-outgoing .book-chat-bubble {
    border-radius: 24px 24px 12px 24px;
    background: var(--book-outgoing-bubble-bg);
    box-shadow: var(--book-outgoing-bubble-shadow);
}

.book-chat-row.is-outgoing .book-chat-bubble::after {
    left: auto;
    right: -7px;
    transform: rotate(-24deg);
}

.book-chat-type {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 28px;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.book-chat-text {
    margin: 0;
    color: #ffffff;
    font-size: 1.02rem;
    line-height: 1.6;
}

.book-chat-bubble audio {
    width: 100%;
    margin: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
}

.book-thread {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 0.8rem;
    align-items: end;
}

.book-thread.is-outgoing {
    grid-template-columns: minmax(0, 1fr) 46px;
}

.book-thread.is-outgoing .book-thread-avatar {
    order: 2;
}

.book-thread.is-outgoing .book-thread-bubble {
    justify-self: end;
}

.book-thread-avatar {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--book-avatar-outgoing-bg);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    box-shadow: var(--book-avatar-outgoing-shadow);
}

.book-thread.is-incoming .book-thread-avatar {
    background: var(--book-avatar-incoming-bg);
    box-shadow: var(--book-avatar-incoming-shadow);
}

.book-thread-stack {
    display: grid;
    gap: 0.45rem;
    align-items: start;
    justify-items: start;
    min-width: 0;
}

.book-thread.is-outgoing .book-thread-stack {
    justify-items: end;
}

.book-thread-bubble {
    position: relative;
    width: min(100%, 32rem);
    padding: 0.95rem 1rem;
    border-radius: 24px 24px 24px 12px;
    color: #ffffff;
    background: var(--book-incoming-bubble-bg);
    border: 0;
    box-shadow: var(--book-incoming-bubble-shadow);
}

.book-thread-bubble::after {
    content: "";
    position: absolute;
    left: -7px;
    bottom: 10px;
    width: 16px;
    height: 16px;
    border-radius: 0 0 12px 0;
    background: inherit;
    border-left: inherit;
    border-bottom: inherit;
    transform: rotate(26deg);
}

.book-thread.is-incoming .book-thread-bubble {
    background: var(--book-incoming-bubble-bg);
    box-shadow: var(--book-incoming-bubble-shadow);
}

.book-thread.is-outgoing .book-thread-bubble {
    border-radius: 24px 24px 12px 24px;
    color: #ffffff;
    background: var(--book-outgoing-bubble-bg);
    border: 0;
    box-shadow: var(--book-outgoing-bubble-shadow);
}

.book-thread.is-outgoing .book-thread-bubble::after {
    left: auto;
    right: -7px;
    border-left: 0;
    border-bottom: 0;
    border-right: 0;
    transform: rotate(-24deg);
}

.book-thread-head {
    width: min(100%, 32rem);
    margin-bottom: 0;
}

.book-thread-head h3,
.book-photo-meta h3,
.book-video-meta h3 {
    margin: 0.4rem 0 0;
    font-size: 1.12rem;
    letter-spacing: -0.02em;
}

.book-thread-bubble .prose {
    margin: 0;
    color: #ffffff;
}

.book-thread-bubble audio {
    width: 100%;
    margin-top: 0.3rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
}

.book-thread-bubble .pill {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.84);
}

.book-thread.is-incoming .book-thread-bubble .pill,
.book-thread.is-outgoing .book-thread-bubble .pill {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.18);
}

.book-thread.is-incoming .book-thread-bubble .prose,
.book-thread.is-incoming .book-thread-bubble h3,
.book-thread.is-incoming .book-thread-bubble .muted,
.book-thread.is-incoming .book-thread-bubble a,
.book-thread.is-outgoing .book-thread-bubble .prose,
.book-thread.is-outgoing .book-thread-bubble h3,
.book-thread.is-outgoing .book-thread-bubble .muted,
.book-thread.is-outgoing .book-thread-bubble a {
    color: #ffffff;
}

.book-thread.is-incoming .book-thread-bubble .muted,
.book-thread.is-outgoing .book-thread-bubble .muted {
    color: rgba(255, 255, 255, 0.82);
}

.book-thread-media {
    flex: 1;
    min-height: 0;
    align-items: stretch;
}

.book-thread-media .book-thread-avatar {
    align-self: end;
}

.book-thread-media .book-thread-bubble {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.9rem;
    min-height: 0;
    align-self: stretch;
    width: min(100%, 36rem);
    padding: 0.85rem;
}

.book-video-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1rem;
    min-height: 0;
    height: 100%;
    padding: 1rem;
    border-radius: 26px;
    background: var(--book-media-card-bg);
    border: 1px solid var(--book-media-card-border);
    box-shadow: var(--book-media-card-shadow);
    overflow: hidden;
}

.book-photo-card {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 1rem;
    min-height: 0;
    height: 100%;
    padding: 1rem;
    border-radius: 26px;
    background: var(--book-media-card-bg);
    border: 1px solid var(--book-media-card-border);
    box-shadow: var(--book-media-card-shadow);
    overflow: hidden;
}

.book-thread-media .book-video-card,
.book-thread-media .book-photo-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.book-thread-media .book-photo-meta,
.book-thread-media .book-video-meta {
    padding-inline: 0.1rem;
}

.book-photo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    min-width: 0;
    border-radius: 22px;
    overflow: hidden;
    background: var(--book-photo-frame-bg);
}

.book-photo-card img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 20px;
    box-shadow: var(--book-media-image-shadow);
}

.book-video-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.book-video-card video {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 20px;
    background: transparent;
    box-shadow: none;
}

.book-empty {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.9rem;
    min-height: clamp(360px, 55vh, 560px);
    text-align: center;
}

.book-empty .prose {
    max-width: 34ch;
    margin: 0;
    color: var(--book-subtitle-color);
}

.book-page-footer {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 1rem;
    color: var(--book-footer-text);
    font-size: 0.95rem;
    border-top: 1px solid var(--book-divider);
}

.book-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.1rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.book-progress {
    display: grid;
    gap: 0.7rem;
    justify-items: center;
    min-width: 0;
}

.book-progress strong {
    font-size: 0.98rem;
}

.book-dots {
    display: flex;
    gap: 0.45rem;
    width: 100%;
    overflow-x: auto;
    justify-content: center;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
}

.book-dots::-webkit-scrollbar {
    display: none;
}

.book-dot {
    flex: none;
    width: 0.78rem;
    height: 0.78rem;
    padding: 0;
    border-radius: 999px;
    background: rgba(123, 104, 74, 0.18);
    border: 1px solid rgba(123, 104, 74, 0.16);
    transition:
        width 0.18s ease,
        background-color 0.18s ease,
        transform 0.18s ease;
}

.book-dot:hover {
    transform: translateY(-1px);
}

.book-dot.is-active {
    width: 1.9rem;
    background: linear-gradient(180deg, #31a3ff 0%, #0a84ff 58%, #0066d6 100%);
    border-color: transparent;
    box-shadow: 0 10px 18px rgba(10, 132, 255, 0.24);
}

@keyframes book-page-enter {
    from {
        opacity: 0;
        transform: translateX(24px) rotateY(-6deg) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateX(0) rotateY(0) scale(1);
    }
}

@media (max-width: 920px) {
    .book-stage {
        height: min(74svh, 760px);
    }

    .book-page {
        min-height: 0;
    }

    .book-controls {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 640px) {
    .book-stage {
        padding: 0.85rem;
        border-radius: 30px;
    }

    .book-spine {
        top: 0.85rem;
        bottom: 0.85rem;
        left: 0.8rem;
        width: 18px;
    }

    .book-page {
        gap: 1rem;
        margin-left: 0.65rem;
        padding: 1rem;
        border-radius: 22px 24px 22px 18px;
    }

    .book-cover-art h2 {
        font-size: 2.5rem;
    }

    .book-cover-stats {
        grid-template-columns: 1fr;
    }

    .book-page-head,
    .book-thread-head,
    .book-photo-meta,
    .book-video-meta,
    .book-page-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .book-chat-row {
        width: 100%;
    }

    .book-thread {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .book-thread.is-outgoing {
        grid-template-columns: minmax(0, 1fr) 40px;
    }

    .book-thread-bubble,
    .book-thread-media .book-thread-bubble {
        width: 100%;
    }

}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 1080px) {
    .hero-panel,
    .hero-panel.compact,
    .grid-three,
    .grid-two,
    .field-row,
    .qr-layout,
    .split-panel,
    .filters-grid,
    .filters-grid-large,
    .stats-grid-wide {
        grid-template-columns: 1fr;
    }

    .hero-copy h1 {
        max-width: none;
    }

    .home-book-surface {
        grid-template-columns: 1fr;
        min-height: auto;
    }
}

@media (max-width: 820px) {
    .site-header,
    .site-nav,
    .section-heading,
    .event-card-top,
    .event-card-head,
    .event-card-foot,
    .event-book-overview,
    .message-head,
    .list-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .actions-right {
        justify-content: flex-start;
    }

    .event-card-badges,
    .event-card-actions,
    .event-book-actions {
        justify-content: flex-start;
    }

    .message-card {
        grid-template-columns: 1fr;
    }

    .message-avatar {
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding-top: 1rem;
    }

    .brand,
    .site-nav,
    .panel,
    .hero-panel {
        border-radius: 24px;
    }

    .container {
        padding-top: 1rem;
        padding-bottom: 3rem;
    }

    .hero-panel,
    .panel:not(.event-card):not(.message-mode):not(.guest-intro-card):not(.empty-state),
    .event-card,
    .message-mode {
        padding: 1.2rem;
    }

    .hero-copy h1 {
        font-size: 1.7rem;
    }

    .cards-grid-events,
    .event-card-meta-grid {
        grid-template-columns: 1fr;
    }

    .phone-frame {
        width: 100%;
    }

    .home-book-frame,
    .home-book-page {
        padding: 0.95rem;
    }

    .home-book-surface {
        padding: 0.9rem 0.9rem 0.9rem 1.4rem;
        border-radius: 24px;
    }

    .home-book-spine {
        left: 0.65rem;
        width: 16px;
    }

    .phone-screen {
        min-height: 520px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .site-nav a,
    .link-button,
    .button {
        width: 100%;
    }

    .guest-area .site-header {
        gap: 0.8rem;
        padding-inline: 0.95rem;
    }

    .guest-area .brand,
    .guest-area .site-nav,
    .guest-badge {
        width: 100%;
        justify-content: center;
    }

    .guest-mode-switcher {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        top: calc(env(safe-area-inset-top) + 0.5rem);
        gap: 0.4rem;
        padding: 0.35rem;
        border-radius: 22px;
    }

    .guest-mode-tab {
        min-height: 48px;
        padding-inline: 0.6rem;
        font-size: 0.94rem;
    }

    .guest-area .actions,
    .guest-area .actions-right,
    .guest-area .recorder-box .actions {
        width: 100%;
    }

    .guest-area .actions .button,
    .guest-area .actions-right .button,
    .guest-area .recorder-box .actions .button {
        flex: 1 1 0;
    }

    .guest-area .chat-bubble {
        max-width: 100%;
    }

    .guest-composer-summary {
        border-radius: 22px;
    }
}
