.flow-page {
    min-height: 100vh;
    background: #f5f6f8;
    color: #333;
}

.flow-header {
    padding: 18px 0;
    border-bottom: 1px solid #e8eaee;
    background: #fff;
}

.flow-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.flow-header-inner { min-height: 34px; }

.flow-brand {
    color: var(--brand-red);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.flow-nav { display: flex; align-items: center; gap: 22px; }

.flow-nav a {
    color: #666;
    font-size: 14px;
    text-decoration: none;
}

.flow-nav a:hover,
.flow-nav a:focus-visible { color: var(--brand-red); }

.flow-nav-home { color: var(--brand-red) !important; font-weight: 700; }

.flow-header h1 {
    margin: 0;
    font-size: 22px;
}

.flow-main { padding: 36px 0 72px; }

.flow-card {
    padding: 32px;
    border: 1px solid #e1e4e8;
    border-radius: 12px;
    background: #fff;
    color: #333;
    box-shadow: 0 12px 30px rgba(28, 34, 45, 0.06);
}

.flow-card h2 {
    margin-top: 0;
    color: var(--brand-red);
}

.package-flow-card {
    padding: 34px;
}

.package-flow-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 28px;
    border-bottom: 1px solid #eef0f3;
}

.flow-kicker {
    margin: 0 0 8px;
    color: var(--brand-red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.flow-card h2 {
    margin-bottom: 8px;
    font-size: 32px;
    line-height: 1.2;
}

.flow-lead {
    max-width: 640px;
    margin: 0;
    color: #333;
    line-height: 1.6;
}

.flow_button_secondary {
    min-width: 148px;
    margin-top: 2px;
    color: var(--brand-red);
    background: #fff;
    border: 1px solid var(--brand-red);
    white-space: nowrap;
}

.package-session-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0 28px;
}

.package-session-stat {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-height: 72px;
    padding: 14px 18px;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background: #fff;
    color: #333;
}

.package-session-stat-label {
    display: block;
    margin-right: auto;
    font-size: 14px;
}

.package-session-stat_queue { border-color: rgba(186, 10, 46, 0.35); background: #fff8f9; }
.package-session-stat_wait { background: #fafafa; }

.package-session-stat strong {
    color: var(--brand-red);
    font-size: 23px;
    line-height: 1;
}

.package-session-stat small {
    color: #666;
    font-size: 12px;
}

.package_embed_frame {
    width: 100%;
    min-height: 330px;
    overflow: hidden;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    background: #f7f8fa;
}

.package_embed_blocked {
    display: grid;
    place-items: center;
    min-height: 330px;
    padding: 48px 24px;
    text-align: center;
}

.package_embed_message {
    width: min(100%, 560px);
}

.package_embed_message h3 {
    margin: 0 0 12px;
    color: #333;
    font-size: 26px;
    line-height: 1.25;
}

.package-embed-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    color: #fff;
    background: var(--brand-red);
    font-size: 23px;
    font-weight: 700;
}

.package-embed-actions { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }

.flow_text_link { color: var(--brand-red); font-size: 14px; font-weight: 700; text-decoration: none; }
.flow_text_link:hover, .flow_text_link:focus-visible { text-decoration: underline; }

.package_embed_message p:not(.flow-kicker) {
    margin: 0 0 24px;
    color: #555;
    line-height: 1.7;
}

.book_detail_layout {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.book_detail_cover {
    width: 100%;
    height: auto;
    box-shadow: 0 10px 24px rgba(73, 13, 28, 0.18);
}

.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    color: #777;
    font-size: 14px;
}

.detail-breadcrumb a { color: var(--brand-red); font-weight: 700; text-decoration: none; }

.detail-card { padding: clamp(24px, 4vw, 48px); }
.detail-page .book_detail_layout { grid-template-columns: minmax(220px, 330px) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
.book_detail_cover_wrap { display: flex; justify-content: center; }
.book_detail_cover { border-radius: 8px; }
.book_detail_content h1 { margin: 0 0 14px; color: #333; font-size: clamp(28px, 3vw, 46px); line-height: 1.12; }
.book_detail_description { max-width: 720px; margin: 0 0 22px; color: #555; font-size: 17px; line-height: 1.7; }
.detail-session-note { display: flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 14px 16px; border-left: 4px solid var(--brand-red); border-radius: 4px; color: #555; background: #fff5f7; font-size: 14px; white-space: nowrap; }
.detail-session-note strong, .detail-session-clock { color: var(--brand-red); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.detail-session-divider { color: #d4a6b0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.detail-read-button, .detail-save-button, .detail-queue-button { min-height: 46px; padding: 10px 22px; border: 1px solid var(--brand-red); font-weight: 800; letter-spacing: .03em; cursor: pointer; }
.detail-save-button { color: var(--brand-red); background: #fff; }
.detail-save-button.is-saved { color: #fff; background: #333; border-color: #333; }
.detail-queue-block { max-width: 720px; padding-top: 22px; border-top: 1px solid #ece2e5; }
.detail-queue-block p { margin: 0 0 14px; color: #555; line-height: 1.6; }
.detail-queue-button { color: #fff; background: var(--brand-red); }
.detail-queue-feedback { display: block; margin-top: 10px; color: #333; font-size: 14px; }

.detail_queue_modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 20px; }
.detail_queue_modal.is-open { display: flex; }
.detail_queue_backdrop { position: absolute; inset: 0; background: rgba(36, 25, 27, .68); }
.detail_queue_dialog { position: relative; width: min(100%, 520px); padding: 34px; border-radius: 12px; background: #fff; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.detail_queue_close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: 1px solid var(--brand-red); border-radius: 50%; color: var(--brand-red); background: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.detail_queue_dialog h2 { margin: 0 0 12px; color: #333; font-size: 30px; }
.detail_queue_dialog > p:not(.flow-kicker) { margin: 0 0 22px; color: #555; line-height: 1.6; }
.detail_queue_form label { display: block; margin-bottom: 8px; color: #333; font-size: 14px; font-weight: 700; }
.detail_queue_form input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cfd3d8; border-radius: 5px; color: #333; background: #fff; font: inherit; }
.detail_queue_form input:focus { outline: 2px solid rgba(186, 10, 46, .2); border-color: var(--brand-red); }
.detail_queue_form .flow_button { width: 100%; margin-top: 4px; cursor: pointer; }
.detail_queue_error { min-height: 20px; margin: 7px 0 0; color: var(--brand-red); font-size: 13px; }

.book_detail_meta {
    margin: 0 0 20px;
    color: var(--brand-red-dark);
}

.flow_button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 5px;
    color: #fff;
    background: var(--brand-red);
    text-decoration: none;
}

.reader_frame {
    width: 100%;
    min-height: 720px;
    border: 0;
    background: #fff;
}

@media (max-width: 767px) {
    .flow-header .container {
        align-items: flex-start;
        flex-direction: column;
    }

    .flow-nav {
        width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .flow-nav a { font-size: 13px; }

    .flow-main { padding: 20px 0 42px; }

    .flow-card {
        padding: 20px;
    }

    .package-flow-card {
        padding: 22px 18px 18px;
    }

    .package-flow-heading {
        flex-direction: column;
        padding-bottom: 20px;
    }

    .package-flow-heading > div,
    .package-flow-heading .flow_button_secondary { width: 100%; }

    .flow-card h2 { font-size: 27px; }

    .package-session-summary {
        gap: 10px;
    }

    .package-session-stat {
        min-height: 58px;
    }

    .package-session-summary {
        grid-template-columns: 1fr;
    }

    .package-session-stat {
        min-height: 54px;
    }

    .package_embed_frame {
        min-height: 300px;
    }

    .package_embed_message {
        padding: 34px 18px;
    }

    .package_embed_message h3 { font-size: 22px; }

    .package-embed-actions {
        flex-direction: column;
        gap: 12px;
    }

    .book_detail_layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .book_detail_cover {
        max-width: 220px;
    }

    .detail-card { padding: 22px 18px; }
    .detail-page .book_detail_layout { grid-template-columns: 1fr; }
    .book_detail_content h1 { font-size: 30px; }
    .book_detail_description { font-size: 16px; }
    .detail-session-note { align-items: flex-start; flex-wrap: wrap; white-space: normal; }
    .detail-session-clock { width: 100%; }
    .detail_queue_dialog { padding: 28px 20px 22px; }
}

/* Catalog page */
.catalog-page { background: #fff; }

.catalog-session-bar {
    border-bottom: 1px solid #e8eaee;
    background: #fff;
}

.catalog-session-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 28px;
    min-height: 58px;
}

.catalog-back-link,
.catalog-session-active,
.catalog-session-wait {
    color: #333;
    font-size: 14px;
    text-decoration: none;
}

.catalog-session-active,
.catalog-session-wait {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.catalog-back-link { color: var(--brand-red); font-weight: 700; }
.catalog-session-active strong,
.catalog-session-wait strong,
.catalog-session-clock { color: var(--brand-red); font-weight: 800; }
.catalog-session-clock { margin-left: 12px; font-variant-numeric: tabular-nums; }

.catalog-hero {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.catalog-hero-image {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
}

.catalog-home-link {
    position: absolute;
    right: 28px;
    bottom: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
    text-shadow: 0 2px 5px rgba(0, 0, 0, .48);
}

.catalog-home-link img {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
}

.catalog-books-section { padding: 64px 0 76px; background: #fff; }

.catalog-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.catalog-heading h1 {
    margin: 0 0 8px;
    color: var(--brand-red);
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.1;
}

.catalog-heading p:not(.flow-kicker) { margin: 0; color: #666; }

.catalog-session-summary {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    min-height: 44px;
    padding: 10px 0 4px;
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

.catalog-session-summary > div {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.catalog-session-summary strong {
    color: var(--brand-red);
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.catalog-session-summary .catalog-session-clock {
    gap: 6px;
    margin-left: 4px;
    color: var(--brand-red);
}

.catalog-session-summary .catalog-session-clock strong {
    font-size: 19px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 28px 16px;
}

.catalog-book-card {
    display: flex;
    min-width: 0;
    height: 100%;
}

.catalog-book-card > a {
    display: flex;
    width: 100%;
    flex-direction: column;
    color: #333;
    text-decoration: none;
}

.catalog-book-card img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    background: #f1f2f4;
    box-shadow: 0 5px 14px rgba(20, 24, 32, 0.12);
    object-fit: cover;
    transition: transform .2s ease, box-shadow .2s ease;
}

.catalog-book-card a:hover img,
.catalog-book-card a:focus-visible img {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(20, 24, 32, 0.18);
}

.catalog-book-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding-top: 14px;
    text-align: center;
}

.catalog-book-body h2 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 8px;
    color: #333;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
}

.catalog-book-body p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 8px;
    color: #777;
    font-size: 12px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-align: center;
}

.catalog-book-price { display: none; }

.catalog-detail-link {
    align-self: center;
    margin-top: auto;
    padding: 5px 10px;
    border: 1px solid var(--brand-red);
    border-radius: 4px;
    color: #fff;
    background: var(--brand-red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    transition: color .2s ease, background-color .2s ease;
}

.catalog-book-card a:hover .catalog-detail-link,
.catalog-book-card a:focus-visible .catalog-detail-link {
    color: var(--brand-red);
    background: #fff;
}

.catalog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 46px;
}

.catalog-pagination span,
.catalog-pagination button {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    color: #666;
    background: #fff;
    font-size: 14px;
}

.catalog-pagination-current { color: #fff !important; background: var(--brand-red) !important; border-color: var(--brand-red) !important; }
.catalog-pagination button:disabled { cursor: not-allowed; opacity: .65; }

.catalog-footer { padding: 28px 0; color: #fff; background: #24262b; }
.catalog-footer .container { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.catalog-footer span { color: #c5c8ce; }

.flow-page .queue_float_widget {
    position: fixed;
    z-index: 20;
    right: 24px;
    bottom: 24px;
}

.flow-page .queue_float_controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.flow-page .queue_float_button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--brand-red);
    box-shadow: 0 10px 24px rgba(83, 12, 28, .24);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.flow-page .queue_float_button img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.flow-page .queue_float_button strong,
.flow-page .queue_float_countdown { font-variant-numeric: tabular-nums; }

.flow-page .scroll_top_button {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--brand-red);
    border-radius: 50%;
    color: var(--brand-red);
    background: #fff;
    box-shadow: 0 6px 16px rgba(83, 12, 28, .18);
    text-decoration: none;
}

.flow-page .scroll_top_button img {
    width: 18px;
    height: 18px;
}

@media (max-width: 767px) {
    .flow-page .queue_float_widget { right: 14px; bottom: 14px; }
    .flow-page .queue_float_button { min-height: 44px; padding: 8px 12px; font-size: 12px; }
    .flow-page .scroll_top_button { width: 34px; height: 34px; }
}

@media (max-width: 1199px) {
    .catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .catalog-home-link { right: 14px; bottom: 24px; font-size: 15px; }
    .catalog-home-link img { width: 20px; height: 20px; }
    .catalog-heading { align-items: flex-start; gap: 16px; }
    .catalog-session-summary { width: 100%; justify-content: flex-start; gap: 14px; padding-top: 0; font-size: 12px; flex-wrap: wrap; }
    .catalog-session-summary strong { font-size: 16px; }
    .catalog-session-summary .catalog-session-clock strong { font-size: 17px; }
    .catalog-books-section { padding: 42px 0 56px; }
    .catalog-heading { flex-direction: column; margin-bottom: 24px; }
    .catalog-heading h1 { font-size: 28px; }
    .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
    .catalog-book-body h2 { font-size: 14px; }
    .catalog-footer .container { align-items: flex-start; flex-direction: column; }
}
