@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --store-bg: #f6f8ff;
    --store-bg-accent: #fdf5dd;
    --store-surface: #ffffff;
    --store-surface-soft: rgba(255, 255, 255, 0.9);
    --store-border: #d5dae6;
    --store-border-strong: #b9c0d4;
    --store-stroke: #d0d5e4;
    --store-text: #1b2449;
    --store-muted: #6d7697;
    --store-accent: #3f8cff;
    --store-accent-dark: #2f6fdd;
    --store-accent-soft: rgba(63, 140, 255, 0.14);
    --store-gold: #f6c343;
    --store-gold-soft: rgba(246, 195, 67, 0.24);
    --store-success: #047857;
    --store-success-soft: rgba(16, 185, 129, 0.18);
    --store-danger: #9f1d1d;
    --store-danger-soft: rgba(239, 68, 68, 0.2);
    --store-radius-xl: 16px;
    --store-radius-lg: 12px;
    --store-radius-md: 8px;
    --store-shadow: 0 12px 32px -24px rgba(15, 26, 63, 0.28);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Poppins', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at 12% 16%, var(--store-bg-accent) 0%, rgba(253, 245, 221, 0) 55%), radial-gradient(circle at 84% 8%, rgba(106, 166, 255, 0.18) 0%, rgba(106, 166, 255, 0) 55%), var(--store-bg);
    color: var(--store-text);
    line-height: 1.55;
    min-height: 100vh;
    background-attachment: fixed;
}

.store-no-scroll {
    overflow: hidden;
}

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

img {
    display: block;
    max-width: 100%;
}

.store-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 249, 255, 0.88));
    border-bottom: 1px solid var(--store-stroke);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 22px -18px rgba(15, 26, 63, 0.22);
}

.store-header__inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.store-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
}

.store-brand__logo {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--store-radius-md);
    background: linear-gradient(135deg, rgba(63, 140, 255, 0.32), rgba(246, 195, 67, 0.36));
    font-size: 1.3rem;
}

.store-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.store-nav__link {
    padding: 10px 0;
    font-weight: 500;
    color: var(--store-muted);
    position: relative;
}

.store-nav__link:hover {
    color: var(--store-text);
}

.store-nav__link--active {
    color: var(--store-text);
}

.store-nav__link--active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -14px;
    height: 2px;
    background: linear-gradient(135deg, var(--store-accent), var(--store-gold));
    border-radius: var(--store-radius-md);
}

.store-header__actions {
    display: flex;
    gap: 12px;
}

.store-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.store-user__meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.store-user__name {
    font-weight: 600;
    font-size: 0.95rem;
}

.store-user__email {
    font-size: 0.78rem;
    color: var(--store-muted);
}

.store-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-weight: 600;
    border-radius: var(--store-radius-xl);
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.store-button--primary {
    background: linear-gradient(135deg, var(--store-accent), var(--store-gold));
    color: #fff;
    box-shadow: 0 10px 24px -18px rgba(63, 140, 255, 0.28);
}

.store-button--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -18px rgba(63, 140, 255, 0.32);
}

.store-button--ghost {
    background: transparent;
    color: var(--store-text);
    border: 1px solid var(--store-stroke);
}

.store-button--ghost:hover {
    background: rgba(63, 140, 255, 0.06);
}

.store-main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.store-flash-messages {
    margin: 0 auto 32px;
    max-width: 840px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.store-flash-messages .alert {
    width: 100%;
    padding: 1.35rem 1.6rem;
    border-radius: var(--store-radius-lg);
    font-size: 1.08rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--store-surface);
    color: var(--store-text);
    border: 1px solid rgba(63, 140, 255, 0.18);
    box-shadow: 0 24px 54px -36px rgba(15, 26, 63, 0.45);
}

.store-flash-messages .alert span {
    display: block;
}

.store-flash-messages .alert-success {
    background: linear-gradient(140deg, var(--store-success-soft), rgba(255, 255, 255, 0.9));
    border-color: rgba(16, 185, 129, 0.28);
    color: var(--store-success);
}

.store-flash-messages .alert-danger {
    background: linear-gradient(140deg, var(--store-danger-soft), rgba(255, 255, 255, 0.9));
    border-color: rgba(239, 68, 68, 0.26);
    color: var(--store-danger);
}

