:root {
    --bg-cream: #f2efe6;
    --bg-shell: rgba(245, 239, 232, 0.96);
    --bg-panel: #f6ebf6;
    --bg-panel-strong: #e7e0e5;
    --text-main: #2e2528;
    --text-soft: #7d7077;
    --line-soft: rgba(110, 93, 101, 0.16);
    --shadow-soft: 0 24px 50px rgba(40, 16, 33, 0.18);
    --shadow-card: 0 12px 24px rgba(74, 54, 66, 0.16);
    --radius-xl: 28px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font-ui: "Trebuchet MS", "Segoe UI", sans-serif;
    --font-brand: "Brush Script MT", "Segoe Script", cursive;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    color: var(--text-main);
    background: radial-gradient(circle at top, #d8c7ff 0%, #b598ff 18%, #8e69df 42%, #b07cff 72%, #4a2b78 100%);
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.18), transparent 24%),
        radial-gradient(circle at 78% 24%, rgba(255, 255, 255, 0.16), transparent 20%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%);
    pointer-events: none;
    opacity: 0.8;
    z-index: 0;
}

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

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

.ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.ambient__swirl {
    position: absolute;
    border-radius: 999px;
    filter: blur(28px);
    opacity: 0.8;
    mix-blend-mode: screen;
    --ambient-rotate: 0deg;
    animation: ambientFloat 18s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

.ambient__swirl--one {
    inset: 4% auto auto -8%;
    width: 40vw;
    height: 62vh;
    background: linear-gradient(180deg, #b884ff, #e2b8ff 56%, transparent);
    --ambient-rotate: -18deg;
    animation-duration: 20s;
}

.ambient__swirl--two {
    inset: -6% -2% auto auto;
    width: 42vw;
    height: 56vh;
    background: linear-gradient(180deg, #f0ddff, #c996ff 52%, #8c5dd6);
    --ambient-rotate: 18deg;
    animation-duration: 22s;
    animation-delay: -6s;
}

.ambient__swirl--three {
    inset: auto 12% -18% auto;
    width: 52vw;
    height: 52vh;
    background: linear-gradient(135deg, #6b49a8, #caa6ff 45%, #2c1848);
    animation-duration: 24s;
    animation-delay: -10s;
}

.shell {
    position: relative;
    z-index: 1;
    width: min(1320px, calc(100vw - clamp(20px, 4vw, 56px)));
    margin: clamp(14px, 3vh, 52px) auto clamp(12px, 2vh, 28px);
    height: calc(100dvh - clamp(26px, 5vh, 80px));
    display: flex;
    flex-direction: column;
}

.library-app {
    display: grid;
    grid-template-columns: clamp(188px, 18vw, 220px) minmax(0, 1fr);
    gap: clamp(12px, 1.8vw, 20px);
    padding: clamp(18px, 2vw, 26px);
    border-radius: 22px;
    background: var(--bg-shell);
    box-shadow: 0 30px 80px rgba(12, 9, 12, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.45);
    min-height: 0;
    flex: 1 1 auto;
    opacity: 0;
    transform: translateY(24px) scale(0.985);
    transition: opacity 420ms ease, transform 420ms ease;
}

body.is-ready .library-app {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.library-app--document {
    grid-template-columns: 1fr;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 0;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: flex-start;
    padding: 0 6px 8px;
}

.brand img {
    display: block;
    max-width: min(100%, 176px);
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 22px rgba(83, 43, 117, 0.16));
    transition: transform 220ms ease, filter 220ms ease;
}

.brand:hover img {
    transform: translateY(-2px) scale(1.01);
    filter: drop-shadow(0 16px 28px rgba(83, 43, 117, 0.22));
}

.nav-panel {
    display: grid;
    gap: 10px;
    padding: 14px 12px;
    border-radius: 24px;
    background: linear-gradient(180deg, #f7ecf7, #f1e5f0);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45), var(--shadow-card);
    margin-top: -2px;
}

.subscribe-cta {
    margin-top: auto;
    padding: 11px 14px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #7f5bc9, #b27eff);
    color: #fffaff;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.15;
    cursor: pointer;
    box-shadow: 0 14px 24px rgba(101, 63, 148, 0.2);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.subscribe-cta:hover,
.subscribe-cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 28px rgba(101, 63, 148, 0.24);
    filter: saturate(1.05);
}

.nav-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 13px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #564a50;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.nav-item.is-active,
.nav-item:hover {
    background: #6f696f;
    color: #fff7ff;
    transform: translateX(4px);
    box-shadow: 0 14px 22px rgba(61, 44, 60, 0.14);
}

.upload-card {
    margin-top: auto;
    padding: 20px 18px;
    text-align: center;
    border-radius: 18px;
    background: linear-gradient(180deg, #f7f4f6, #e7e4e7);
    box-shadow: inset 0 0 0 1px rgba(88, 79, 84, 0.14), var(--shadow-card);
}

.upload-card__icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #9f9a9c;
    color: white;
    font-size: 1.55rem;
}

.upload-card h2 {
    margin: 0;
    font-size: 1.05rem;
}

.upload-card p {
    margin: 8px 0 14px;
    color: var(--text-soft);
    font-size: 0.94rem;
}

.workspace {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: clamp(18px, 5vh, 54px);
    min-height: 0;
    min-width: 0;
}

.workspace--document {
    padding-top: 0;
}

.content-panel {
    display: none;
    min-height: 0;
    flex: 1 1 auto;
}

.content-panel.is-active {
    display: block;
    height: 100%;
    animation: panelFadeIn 360ms ease;
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.toolbar__profile {
    flex: 0 0 auto;
}

.avatar {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff, #141414);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.55);
}

.search {
    display: flex;
    flex: 1;
    max-width: 440px;
    gap: 10px;
}

.search input,
.search button,
.admin-login__card input,
.admin-editor input,
.admin-editor textarea,
.admin-editor select {
    border: 1px solid rgba(95, 82, 89, 0.18);
    border-radius: 12px;
    background: #fffdf7;
}

.search input {
    flex: 1;
    padding: 15px 18px;
    min-width: 0;
}

.search button,
.admin-login__card button,
.admin-editor button,
.admin-form-actions a,
.admin-header__actions a {
    padding: 14px 18px;
    border: 0;
    background: #c8bcc5;
    color: white;
    border-radius: 12px;
    cursor: pointer;
}

.collection-board {
    position: relative;
    min-height: 0;
    height: 100%;
    padding: 0 0 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, #f8eef6, #f2e7f1);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.65), var(--shadow-soft);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.collection-hint {
    position: sticky;
    top: 10px;
    z-index: 2;
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: 10px auto 0;
    padding: 9px 14px 9px 15px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffe06f, #ffbf5a 42%, #ff8b6b 100%);
    color: #3f241f;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.3),
        0 14px 24px rgba(105, 48, 25, 0.24),
        0 0 0 0 rgba(255, 174, 66, 0.42);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    backdrop-filter: blur(10px);
    animation: hintPulse 1s ease-in-out infinite;
}

.collection-hint__arrow {
    display: inline-block;
    font-size: 1.05rem;
    color: #8c1739;
    animation: hintBounce 0.7s ease-in-out infinite;
}

.collection-hint__text {
    position: relative;
}

.collection-hint__text::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: linear-gradient(90deg, rgba(140, 23, 57, 0), rgba(140, 23, 57, 0.7), rgba(140, 23, 57, 0));
    opacity: 0.9;
}

.collection-board::before,
.info-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0.14), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.1));
    pointer-events: none;
}

.info-card {
    position: relative;
    height: 100%;
    overflow-y: auto;
    padding: 26px 30px 28px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fbf3fb, #f2e8f4);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7), var(--shadow-soft);
    overscroll-behavior: contain;
}

.info-card--document {
    min-height: 100%;
}

.info-card--compact {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-card__eyebrow {
    margin: 0 0 10px;
    color: #8c7291;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
}

.document-head {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.document-back {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    background: rgba(111, 105, 111, 0.1);
    color: #584c56;
    font-weight: 600;
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.document-back:hover,
.document-back:focus-visible {
    transform: translateY(-1px);
    background: rgba(111, 105, 111, 0.16);
    box-shadow: 0 10px 18px rgba(61, 44, 60, 0.08);
}

.info-card__title {
    margin: 0 0 14px;
    max-width: 780px;
    font-size: clamp(1.8rem, 2.7vw, 2.8rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.info-card__lead {
    margin: 0 0 14px;
    max-width: 760px;
    font-size: 1rem;
    line-height: 1.55;
    color: #463b44;
}

.info-card p,
.info-card li {
    font-size: 0.94rem;
    line-height: 1.5;
    color: #4c4249;
}

.info-card__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
    gap: 22px;
    align-items: start;
}

.info-card__main p {
    margin: 0 0 8px;
}

.info-card__list {
    margin: 10px 0 0;
    padding-left: 18px;
}

.info-card__list li + li {
    margin-top: 4px;
}

.info-card__facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
}

.info-card__fact {
    padding: 14px 14px 13px;
    border-radius: 16px;
    background: rgba(255,255,255,0.56);
    box-shadow: inset 0 0 0 1px rgba(130, 108, 141, 0.12);
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.info-card__fact:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 0 0 1px rgba(130, 108, 141, 0.18), 0 14px 24px rgba(104, 82, 116, 0.12);
    background: rgba(255,255,255,0.72);
}

.info-card__fact span {
    display: block;
    margin-bottom: 7px;
    color: #8c7291;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.info-card__fact strong {
    font-size: 0.96rem;
    line-height: 1.3;
}

.info-card__distribution {
    margin-top: 18px;
}

.info-card__distribution h2 {
    margin: 0 0 10px;
    font-size: 1.12rem;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(300px, 1.08fr);
    gap: 18px;
    align-items: start;
}

.contact-layout__intro {
    display: grid;
    gap: 14px;
}

.ads-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.9fr);
    gap: 22px;
    align-items: start;
}

.ads-layout__main {
    display: grid;
    gap: 18px;
}

.ad-format-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 12px;
}

.ad-format-card {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 0 0 1px rgba(130, 108, 141, 0.12);
    display: grid;
    gap: 10px;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.ad-format-card:hover {
    transform: translateY(-3px);
    box-shadow: inset 0 0 0 1px rgba(130, 108, 141, 0.16), 0 16px 26px rgba(89, 63, 103, 0.1);
}

.ad-format-card strong,
.business-cards-showcase__head strong {
    font-size: 0.95rem;
}

.ad-format-card span,
.business-cards-showcase__head span,
.business-cards-showcase p {
    color: #6f6170;
    font-size: 0.84rem;
}

.ad-format-card__visual {
    min-height: 132px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(241, 226, 244, 0.92));
}

.ad-format-visual {
    display: grid;
    place-items: center;
    border: 2px solid rgba(123, 92, 154, 0.34);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(176, 124, 255, 0.14), rgba(127, 91, 201, 0.22));
    color: #5b4275;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.ad-format-visual--spread {
    width: min(100%, 180px);
    aspect-ratio: 38 / 25;
    position: relative;
}