.store-hero {
    background: linear-gradient(130deg, rgba(106, 166, 255, 0.22), rgba(246, 195, 67, 0.26));
    border-radius: var(--store-radius-lg);
    padding: 56px 48px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 32px;
    margin-bottom: 48px;
    border: 1px solid var(--store-stroke);
    box-shadow: 0 10px 24px -20px rgba(15, 26, 63, 0.18);
}

.store-hero__title {
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    font-weight: 700;
}

.store-hero__subtitle {
    margin: 0 0 24px;
    color: var(--store-muted);
    font-size: 1.05rem;
    max-width: 520px;
}

.store-hero__cta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.store-hero__stats {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(247, 249, 255, 0.9));
    border-radius: var(--store-radius-md);
    padding: 24px;
    display: grid;
    gap: 18px;
    box-shadow: var(--store-shadow);
    border: 1px solid var(--store-stroke);
}

.store-hero__stat-label {
    font-size: 0.9rem;
    color: var(--store-muted);
    margin: 0;
}

.store-hero__stat-value {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.store-section__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.store-section__heading {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.store-search {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.store-search__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.store-search__input {
    min-width: 240px;
    flex: 1 1 240px;
    padding: 10px 14px;
    border-radius: var(--store-radius-xl);
    border: 1px solid var(--store-stroke);
    background: var(--store-surface);
    font-size: 0.95rem;
    color: var(--store-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.store-search__input:focus {
    outline: none;
    border-color: var(--store-accent);
    box-shadow: 0 0 0 3px var(--store-accent-soft);
}

.store-search__clear {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--store-muted);
    padding: 0 6px;
    flex-shrink: 0;
}

.store-search__clear:hover {
    color: var(--store-text);
}

.store-search__submit {
    padding: 10px 20px;
    flex-shrink: 0;
}

.store-category-filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.store-category-filter__label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--store-muted);
}

.store-category-filter__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.store-section {
    display: grid;
    gap: 24px;
    margin-bottom: 48px;
}

.store-section__title {
    margin: 0;
    font-size: 1.5rem;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.store-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.store-stack__item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: 20px;
    padding: 18px 20px;
    background: var(--store-surface);
    border-radius: var(--store-radius-md);
    box-shadow: var(--store-shadow);
    align-items: center;
    border: 1px solid var(--store-stroke);
}

.store-stack__cover img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--store-radius-md);
    border: 1px solid var(--store-stroke);
}

.store-stack__title {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.store-stack__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.store-stack__meta {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--store-muted);
}

.store-stack__desc {
    margin: 12px 0;
    color: var(--store-muted);
    font-size: 0.92rem;
}

.store-stack__hint {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--store-muted);
}

.store-stack__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.store-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--store-radius-lg);
    background: linear-gradient(135deg, rgba(106, 166, 255, 0.16), rgba(246, 195, 67, 0.2));
    color: var(--store-accent);
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.store-chip--active {
    background: var(--store-accent);
    color: #fff;
    box-shadow: 0 6px 16px -12px rgba(63, 140, 255, 0.38);
}

.store-stack__actions {
    display: grid;
    gap: 10px;
    justify-items: end;
    grid-auto-flow: row;
}

.book-card {
    position: relative;
    border-radius: var(--store-radius-md);
    background: var(--store-surface);
    box-shadow: var(--store-shadow);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 100%;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--store-stroke);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px -20px rgba(31, 38, 135, 0.22);
}

.book-card__cover {
    position: relative;
    padding-top: 140%;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(106, 166, 255, 0.14), rgba(246, 195, 67, 0.16));
}

.book-card__cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-card__category {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--store-muted);
}

.book-card__title {
    margin: 0;
    font-size: 1.1rem;
}

.book-card__author {
    margin: 0;
    font-size: 0.9rem;
    color: var(--store-muted);
}

.book-card__desc {
    margin: 0;
    font-size: 0.92rem;
    color: var(--store-muted);
}

.book-card__price {
    margin: 4px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--store-text);
}

.book-card__actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.book-card__actions .store-button {
    font-size: 0.85rem; /* Decreased font size for "add to cart" button */
}

.store-empty {
    text-align: center;
    padding: 80px 24px;
    border-radius: var(--store-radius-lg);
    background: var(--store-surface);
    box-shadow: var(--store-shadow);
}

.store-empty__title {
    margin: 0 0 12px;
    font-size: 1.4rem;
}

.store-empty__text {
    margin: 0 0 24px;
    color: var(--store-muted);
}

.store-footer {
    border-top: 1px solid var(--store-stroke);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 255, 0.9));
    padding: 32px 24px 40px;
    margin-top: 80px;
    box-shadow: 0 -10px 26px -20px rgba(15, 26, 63, 0.2);
}

.store-footer__inner {
    max-width: 1160px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.store-footer__title {
    margin: 0 0 6px;
    font-weight: 600;
}

.store-footer__text {
    margin: 0;
    color: var(--store-muted);
}

.store-footer__links {
    display: flex;
    gap: 16px;
    color: var(--store-muted);
}

.store-footer__links a:hover {
    color: var(--store-text);
}

.store-footer__copy {
    max-width: 1160px;
    margin: 0 auto;
    color: var(--store-muted);
    font-size: 0.85rem;
    text-align: center;
}

.store-alert {
    border-radius: var(--store-radius-md);
    padding: 14px 18px;
    font-weight: 500;
    margin-bottom: 24px;
}

.store-alert--success {
    background: linear-gradient(135deg, rgba(106, 166, 255, 0.2), rgba(246, 195, 67, 0.24));
    color: #1f2f67;
}

.store-alert--neutral {
    background: rgba(26, 28, 45, 0.04);
    color: var(--store-muted);
}

.store-alert--danger {
    background: rgba(159, 29, 29, 0.12);
    color: var(--store-danger);
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 32px;
}

.cart-item {
    background: var(--store-surface);
    border-radius: var(--store-radius-md);
    padding: 18px;
    display: grid;
    grid-template-columns: 120px 1fr 160px;
    gap: 22px;
    box-shadow: var(--store-shadow);
}

.cart-item__cover {
    border-radius: 12px;
    overflow: hidden;
}

.cart-item__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item__title {
    margin: 0 0 6px;
    font-size: 1.2rem;
}

.cart-item__meta {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: var(--store-muted);
}

.cart-item__desc {
    margin: 0 0 16px;
    font-size: 0.9rem;
    color: var(--store-muted);
}

.cart-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.cart-item__pricing {
    display: grid;
    gap: 8px;
    text-align: right;
    font-weight: 600;
    align-content: start;
}

.cart-summary {
    max-width: 360px;
    margin-left: auto;
    background: var(--store-surface);
    border-radius: var(--store-radius-md);
    padding: 24px;
    box-shadow: var(--store-shadow);
    display: grid;
    gap: 16px;
}

.cart-summary__title {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    color: var(--store-muted);
}

.cart-summary__row--total {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--store-text);
}

.cart-summary__checkout,
.cart-summary__continue {
    width: 100%;
}

.checkout {
    display: grid;
    gap: 24px;
}

.checkout-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
}

.checkout-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkout-line {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 18px;
    padding: 18px;
    border-radius: var(--store-radius-md);
    background: var(--store-surface);
    box-shadow: var(--store-shadow);
}

.checkout-line__cover img {
    width: 72px;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.checkout-line__info h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

.checkout-line__info p {
    margin: 0;
    color: var(--store-muted);
}

.checkout-line__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-weight: 600;
}

.checkout-line__price-original {
    color: var(--store-muted);
    text-decoration: line-through;
    font-weight: 500;
}

.checkout-line__price-final {
    color: var(--store-text);
}

.checkout-panel {
    background: var(--store-surface);
    border-radius: var(--store-radius-md);
    padding: 24px;
    box-shadow: var(--store-shadow);
    display: grid;
    gap: 14px;
    min-width: 0;
}

.checkout-panel h2 {
    margin: 0;
}

.checkout-panel__row {
    display: flex;
    justify-content: space-between;
    color: var(--store-muted);
}

.checkout-panel__row--discount {
    color: var(--store-accent);
    font-weight: 600;
}

.checkout-panel__row--total {
    font-weight: 600;
    color: var(--store-text);
}