.ad-format-visual--spread::after {
    content: "";
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(78, 50, 111, 0.72);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12),
        0 0 10px rgba(78, 50, 111, 0.18);
}

.ad-format-visual--page-frame {
    width: 84px;
    aspect-ratio: 19 / 25;
    padding: 7px;
    align-items: start;
    justify-items: center;
}

.ad-format-visual--page-frame-bottom {
    align-items: end;
    justify-items: center;
}

.ad-format-visual--page-frame-compact {
    flex: 0 0 auto;
}

.ad-format-visual--page-with-side-module {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    background: transparent;
}

.ad-format-visual__module {
    display: grid;
    place-items: center;
    width: 100%;
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(127, 91, 201, 0.72), rgba(202, 166, 255, 0.86));
    box-shadow: 0 8px 16px rgba(84, 54, 114, 0.16);
    color: #fff8ff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
}

.ad-format-visual__module--full {
    height: 100%;
}

.ad-format-visual__module--half-horizontal {
    aspect-ratio: 19 / 12.5;
    width: 100%;
    align-self: end;
    justify-self: center;
}

.ad-format-visual__module--half-vertical {
    width: 50%;
    height: 100%;
    justify-self: end;
}

.ad-format-visual__module--third {
    aspect-ratio: 19 / 8.4;
    width: 100%;
    align-self: end;
}

.ad-format-visual__module--side {
    width: 52px;
    flex: 0 0 52px;
}

.ad-format-visual__module--ghost {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 0 0 1px rgba(123, 92, 154, 0.12);
}

.business-cards-showcase {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 0 0 1px rgba(130, 108, 141, 0.12);
    display: grid;
    gap: 12px;
}

.business-cards-showcase__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: baseline;
}

.business-cards-sheet {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.76), rgba(241, 226, 244, 0.96));
}

.business-cards-sheet span {
    display: block;
    aspect-ratio: 42 / 38;
    border-radius: 7px;
    background:
        linear-gradient(135deg, rgba(127, 91, 201, 0.78), rgba(202, 166, 255, 0.9)),
        linear-gradient(180deg, rgba(255,255,255,0.18), transparent);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
}

.ads-layout__side {
    display: grid;
    gap: 16px;
}

.ads-requirements {
    padding: 18px 18px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: inset 0 0 0 1px rgba(130, 108, 141, 0.12);
}

.ads-requirements h2 {
    margin: 0 0 12px;
    font-size: 1.06rem;
}

.ads-requirements__list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.ads-requirements__list li {
    font-size: 0.9rem;
    line-height: 1.45;
}

.ads-requirements__note {
    margin: 14px 0 0;
    font-size: 0.87rem;
    line-height: 1.45;
    color: #5d4f59;
}

.feedback-form {
    padding: 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.58);
    box-shadow: inset 0 0 0 1px rgba(130, 108, 141, 0.12);
    display: grid;
    gap: 10px;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.feedback-form:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px rgba(130, 108, 141, 0.12), 0 16px 30px rgba(89, 63, 103, 0.08);
}

.feedback-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.feedback-form__field {
    display: grid;
    gap: 6px;
}