.checkout-panel__note {
    margin: 6px 0 0;
    color: var(--store-muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.checkout-panel__insufficient {
    display: grid;
    gap: 6px;
    margin-top: 6px;
    padding: 12px 14px;
    border-radius: var(--store-radius-md);
    border: 1px solid rgba(159, 29, 29, 0.18);
    background: rgba(159, 29, 29, 0.08);
    color: var(--store-danger);
    font-size: 0.9rem;
    line-height: 1.4;
}

.checkout-panel__insufficient strong {
    font-size: 0.95rem;
}

.checkout-panel__insufficient span {
    display: block;
}

.checkout-panel__insufficient-link {
    color: var(--store-accent-dark);
    font-weight: 600;
    text-decoration: underline;
    display: inline-block;
}

.checkout-panel__insufficient-link:hover {
    color: var(--store-accent);
}

.checkout-panel__message {
    margin: 4px 0 0;
    font-size: 0.88rem;
    color: var(--store-accent);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.checkout-panel__error {
    margin: 4px 0 0;
    font-size: 0.88rem;
    color: #d03f3f;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.checkout-panel__form {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.checkout-coupon {
    display: grid;
    gap: 6px;
}

.checkout-coupon__label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--store-muted);
}

.checkout-coupon__controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.checkout-coupon__input {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--store-radius-md);
    border: 1px solid var(--store-stroke);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
}

.checkout-coupon__input:focus {
    outline: none;
    border-color: rgba(63, 140, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(63, 140, 255, 0.2);
}

.checkout-coupon__button {
    white-space: nowrap;
    flex-shrink: 0;
}

.checkout-panel__notice {
    margin: 0;
    padding: 12px 16px;
    background: rgba(26, 28, 45, 0.05);
    border-radius: var(--store-radius-md);
    border: 1px solid var(--store-stroke);
    font-size: 0.9rem;
    color: var(--store-muted);
}

.checkout-panel__cta,
.checkout-panel__secondary {
    width: 100%;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.library-card {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 20px;
    background: var(--store-surface);
    border-radius: var(--store-radius-md);
    padding: 20px;
    box-shadow: var(--store-shadow);
    border: 1px solid var(--store-stroke);
}

.library-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--store-radius-md);
    border: 1px solid var(--store-stroke);
}

.library-card__title {
    margin: 0 0 6px;
}

.library-card__meta {
    margin: 0 0 12px;
    color: var(--store-muted);
    font-size: 0.9rem;
}

.library-card__desc {
    margin: 0 0 14px;
    color: var(--store-muted);
    font-size: 0.92rem;
}

.library-card__date {
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: var(--store-muted);
}

.library-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.library-card__wishlist {
    display: inline;
}

.wishlist-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--store-border);
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wishlist-button:hover {
    background: linear-gradient(135deg, var(--store-accent), var(--store-gold));
    color: #fff;
    border-color: transparent;
}

.wishlist-indicator {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--store-radius-lg);
    background: linear-gradient(135deg, rgba(106, 166, 255, 0.16), rgba(246, 195, 67, 0.2));
    color: #1f2f67;
    font-size: 0.8rem;
    font-weight: 600;
}

.reader {
    background: var(--store-surface);
    border-radius: var(--store-radius-lg);
    padding: 28px;
    box-shadow: var(--store-shadow);
    display: grid;
    gap: 24px;
}

.reader__header {
    display: flex;
    gap: 22px;
    align-items: center;
    flex-wrap: wrap;
}

.reader__cover img {
    width: 140px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--store-radius-md);
    box-shadow: 0 10px 24px -18px rgba(31, 38, 135, 0.22);
    border: 1px solid var(--store-stroke);
}

.reader__title {
    margin: 0 0 6px;
}

.reader__meta {
    margin: 0 0 12px;
    color: var(--store-muted);
}

.reader__status {
    margin: 0 0 16px;
    font-weight: 600;
    color: var(--store-accent);
}

.reader__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.reader__body {
    padding: 24px;
    border-radius: var(--store-radius-md);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(246, 195, 67, 0.16));
    max-height: 60vh;
    overflow-y: auto;
    line-height: 1.7;
    border: 1px solid var(--store-stroke);
}

.reader__preview-heading {
    margin: 0 0 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--store-text);
}

.reader__body p {
    margin: 0 0 18px;
}

.reader__cta {
    margin-top: 24px;
    text-align: center;
    display: grid;
    gap: 12px;
}

.reader__empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--store-muted);
}

.reader-app {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 24px;
    background: var(--store-surface);
    border-radius: var(--store-radius-lg);
    padding: 28px;
    box-shadow: var(--store-shadow);
    border: 1px solid var(--store-stroke);
}

.reader-app__sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-right: 1px solid var(--store-stroke);
    padding-right: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.reader-app__summary-title {
    margin: 0 0 4px;
    font-size: 1.2rem;
}