.feedback-form__field span {
    font-size: 0.76rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #7c6487;
}

.feedback-form__field input,
.feedback-form__field textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid rgba(120, 99, 131, 0.18);
    border-radius: 14px;
    background: rgba(255, 253, 251, 0.92);
    color: var(--text-main);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.feedback-form__field input:focus,
.feedback-form__field textarea:focus {
    outline: none;
    border-color: rgba(139, 101, 190, 0.5);
    box-shadow: 0 0 0 4px rgba(176, 124, 255, 0.12);
    transform: translateY(-1px);
}

.feedback-form__field textarea {
    min-height: 78px;
    resize: vertical;
}

.feedback-form__actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 2px;
}

.feedback-form__status {
    min-height: 20px;
    font-size: 0.85rem;
    line-height: 1.35;
}

.feedback-form__status.is-success {
    color: #1c6b39;
}

.feedback-form__status.is-error {
    color: #8b1d34;
}

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--line-soft);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
}

.tab {
    border: 0;
    padding: 16px 24px;
    background: transparent;
    color: #4a4145;
    cursor: pointer;
}

.tab.is-active {
    background: #979291;
    color: white;
}

.add-button {
    width: 38px;
    height: 38px;
    margin-right: 18px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #b4abb4;
    color: white;
    font-size: 1.6rem;
    line-height: 1;
    pointer-events: none;
}

.shelves {
    padding: 24px clamp(16px, 2.2vw, 34px) 10px;
}

.shelf-row {
    position: relative;
    margin-bottom: 28px;
    min-height: 228px;
    opacity: 0;
    transform: translateY(18px);
    animation: shelfRise 440ms ease forwards;
    animation-delay: calc(var(--shelf-index, 0) * 90ms);
}

.book-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    justify-items: start;
    column-gap: clamp(10px, 1.4vw, 18px);
    min-height: 204px;
    padding: 0 4px 10px;
}

.book-card {
    position: relative;
    width: clamp(144px, 15vw, 182px);
    flex: 0 0 clamp(144px, 15vw, 182px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transform: translateY(-4px);
    transition: transform 180ms ease, opacity 180ms ease;
    opacity: 0;
    animation: cardRise 460ms cubic-bezier(.18,.72,.2,1) forwards;
    animation-delay: calc((var(--shelf-index, 0) * 110ms) + (var(--card-index, 0) * 70ms));
    justify-self: start;
}

.book-card[hidden] {
    display: none;
}

.book-card:hover {
    transform: translateY(-8px);
}

.book-card__cover {
    width: 100%;
    aspect-ratio: 19 / 25;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 24px 28px rgba(24, 14, 20, 0.24);
    background: linear-gradient(180deg, var(--cover-secondary), var(--cover));
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.book-card__cover-link {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.book-card__cover-link:hover .book-card__cover,
.book-card__cover-link:focus-visible .book-card__cover {
    transform: translateY(-2px);
    box-shadow: 0 30px 34px rgba(24, 14, 20, 0.28);
    filter: saturate(1.04);
}

.book-card__cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.08));
}

.book-card__fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px 10px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.14), transparent 26%),
        linear-gradient(160deg, var(--cover-secondary), var(--cover));
    color: var(--cover-text);
}

.book-card__placeholder {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.8;
}

.book-card__edit {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    max-width: 100%;
    transition: color 180ms ease, transform 180ms ease;
}

.book-card__edit:hover,
.book-card__edit:focus-visible {
    color: #5d3f7f;
    transform: translateY(-1px);
}

.reader-dialog,
.reader-viewer {
    border: 0;
    padding: 0;
    background: transparent;
}

.reader-dialog::backdrop,
.reader-viewer::backdrop {
    background: rgba(14, 10, 16, 0.56);
    backdrop-filter: blur(8px);
}

.reader-dialog[open] .reader-dialog__card,
.reader-viewer[open] .reader-viewer__card {
    animation: dialogRise 260ms ease;
}

.reader-dialog__card,
.reader-viewer__card {
    position: relative;
    width: min(560px, calc(100vw - 28px));
    padding: 26px;
    border-radius: 24px;
    background: #fff9fc;
    box-shadow: 0 24px 80px rgba(14, 10, 16, 0.28);
}

.reader-viewer__card {
    width: min(1100px, calc(100vw - 28px));
}

.reader-dialog__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #eee2ea;
    color: var(--text-main);
    cursor: pointer;
}

.reader-dialog__eyebrow {
    margin: 0 0 6px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
}

.reader-dialog__title {
    margin: 0;
    font-size: 1.7rem;
    line-height: 1.1;
}

.reader-dialog__actions,
.reader-viewer__actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.reader-dialog__actions {
    margin-top: 22px;
}

.reader-dialog__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: #6f696f;
    color: #fff7ff;
    cursor: pointer;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.reader-dialog__button:hover,
.reader-dialog__button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(60, 42, 51, 0.18);
}

.reader-dialog__button--secondary {
    background: #d8cad3;
    color: var(--text-main);
}

.subscribe-dialog__card {
    width: min(600px, calc(100vw - 28px));
}

.subscribe-dialog__lead {
    margin: 12px 0 18px;
    color: #554852;
    line-height: 1.5;
}

.subscribe-form {
    display: grid;
    gap: 10px;
}

.subscribe-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.reader-viewer__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.reader-viewer__frame-wrap {
    overflow: hidden;
    border-radius: 18px;
    background: #cfc5cd;
}

.reader-viewer__frame {
    display: block;
    width: 100%;
    height: min(78vh, 980px);
    border: 0;
    background: #ffffff;
}

.reader-viewer__note {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.shelf-shadow {
    height: 17px;
    width: calc(100% - 46px);
    margin: -2px auto 0;
    border-radius: 1px;
    background: #ffffff;
    box-shadow: 0 18px 20px rgba(60, 42, 51, 0.22);
}

.empty-state {
    padding: 20px 34px 34px;
    color: var(--text-soft);
}

.empty-state h2 {
    margin: 0 0 8px;
    color: var(--text-main);
}

.credits {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    color: rgba(255,255,255,0.92);
    font-size: 0.95rem;
}

.credits strong,
.credits span {
    display: block;
}

.credits__meta {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.credits__meta a {
    color: rgba(255,255,255,0.92);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 30;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-radius: 20px;
    background: rgba(34, 22, 43, 0.88);
    color: #f8f1fb;
    box-shadow: 0 24px 50px rgba(21, 12, 28, 0.32);
    backdrop-filter: blur(16px);
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
    transition: opacity 220ms ease, transform 220ms ease;
}

.cookie-banner.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cookie-banner__text {
    max-width: 760px;
    display: grid;
    gap: 6px;
}

.cookie-banner__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.cookie-banner__text p {
    margin: 0;
    color: rgba(248, 241, 251, 0.86);
    font-size: 0.92rem;
    line-height: 1.45;
}

.cookie-banner__text a {
    color: #f7d6ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.cookie-banner__button {
    min-height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.cookie-banner__button:hover,
.cookie-banner__button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.cookie-banner__button--accept {
    background: linear-gradient(135deg, #ab79ff, #d49fff);
    color: #2d173e;
}

.cookie-banner__button--reject {
    background: rgba(255, 255, 255, 0.12);
    color: #f8f1fb;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

@keyframes ambientFloat {
    0% {
        transform: rotate(var(--ambient-rotate)) translate3d(0, 0, 0) scale(1);
        opacity: 0.72;
    }
    100% {
        transform: rotate(var(--ambient-rotate)) translate3d(18px, -14px, 0) scale(1.06);
        opacity: 0.92;
    }
}

@keyframes panelFadeIn {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shelfRise {
    0% {
        opacity: 0;
        transform: translateY(18px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardRise {
    0% {
        opacity: 0;
        transform: translateY(26px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(-4px) scale(1);
    }
}

@keyframes dialogRise {
    0% {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes hintBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.78;
    }
    50% {
        transform: translateY(6px) scale(1.08);
        opacity: 1;
    }
}

@keyframes hintPulse {
    0%, 100% {
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.3),
            0 14px 24px rgba(105, 48, 25, 0.24),
            0 0 0 0 rgba(255, 174, 66, 0.42);
    }
    50% {
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.36),
            0 18px 30px rgba(105, 48, 25, 0.3),
            0 0 0 12px rgba(255, 174, 66, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.issue-modal {
    border: 0;
    padding: 0;
    background: transparent;
}

.issue-modal::backdrop {
    background: rgba(12, 10, 14, 0.52);
    backdrop-filter: blur(6px);
}

.issue-modal__card {
    position: relative;
    width: min(520px, calc(100vw - 32px));
    padding: 28px;
    border-radius: 22px;
    background: #fcf8fb;
    box-shadow: var(--shadow-soft);
}

.issue-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #e7dbe5;
    cursor: pointer;
}

.issue-modal__eyebrow,
.issue-modal__meta {
    color: var(--text-soft);
}

.admin-body {
    background: linear-gradient(180deg, #22141b, #0f1d2f 58%, #1d354a);
    overflow: hidden;
}

.admin-shell {
    width: min(100vw - 24px, 1600px);
    height: calc(100vh - 24px);
    margin: 12px auto;
}

.admin-login {
    min-height: calc(100vh - 52px);
    display: grid;
    place-items: center;
}

.admin-login__card,
.admin-layout {
    border-radius: 26px;
    background: rgba(249, 244, 247, 0.95);
    box-shadow: 0 24px 70px rgba(8, 10, 14, 0.25);
}

.admin-login__card {
    width: min(480px, 100%);
    padding: 34px;
}

.admin-login__card form,
.admin-editor form {
    display: grid;
    gap: 14px;
}

.admin-login__card label,
.admin-editor label {
    display: grid;
    gap: 8px;
}

.field-hint {
    color: var(--text-soft);
    font-size: 0.85rem;
    line-height: 1.35;
}

.admin-layout {
    height: 100%;
    padding: 14px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 14px;
}

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

.admin-header h1,
.admin-header h2,
.admin-header h3,
.admin-editor h2,
.admin-list h2 {
    margin: 0;
}

.admin-main {
    display: grid;
    gap: 20px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

.admin-content-panel {
    display: none;
    min-height: 0;
}

.admin-content-panel.is-active {
    display: block;
    animation: panelFadeIn 280ms ease;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 14px;
    border-radius: 20px;
    background: linear-gradient(180deg, #201721, #2d1c2f 58%, #342545);
    color: #f7eef7;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
    min-height: 0;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100%;
}

.admin-sidebar__head h1 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.04;
}

.admin-sidebar__lead {
    margin: 8px 0 0;
    color: rgba(247, 238, 247, 0.74);
    font-size: 0.84rem;
    line-height: 1.42;
}

.admin-nav {
    display: grid;
    gap: 6px;
}

.admin-nav__link {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    color: rgba(247, 238, 247, 0.86);
    background: rgba(255,255,255,0.04);
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
    font-size: 0.92rem;
    cursor: pointer;
    text-align: left;
}

.admin-nav__link:hover,
.admin-nav__link.is-active {
    background: linear-gradient(135deg, rgba(171, 121, 255, 0.92), rgba(212, 159, 255, 0.92));
    color: #251332;
    transform: translateX(4px);
    box-shadow: 0 12px 24px rgba(78, 50, 111, 0.28);
}

.admin-sidebar__footer {
    margin-top: auto;
    display: grid;
    gap: 8px;
}

.admin-sidebar__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #fff7ff;
    cursor: pointer;
    text-align: center;
    transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
    font-size: 0.9rem;
}

.admin-sidebar__action:hover,
.admin-sidebar__action:focus-visible {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.14);
    box-shadow: 0 10px 20px rgba(0,0,0,0.16);
}

.admin-sidebar__action--secondary {
    background: rgba(255,255,255,0.05);
}

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

.admin-section {
    scroll-margin-top: 22px;
}

.admin-section__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-section__header h3 {
    margin: 0;
    font-size: 1.36rem;
}

.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    gap: 20px;
}

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

.admin-stats {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.admin-dashboard-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-dashboard-panel {
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffafc, #f3edf5);
    box-shadow: inset 0 0 0 1px rgba(88, 79, 84, 0.1);
    display: grid;
    gap: 10px;
}

.admin-dashboard-panel__head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.admin-dashboard-panel__head strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.admin-dashboard-panel__head p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.4;
}

.admin-dashboard-panel__icon {
    font-size: 1.15rem;
    line-height: 1;
}

.admin-dashboard-metrics {
    display: grid;
    gap: 10px;
}

.admin-dashboard-metric {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(88, 79, 84, 0.08);
}

.admin-dashboard-metric span {
    color: #62555e;
    font-size: 0.88rem;
    line-height: 1.35;
}

.admin-dashboard-metric strong {
    text-align: right;
    font-size: 0.88rem;
    line-height: 1.35;
    color: #37293b;
}

.admin-charts-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-chart-card {
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffafc, #f3edf5);
    box-shadow: inset 0 0 0 1px rgba(88, 79, 84, 0.1);
    display: grid;
    gap: 14px;
}

.admin-chart-card__head {
    display: grid;
    gap: 4px;
}

.admin-chart-card__head strong {
    font-size: 1rem;
    line-height: 1.2;
}

.admin-chart-card__head span {
    color: var(--text-soft);
    font-size: 0.82rem;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-kpi {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255,255,255,0.64);
    box-shadow: inset 0 0 0 1px rgba(88, 79, 84, 0.08);
    display: grid;
    gap: 8px;
}

.admin-kpi span {
    color: #6b5e67;
    font-size: 0.8rem;
    line-height: 1.35;
}

.admin-kpi strong {
    font-size: 1.45rem;
    line-height: 1;
    color: #2f2431;
}

.admin-bars {
    display: grid;
    gap: 12px;
}

.admin-bar {
    display: grid;
    gap: 8px;
}

.admin-bar__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.84rem;
    color: #5f535b;
}

.admin-bar__track {
    height: 12px;
    border-radius: 999px;
    background: rgba(120, 99, 131, 0.12);
    overflow: hidden;
}

.admin-bar__value {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, #ab79ff, #d49fff);
}

.admin-timeline {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
    min-height: 190px;
}

.admin-timeline__day {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 8px;
    min-width: 0;
}

.admin-timeline__bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 4px;
    min-height: 150px;
}

.admin-timeline__bar {
    width: 18px;
    min-height: 6px;
    border-radius: 10px 10px 4px 4px;
}

.admin-timeline__bar--messages {
    background: linear-gradient(180deg, #7f5bc9, #b27eff);
}

.admin-timeline__bar--subscribers {
    background: linear-gradient(180deg, #e8a0c9, #f4c8de);
}

.admin-timeline__label {
    text-align: center;
    font-size: 0.78rem;
    color: #716570;
    white-space: nowrap;
}

.admin-donut-wrap {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.admin-donut {
    width: 180px;
    height: 180px;
    margin: 0 auto;
}

.admin-donut svg {
    display: block;
    width: 100%;
    height: 100%;
}

.admin-donut-legend {
    display: grid;
    gap: 10px;
}

.admin-donut-legend__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.86rem;
    color: #5e525b;
}

.admin-donut-legend__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-donut-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.admin-stat {
    padding: 18px 20px;
    border-radius: 18px;
    background: #fffafc;
    box-shadow: inset 0 0 0 1px rgba(88, 79, 84, 0.12);
    display: grid;
    gap: 8px;
}

.admin-stat span {
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.74rem;
}

.admin-stat strong {
    font-size: 1.8rem;
    line-height: 1;
}

.admin-editor,
.admin-list {
    padding: 22px;
    border-radius: 20px;
    background: #fffafc;
    box-shadow: inset 0 0 0 1px rgba(88, 79, 84, 0.12);
}

.admin-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-editor input,
.admin-editor textarea,
.admin-editor select,
.admin-login__card input {
    width: 100%;
    padding: 12px 14px;
}

.admin-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

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

.admin-export {
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-import {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    border-radius: 12px;
    background: #c8bcc5;
    color: white;
    cursor: pointer;
}

.admin-import input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.admin-alert {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-radius: 14px;
}

.admin-alert--success {
    background: #ddf6e4;
    color: #18522b;
}

.admin-alert--error {
    background: #ffe0e0;
    color: #7a1717;
}

.admin-alert--info {
    background: #e5f1ff;
    color: #1c466f;
}

.admin-kicker {
    margin: 0 0 8px;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.77rem;
}

.admin-table {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.admin-table__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8f1f5;
}

.admin-table__row p {
    margin: 4px 0 0;
    color: var(--text-soft);
}

.admin-table__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.admin-table__links a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 9px;
    background: #ece1eb;
    color: #564a50;
    font-size: 0.82rem;
}

.admin-table__stack {
    display: grid;
    gap: 6px;
}

.admin-table__stack p {
    margin: 0;
}

.admin-table__empty {
    padding: 16px;
    border-radius: 14px;
    background: #f8f1f5;
    color: var(--text-soft);
}

.admin-table__meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-table__meta form {
    margin: 0;
}

.admin-table__meta button {
    border: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #8c8089;
    color: white;
    cursor: pointer;
}

@media (max-width: 980px) {
    .library-app,
    .admin-grid,
    .admin-grid--secondary,
    .admin-stats,
    .admin-dashboard-grid,
    .admin-charts-grid,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .shell {
        width: min(100vw - 24px, 100%);
        height: calc(100dvh - 24px);
        margin: 12px auto;
    }

    .library-app {
        gap: 14px;
    }

    .sidebar {
        order: 1;
        padding-top: 0;
        gap: 12px;
    }

    .workspace {
        order: 2;
        padding-top: 0;
    }

    .nav-panel {
        display: flex;
        gap: 10px;
        padding: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .nav-panel::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .subscribe-cta {
        margin-top: 0;
        align-self: flex-start;
    }

    .admin-sidebar {
        gap: 14px;
        position: static;
        height: auto;
    }

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

@media (max-width: 720px) {
    .shell,
    .admin-shell {
        width: min(100vw - 20px, 100%);
        margin: 10px auto 14px;
    }

    .shell {
        height: calc(100dvh - 20px);
    }

    .library-app,
    .admin-layout {
        padding: 14px;
    }

    .admin-shell {
        height: calc(100vh - 20px);
    }

    .library-app {
        gap: 14px;
        border-radius: 20px;
    }

    .sidebar {
        gap: 12px;
    }

    .brand {
        justify-content: center;
        padding: 0 0 6px;
    }

    .brand img {
        max-width: 148px;
    }

    .nav-panel {
        padding: 11px 14px;
        font-size: 0.95rem;
    }

    .subscribe-cta {
        width: 100%;
        margin-top: 10px;
        align-self: stretch;
    }

    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        border-radius: 18px;
    }

    .cookie-banner__actions {
        justify-content: stretch;
    }

    .cookie-banner__button {
        width: 100%;
    }

    .workspace {
        min-height: 0;
    }

    .content-panel,
    .content-panel.is-active {
        min-height: 0;
    }

    .collection-board {
        padding-bottom: 10px;
        border-radius: 20px;
    }

    .collection-hint {
        top: 8px;
        margin-top: 8px;
        padding: 7px 10px;
        font-size: 0.74rem;
    }

    .info-card {
        padding: 22px 18px 24px;
        border-radius: 20px;
    }

    .info-card__layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ads-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

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

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .feedback-form {
        padding: 18px;
        border-radius: 18px;
    }

    .feedback-form__grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .subscribe-form__grid {
        grid-template-columns: 1fr;
    }

    .business-cards-sheet {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .info-card__title {
        margin-bottom: 14px;
        font-size: 1.8rem;
    }

    .info-card__lead,
    .info-card p,
    .info-card li {
        font-size: 0.96rem;
        line-height: 1.6;
    }

    .info-card__facts {
        margin: 0;
    }

    .collection-header,
    .credits,
    .admin-header,
    .admin-form-row,
    .admin-table__row,
    .admin-table__meta {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .credits__meta {
        justify-items: start;
    }

    .shelves {
        padding: 18px 12px 8px;
    }

    .shelf-row {
        min-height: 186px;
        margin-bottom: 20px;
    }

    .book-strip {
        justify-content: flex-start;
        gap: 14px;
        min-height: 160px;
        padding: 0 2px 8px;
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: none;
    }

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

    .book-card {
        width: 126px;
        flex: 0 0 126px;
        gap: 8px;
        transform: translateY(-2px);
    }

    .book-card:hover {
        transform: translateY(-4px);
    }

    .book-card__edit {
        font-size: 0.88rem;
    }

    .shelf-shadow {
        width: calc(100% - 18px);
    }

    .credits {
        gap: 8px;
        margin-top: 12px;
        font-size: 0.84rem;
    }

    .reader-dialog__card,
    .reader-viewer__card {
        width: min(100vw - 20px, 100%);
        padding: 18px;
        border-radius: 18px;
    }

    .reader-dialog__title {
        font-size: 1.35rem;
    }

    .reader-viewer__header {
        flex-direction: column;
    }

    .reader-viewer__frame {
        height: 62vh;
    }

    .admin-grid {
        gap: 14px;
    }

    .admin-main {
        gap: 14px;
        overflow: visible;
        padding-right: 0;
    }

    .admin-editor,
    .admin-list {
        padding: 16px;
    }

    .admin-form-actions,
    .admin-export,
    .reader-dialog__actions,
    .reader-viewer__actions {
        width: 100%;
    }

    .admin-form-actions button,
    .reader-dialog__button,
    .admin-export button,
    .admin-import {
        width: 100%;
    }

    .admin-header__actions {
        width: 100%;
        flex-direction: column;
    }

    .admin-header__actions a,
    .admin-header__actions button {
        width: 100%;
        text-align: center;
    }

    .admin-nav {
        grid-template-columns: 1fr;
    }

    .admin-section__header {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .library-app {
        border-radius: 18px;
        padding: 12px;
    }

    .brand {
        justify-content: center;
        padding: 0 0 4px;
    }

    .brand img {
        max-width: 138px;
    }

    .info-card {
        padding: 18px 15px 20px;
    }

    .info-card__title {
        font-size: 1.55rem;
        line-height: 1.03;
    }

    .ad-format-grid {
        grid-template-columns: 1fr;
    }

    .business-cards-sheet {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 12px;
    }

    .book-card {
        width: 118px;
        flex-basis: 118px;
    }

    .reader-dialog__actions,
    .reader-viewer__actions {
        width: 100%;
    }

    .reader-dialog__button {
        width: 100%;
    }
}

@media (max-height: 820px) and (min-width: 981px) {
    .shell {
        margin: 12px auto;
        height: calc(100dvh - 24px);
    }

    .workspace {
        padding-top: 18px;
    }

    .sidebar {
        gap: 8px;
    }

    .nav-panel {
        gap: 8px;
        padding: 12px 10px;
    }

    .nav-item {
        min-height: 40px;
        padding: 8px 12px;
    }

    .subscribe-cta {
        padding: 10px 12px;
    }
}

@media (min-width: 1440px) {
    .shell {
        width: min(1440px, calc(100vw - 72px));
    }

    .library-app {
        grid-template-columns: 232px minmax(0, 1fr);
    }

    .ad-format-grid {
        grid-template-columns: repeat(3, minmax(170px, 1fr));
    }

    .book-card {
        width: 182px;
        flex-basis: 182px;
    }
}