.reader-app__summary-meta {
    margin: 0;
    color: var(--store-muted);
    font-size: 0.9rem;
}

.reader-app__summary-progress {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--store-muted);
}

.reader-progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(63, 140, 255, 0.12);
    border-radius: var(--store-radius-md);
    overflow: hidden;
}

.reader-progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(135deg, var(--store-accent), var(--store-gold));
    border-radius: inherit;
    transition: width 0.3s ease;
}

.reader-app__chapters {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.reader-chapter-link {
    width: 100%;
    border: 1px solid var(--store-border);
    background: transparent;
    border-radius: var(--store-radius-sm);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.reader-chapter-link:hover,
.reader-chapter-link.is-active {
    border-color: var(--store-accent);
    background: rgba(63, 140, 255, 0.12);
}

.reader-chapter-link.is-complete::after {
    content: '✔';
    margin-left: auto;
    color: var(--store-accent);
    font-size: 0.85rem;
}

.reader-chapter-link__number {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--store-muted);
}

.reader-chapter-link__title {
    flex: 1;
    font-weight: 500;
}

.reader-app__content {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 18px;
}

.reader-app__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.reader-app__title {
    margin: 0;
    font-size: 1.6rem;
}

.reader-app__meta {
    margin: 4px 0 0;
    color: var(--store-muted);
    font-size: 0.9rem;
}

.reader-app__actions {
    display: flex;
    gap: 12px;
}

.reader-app__viewport {
    overflow-y: auto;
    padding-right: 4px;
    max-height: calc(100vh - 220px);
}

.reader-chapter {
    display: none;
}

.reader-chapter.is-active {
    display: block;
}

.reader-chapter__title {
    margin: 0 0 12px;
}

.reader-block {
    margin: 0 0 18px;
    font-size: 1rem;
    line-height: 1.6;
}

.reader-block--image img {
    width: 100%;
    border-radius: var(--store-radius-sm);
    box-shadow: 0 8px 18px -12px rgba(31, 38, 135, 0.18);
    border: 1px solid var(--store-stroke);
}

.reader-block--image figcaption {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--store-muted);
}

.reader-block--empty {
    font-style: italic;
    color: var(--store-muted);
}

.reader-app__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reader-app__footer-links {
    display: flex;
    gap: 12px;
}

.reader-app__read-mode-controls {
    display: none;
    align-items: center;
    gap: 16px;
}

.reader-app__control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--store-radius-lg);
    background: var(--store-surface-soft);
    color: var(--store-text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 18px;
    min-width: 120px;
    cursor: pointer;
    box-shadow: var(--store-shadow);
    transition: background 0.2s ease, transform 0.2s ease;
}

.reader-app__control span {
    pointer-events: none;
}

.reader-app__control:hover {
    background: var(--store-surface);
    transform: translateY(-1px);
}

.reader-app__control:focus,
.reader-app__control:focus-visible {
    outline: 2px solid var(--store-accent);
    outline-offset: 2px;
}

.reader-app__control:active {
    transform: translateY(0);
}

.reader-app__control--exit {
    min-width: auto;
    display: none;
}

body.reader-read-mode {
    overflow: hidden;
    --reader-page-bg: #fdfbf5;
    --reader-surface: var(--store-surface);
    --reader-text: var(--store-text);
    --reader-muted: var(--store-muted);
    --reader-control-bg: rgba(27, 36, 73, 0.92);
    --reader-control-hover-bg: rgba(27, 36, 73, 1);
    --reader-control-color: #ffffff;
    --reader-control-shadow: 0 18px 42px -28px rgba(0, 0, 0, 0.7);
    --reader-scroll-thumb: rgba(27, 36, 73, 0.25);
    --reader-accent: var(--store-accent);
    --reader-image-border: var(--store-stroke);
    --reader-image-shadow: 0 8px 18px -12px rgba(31, 38, 135, 0.18);
    background: var(--reader-page-bg);
    color: var(--reader-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.reader-read-mode.reader-dark-mode {
    --reader-page-bg: #0d101a;
    --reader-surface: #111626;
    --reader-text: #e4e9ff;
    --reader-muted: #9aa7d9;
    --reader-control-bg: rgba(125, 136, 206, 0.9);
    --reader-control-hover-bg: rgba(125, 136, 206, 1);
    --reader-control-color: #0a0e1d;
    --reader-control-shadow: 0 20px 44px -26px rgba(7, 11, 26, 0.8);
    --reader-scroll-thumb: rgba(125, 136, 206, 0.6);
    --reader-accent: #8fb4ff;
    --reader-image-border: rgba(143, 180, 255, 0.2);
    --reader-image-shadow: 0 20px 38px -24px rgba(6, 10, 28, 0.85);
    color-scheme: dark;
}

body.reader-read-mode .store-header,
body.reader-read-mode .store-footer {
    display: none;
}

body.reader-read-mode .store-main {
    padding: 0;
    margin: 0;
    min-height: 100vh;
    background: var(--reader-surface);
    color: var(--reader-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.reader-read-mode .reader-app {
    grid-template-columns: 1fr;
    padding: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    min-height: 100vh;
    background: var(--reader-surface);
    color: var(--reader-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.reader-read-mode .reader-app__sidebar,
body.reader-read-mode .reader-app__header,
body.reader-read-mode .reader-app__footer {
    display: none;
}

body.reader-read-mode .reader-app__content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--reader-surface);
    color: var(--reader-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.reader-read-mode .reader-app__viewport {
    flex: 1;
    max-height: none;
    padding: 48px clamp(24px, 12vw, 160px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--reader-text);
    background: transparent;
    scrollbar-width: thin;
    scrollbar-color: var(--reader-scroll-thumb) transparent;
    transition: color 0.3s ease, background-color 0.3s ease;
}

body.reader-read-mode .reader-chapter {
    display: block;
    width: min(68ch, 100%);
    margin: 0 auto;
}

body.reader-read-mode .reader-app__viewport::-webkit-scrollbar {
    width: 8px;
}

body.reader-read-mode .reader-app__viewport::-webkit-scrollbar-thumb {
    background: var(--reader-scroll-thumb);
    border-radius: 999px;
}

body.reader-read-mode .reader-app__read-mode-controls {
    display: none;
}

body.reader-read-mode .reader-app__control {
    background: var(--reader-control-bg);
    color: var(--reader-control-color);
    box-shadow: var(--reader-control-shadow);
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

body.reader-read-mode .reader-app__control:hover,
body.reader-read-mode .reader-app__control:focus,
body.reader-read-mode .reader-app__control:focus-visible {
    background: var(--reader-control-hover-bg);
    color: var(--reader-control-color);
}

body.reader-read-mode .reader-app__control[aria-pressed='true'] {
    background: var(--reader-control-hover-bg);
    color: var(--reader-control-color);
}

body.reader-read-mode .reader-app__control--exit {
    display: flex;
    position: fixed;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
    box-shadow: var(--reader-control-shadow);
    z-index: 70;
}

body.reader-read-mode .reader-app__control--exit span {
    line-height: 1;
}

body.reader-read-mode .store-main::before,
body.reader-read-mode .store-main::after {
    display: none;
}

body.reader-read-mode .reader-chapter__title,
body.reader-read-mode .reader-block {
    color: var(--reader-text);
    transition: color 0.3s ease;
}

body.reader-read-mode .reader-block--image figcaption,
body.reader-read-mode .reader-block--empty {
    color: var(--reader-muted);
    transition: color 0.3s ease;
}

body.reader-read-mode .reader-block--image img {
    border-color: var(--reader-image-border);
    box-shadow: var(--reader-image-shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

body.reader-read-mode .reader-app__viewport a {
    color: var(--reader-accent);
    text-decoration: underline;
    text-decoration-color: currentColor;
    transition: color 0.2s ease, opacity 0.2s ease;
}

body.reader-read-mode .reader-app__viewport a:hover,
body.reader-read-mode .reader-app__viewport a:focus,
body.reader-read-mode .reader-app__viewport a:focus-visible {
    opacity: 0.85;
}

.store-modal__separator {
    display: none;
    padding: 0 6px;
    color: var(--store-muted);
}

.store-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(10, 12, 20, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 24px;
    z-index: 200;
}

.store-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.store-modal__dialog {
    max-width: 780px;
    width: 100%;
    background: var(--store-surface);
    border-radius: var(--store-radius-lg);
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(10, 12, 20, 0.35);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-height: 90vh;
}

.store-modal__header {
    padding: 22px 28px;
    border-bottom: 1px solid var(--store-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.store-modal__title {
    margin: 0;
    font-size: 1.3rem;
}

.store-modal__close {
    all: unset;
    cursor: pointer;
    color: var(--store-muted);
    font-size: 1.5rem;
    line-height: 1;
}

.store-modal__body {
    padding: 28px;
    overflow-y: auto;
    display: grid;
    gap: 24px;
}

.store-modal__meta {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--store-muted);
}

.store-modal__cover {
    width: 150px;
    border-radius: var(--store-radius-md);
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--store-stroke);
}

.store-modal__excerpt {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(246, 195, 67, 0.18));
    border-radius: var(--store-radius-md);
    padding: 20px;
    font-size: 0.95rem;
    color: var(--store-text);
    line-height: 1.6;
    white-space: pre-line;
    border: 1px solid var(--store-stroke);
}

.store-modal__attention {
    margin: 0 0 16px;
    padding: 14px 16px;
    border-left: 4px solid var(--store-accent);
    border-radius: var(--store-radius-sm);
    background: rgba(63, 140, 255, 0.12);
    font-weight: 600;
}

.store-progress {
    display: grid;
    gap: 6px;
}

.store-progress__header {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--store-muted);
}

.store-progress__bar {
    width: 100%;
    height: 10px;
    background: rgba(63, 140, 255, 0.12);
    border-radius: var(--store-radius-md);
    overflow: hidden;
}

.store-progress__bar span {
    display: block;
    height: 100%;
    background: linear-gradient(135deg, var(--store-accent), var(--store-gold));
    border-radius: inherit;
    transition: width 0.3s ease;
}

.store-modal__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.store-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--store-radius-lg);
    background: linear-gradient(135deg, rgba(106, 166, 255, 0.18), rgba(246, 195, 67, 0.22));
    color: #1f2f67;
    font-weight: 600;
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .store-hero {
        grid-template-columns: 1fr;
    }

    .store-nav {
        gap: 12px;
    }

    .store-header__inner {
        flex-wrap: wrap;
    }

    .store-header__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .store-user {
        width: 100%;
        justify-content: flex-end;
    }

    .store-stack__item {
        grid-template-columns: 120px minmax(0, 1fr);
    }

    .store-stack__actions {
        justify-items: start;
        grid-column: span 2;
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .cart-item {
        grid-template-columns: 120px 1fr;
    }

    .cart-summary {
        margin-left: 0;
    }

    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .library-card {
        grid-template-columns: 120px 1fr;
    }

    .reader__body {
        max-height: none;
    }

    .reader-app {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .reader-app__sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--store-border);
        padding-right: 0;
        padding-bottom: 16px;
        max-height: none;
    }

    .reader-app__viewport {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .store-main {
        padding: 36px 16px 72px;
    }

    .store-section__header {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .store-section__heading {
        width: 100%;
    }

    .store-search {
        width: 100%;
        margin-left: 0;
    }

    .store-search__controls {
        width: 100%;
    }

    .store-search__input {
        width: 100%;
    }

    .store-search__submit {
        width: 100%;
    }

    .store-search__clear {
        order: 3;
        align-self: flex-end;
        padding: 0;
    }

    .store-header__inner {
        padding: 12px 16px;
    }

    .store-nav {
        width: 100%;
        justify-content: space-between;
    }

    .store-header__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .store-hero {
        padding: 32px 24px;
    }

    .store-user {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    .store-stack__item {
        grid-template-columns: minmax(0, 1fr);
    }

    .store-stack__cover img {
        width: 100px;
        height: 140px;
    }

    .store-stack__actions {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .cart-item__pricing {
        justify-items: start;
        text-align: left;
    }

    .checkout-line {
        grid-template-columns: 64px 1fr;
    }

    .checkout-line__price {
        justify-content: flex-start;
    }

    .library-card {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .reader {
        padding: 20px;
    }

    .reader__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .reader__cover img {
        width: 120px;
        height: 170px;
    }

    .reader-app {
        padding: 16px;
    }

    .reader-app__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .reader-app__actions {
        width: 100%;
        justify-content: space-between;
    }

    .reader-app__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    body.reader-read-mode .reader-app__viewport {
        padding: 32px 16px 96px;
    }

    body.reader-read-mode .reader-app__read-mode-controls {
        bottom: 20px;
        gap: 12px;
    }

    body.reader-read-mode .reader-app__control {
        min-width: 96px;
        padding: 10px 14px;
    }

    body.reader-read-mode .reader-app__control--exit {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
    }
}
