/* ==========================================================================
   Beyan — Bookcloth & Foil
   Loaded after the legacy compiled app.css (Bootstrap 3) and overrides it.
   Brand colours come from the lotus logo kit: gold petals (#EDB233) on a
   navy book (#1B2A3A), cream pages (#FBF4E3). The hero is gold cloth; header
   and footer are navy cloth with gold type; every category owns one deep
   cloth hue (see beyan_cloth() in helpers.php). Text on gold is always navy.
   Pages between cloth fields are cream (light) or night (dark). Mabry Pro is
   the app's typeface; Fraunces is the logo wordmark only.

   Light/dark: follows the OS, overridden by html[data-theme] (set by the
   header toggle, see beyan.js). Colour-only differences live in the token
   blocks below; components read tokens, never raw hex.
   ========================================================================== */

@font-face { font-family: "Mabry Pro"; src: url("../fonts/mabry/MabryPro-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Mabry Pro"; src: url("../fonts/mabry/MabryPro-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Mabry Pro"; src: url("../fonts/mabry/MabryPro-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Mabry Pro"; src: url("../fonts/mabry/MabryPro-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
    color-scheme: light;

    /* brand (lotus logo kit) */
    --gold: #EDB233;
    --gold-deep: #D4921A;
    --gold-pale: #F3CC6B;
    --navy: #1B2A3A;
    --cream: #FBF4E3;
    --night: #121C2A;
    --on-gold: #1B2A3A;

    /* house cloth: the logo's navy */
    --house: #1B2A3A;
    --house-deep: #16222F;
    --house-ink: #111A26;
    --board: #0D1520;
    --board-edge: #2A3D52;
    --board-shade: #0F1822;

    /* gold type on dark cloth */
    --foil: #EDB233;
    --foil-hi: #EDB233;
    --foil-line: rgba(237, 178, 51, 0.38);

    /* page */
    --page: #FBF4E3;
    --paper: #FFFFFF;
    --ink: #1C1B19;
    --ink-2: #46505C;
    --ink-3: #66707B;
    --line: #E7DCC4;
    --line-strong: #D9CBAE;
    --ivory: #FBF4E3;
    --ivory-2: rgba(251, 244, 227, 0.8);
    --link: #1B2A3A;
    --madder: #9B2335;

    /* solid controls (active chip, primary button): navy with gold type */
    --solid: #1B2A3A;
    --solid-hover: #111A26;
    --on-solid: #EDB233;

    --shadow-rgb: 27, 42, 58;
    --phone-body: #0E1520;
    --phone-edge: #2A3A4C;
    --ok-line: #BFD8C9;
    --ok-bg: #EFF7F2;
    --bad-line: #E7C2C8;
    --bad-bg: #FBF0F1;
    --weave: url("../images/beyan/cloth.webp");
    --weave-size: 320px;

    /* type: display, title, body, small */
    --font: "Mabry Pro", "Helvetica Neue", Arial, sans-serif;
    --t-display: clamp(2.75rem, 1.4rem + 4.6vw, 5.5rem);
    --t-title: clamp(1.625rem, 1.2rem + 1.3vw, 2.375rem);
    --t-body: 1.0625rem;
    --t-small: 0.875rem;

    /* rhythm */
    --s-1: 0.5rem;
    --s-2: 1rem;
    --s-3: 1.5rem;
    --s-4: 2.5rem;
    --s-5: 4rem;
    --s-6: clamp(4.5rem, 3rem + 5vw, 8rem);
    --shell: 1240px;
    --gutter: clamp(1rem, 0.5rem + 2.2vw, 2.5rem);

    --radius: 14px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --book-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.14), 0 14px 28px -14px rgba(var(--shadow-rgb), 0.45);
}

/* Dark: night page, navy paper. Header/footer stay navy cloth in both. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --page: #121C2A;
        --paper: #1B2A3A;
        --ink: #FBF4E3;
        --ink-2: #C9C6BD;
        --ink-3: #9AA3AD;
        --line: #2E4157;
        --line-strong: #3A4E66;
        --link: #F3CC6B;
        --madder: #E8838F;
        --house: #16222F;
        --house-deep: #121C2A;
        --solid: #EDB233;
        --solid-hover: #F3CC6B;
        --on-solid: #1B2A3A;
        --shadow-rgb: 0, 0, 0;
        --ok-line: #2F5B45;
        --ok-bg: #16302A;
        --bad-line: #6B2A35;
        --bad-bg: #321B24;
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #121C2A;
    --paper: #1B2A3A;
    --ink: #FBF4E3;
    --ink-2: #C9C6BD;
    --ink-3: #9AA3AD;
    --line: #2E4157;
    --line-strong: #3A4E66;
    --link: #F3CC6B;
    --madder: #E8838F;
    --house: #16222F;
    --house-deep: #121C2A;
    --solid: #EDB233;
    --solid-hover: #F3CC6B;
    --on-solid: #1B2A3A;
    --shadow-rgb: 0, 0, 0;
    --ok-line: #2F5B45;
    --ok-bg: #16302A;
    --bad-line: #6B2A35;
    --bad-bg: #321B24;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html { font-size: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body.beyan {
    background: var(--page);
    color: var(--ink);
    font-family: var(--font);
    font-size: var(--t-body);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    caret-color: var(--link);
    text-rendering: optimizeLegibility;
}
:where(body.beyan) :is(h1, h2, h3, h4, h5, h6) { font-family: var(--font); color: inherit; margin: 0; letter-spacing: -0.01em; }
:where(body.beyan) p { margin: 0; }
:where(body.beyan) a { color: inherit; text-decoration: none; transition: color 160ms var(--ease); }
body.beyan a:hover, body.beyan a:focus { text-decoration: none; }
body.beyan img { max-width: 100%; }
body.beyan button { font-family: inherit; }
::selection { background: var(--gold); color: var(--on-gold); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }
.cloth :focus-visible, .site-header :focus-visible { outline-color: var(--gold); }
.cloth--gold :focus-visible { outline-color: var(--on-gold); }
html { scrollbar-color: var(--line-strong) var(--page); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--page); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--page); }

.main, .wrapper { background: transparent; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.shell { width: 100%; max-width: calc(var(--shell) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
body.beyan .content-wrapper { background: var(--page); margin: 0; padding: 0 0 var(--s-6); min-height: 0 !important; }
body.beyan .content-wrapper > .container.shell { width: 100%; padding-inline: var(--gutter); }
body.beyan .content-wrapper > .container.shell::before, body.beyan .content-wrapper > .container.shell::after { display: none; }
body.route-home .content-wrapper { padding-bottom: 0; }
body.route-home .content-wrapper > .container.shell { max-width: none; padding: 0; }

/* Break a band out of the centred shell to the full viewport width. */
.bleed, .catalog-head--cloth, .book-band { width: 100vw; margin-left: calc(50% - 50vw); }

/* --------------------------------------------------------------------------
   Cloth & foil
   -------------------------------------------------------------------------- */

.cloth, .woven {
    background-color: var(--cloth, var(--house));
    background-image: var(--weave), linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.16));
    background-size: var(--weave-size), 100% 100%;
    background-blend-mode: soft-light, normal;
}
.cloth { color: var(--ivory); }
/* Gold cloth is always light: pin the text and solid-control tokens to navy
   so it reads the same in dark mode. */
.cloth--gold {
    --cloth: var(--gold); color: var(--on-gold);
    --ink: var(--navy); --ink-2: #33404F; --ink-3: #4A5563; --link: var(--navy);
    --solid: var(--navy); --solid-hover: var(--house-ink); --on-solid: var(--gold);
}
.cloth--gold .foil { color: var(--on-gold); }
/* In dark mode the gold field would glare: it becomes navy cloth with gold type. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .cloth--gold { --cloth: var(--house); color: var(--ivory); --ink: var(--ivory); --ink-2: var(--ivory-2); --ink-3: var(--ivory-2); --link: var(--gold-pale); --solid: var(--gold); --solid-hover: var(--gold-pale); --on-solid: var(--navy); }
    :root:not([data-theme="light"]) .cloth--gold .foil { color: var(--foil); }
    :root:not([data-theme="light"]) .cloth--gold :focus-visible { outline-color: var(--gold); }
}
:root[data-theme="dark"] .cloth--gold { --cloth: var(--house); color: var(--ivory); --ink: var(--ivory); --ink-2: var(--ivory-2); --ink-3: var(--ivory-2); --link: var(--gold-pale); --solid: var(--gold); --solid-hover: var(--gold-pale); --on-solid: var(--navy); }
:root[data-theme="dark"] .cloth--gold .foil { color: var(--foil); }
:root[data-theme="dark"] .cloth--gold :focus-visible { outline-color: var(--gold); }

.foil {
    color: var(--foil);
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 0.98;
    text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Buttons & small parts
   -------------------------------------------------------------------------- */

.btn-foil, .btn-ink {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
    min-height: 44px; padding: 0 1.15em; border-radius: 999px;
    font-size: var(--t-small); font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
    border: 1px solid var(--foil-line); color: var(--foil-hi); background: transparent;
    cursor: pointer; transition: background-color 180ms var(--ease), color 180ms var(--ease), border-color 180ms var(--ease), transform 180ms var(--ease);
}
.btn-foil:hover { border-color: var(--foil); color: var(--house-ink) !important; background: var(--foil); }
.btn-foil--solid { background: var(--foil); color: var(--house-ink); border-color: var(--foil); min-height: 50px; padding: 0 1.5em; font-size: 1rem; }
.btn-foil--solid:hover { background: var(--foil-hi); border-color: var(--foil-hi); transform: translateY(-1px); }
.btn-foil svg { width: 20px; height: 20px; }
.btn-ink { color: var(--on-solid); background: var(--solid); border-color: var(--solid); }
.btn-ink:hover { color: var(--on-solid) !important; background: var(--solid-hover); }

.text-link { display: inline-flex; align-items: center; gap: 0.35em; font-weight: 700; font-size: var(--t-small); color: var(--link) !important; background: none; border: 0; padding: 0; cursor: pointer; }
.text-link { text-decoration: underline !important; text-decoration-color: var(--gold-deep) !important; text-decoration-thickness: 3px !important; text-underline-offset: 5px; }
.text-link:hover { text-decoration-color: var(--ink) !important; }

.icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer;
    transition: background-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}
.icon-btn:hover { color: var(--madder); transform: translateY(-1px); }
.icon-btn.is-on { color: var(--madder); }
.icon-btn--cloth { width: 46px; height: 46px; border: 0; background: rgba(0, 0, 0, 0.2); color: var(--ivory) !important; font-size: 18px; }
.icon-btn--cloth:hover { background: rgba(0, 0, 0, 0.34); color: var(--foil-hi) !important; }
.icon-btn--cloth.is-on { color: var(--foil-hi) !important; }

/* Store buttons */
.store-row { display: flex; flex-wrap: wrap; gap: 12px; }
.store-btn {
    display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 22px 0 18px;
    border-radius: 14px; background: var(--house-ink); border: 1px solid var(--foil-line); color: var(--ivory) !important;
    transition: transform 200ms var(--ease), border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.store-btn:hover { transform: translateY(-2px); border-color: var(--foil); }
.store-btn__icon { width: 26px; height: 26px; color: var(--foil); flex: none; }
.store-btn__text { display: flex; flex-direction: column; line-height: 1.1; }
.store-btn__small { font-size: 0.75rem; opacity: 0.8; }
.store-btn__big { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.01em; }
.store-btn--web { padding: 0 24px; }
.store-btn--web .store-btn__big { font-size: 1rem; }
.store-row--ink .store-btn { background: var(--solid); border-color: var(--solid); color: var(--on-solid) !important; min-height: 52px; }
.store-row--ink .store-btn:hover { background: var(--solid-hover); }
.store-row--ink .store-btn__icon { color: var(--on-solid); width: 22px; height: 22px; }
.store-row--ink .store-btn__big { font-size: 1.0625rem; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

body.beyan .header-wrapper { position: sticky; top: 0; z-index: 60; background: var(--house); height: auto; margin: 0; padding: 0; }
body.beyan .header-inner, body.beyan .header-inner.sticky { position: relative; top: auto; height: auto; padding: 0; box-shadow: none; background: transparent; animation: none; }
.site-header { color: var(--ivory); background-color: var(--house); transition: box-shadow 200ms var(--ease); }
.site-header.is-scrolled { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25), 0 10px 30px -18px rgba(0, 0, 0, 0.6); }
.header-bar { display: flex; align-items: center; gap: var(--s-3); min-height: 72px; }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand { gap: 10px; }
.brand img { height: 24px; width: auto; display: block; }
/* Lotus mark, on-dark treatment: header and footer are navy cloth in both themes.
   The petal gaps are painted in the cloth colour so they read as cuts. */
.brand__mark { height: 32px; width: auto; aspect-ratio: 220 / 175; flex: none; display: block; }
.brand__mark .gap { stroke: var(--house); }
.site-footer .brand__mark { height: 40px; }
.brand__word { font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.375rem; line-height: 1; letter-spacing: -0.01em; color: var(--ivory); white-space: nowrap; font-variation-settings: "opsz" 48; }
.site-footer .brand__word { font-size: 1.625rem; }

/* Light/dark switch (header). Shows the icon of the theme it switches to. */
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.22); color: var(--ivory-2); cursor: pointer; transition: color 160ms var(--ease), background-color 160ms var(--ease); }
.theme-toggle:hover { color: var(--foil-hi); background: rgba(0, 0, 0, 0.34); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle__sun { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle__moon { display: none; }

/* Lottie slots (beyan.js fills them with the variant matching the surface). */
.lotus-anim { display: block; margin-inline: auto; }
.lotus-anim svg { display: block; }
.lotus-anim--opening { width: 150px; aspect-ratio: 440 / 450; }
.lotus-anim--loader { width: 72px; aspect-ratio: 440 / 350; }
.main-nav { display: flex; gap: 4px; }
.main-nav__link { padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: 0.9375rem; color: var(--ivory-2) !important; }
.main-nav__link:hover { color: var(--ivory) !important; background: rgba(255, 255, 255, 0.06); }
.main-nav__link.is-active { color: var(--foil-hi) !important; }

.header-search { flex: 1; max-width: 420px; margin-left: auto; }
.header-search .search-box { position: relative; display: flex; align-items: center; background: transparent; border: 0; box-shadow: none; padding: 0; margin: 0; height: auto; width: 100%; }
.header-search__icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--ivory-2); pointer-events: none; }
body.beyan .header-search__input {
    -webkit-appearance: none; appearance: none; width: 100%; height: 42px; min-height: 0; padding: 0 16px 0 42px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(0, 0, 0, 0.22); color: var(--ivory);
    font: 400 0.9375rem/1 var(--font); box-shadow: none; outline: none; transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.header-search__input::placeholder { color: rgba(251, 244, 227, 0.6); }
.header-search__input:focus { border-color: var(--foil-line); background: rgba(0, 0, 0, 0.32); }
.header-search__input::-webkit-search-cancel-button { filter: invert(1) opacity(0.6); }

.header-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.header-link { font-weight: 500; font-size: 0.9375rem; color: var(--ivory-2) !important; padding: 8px 6px; }
.header-link:hover { color: var(--ivory) !important; }

.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, 0.22); }
.lang-switch__item { min-width: 34px; padding: 5px 8px; border-radius: 999px; text-align: center; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ivory-2) !important; }
.lang-switch__item:hover { color: var(--ivory) !important; }
.lang-switch__item.is-active { background: var(--foil); color: var(--house-ink) !important; }

.account-menu__toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--foil-line); background: transparent; overflow: hidden; cursor: pointer; }
.account-menu__avatar { width: 100%; height: 100%; object-fit: cover; }
.account-menu__initial { color: var(--foil-hi); font-weight: 700; }
.account-menu .dropdown-menu { margin-top: 10px; min-width: 220px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 40px -18px rgba(var(--shadow-rgb), 0.4); }
.account-menu .dropdown-menu > li > a { padding: 9px 12px; border-radius: 8px; color: var(--ink); font-size: 0.9375rem; }
.account-menu .dropdown-menu > li > a:hover { background: var(--page); color: var(--ink); }
.account-menu__name { padding: 8px 12px 6px; font-size: var(--t-small); color: var(--ink-3); }

.menu-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 0; border-radius: 12px; background: rgba(0, 0, 0, 0.22); color: var(--ivory); cursor: pointer; }
.menu-toggle svg { width: 24px; height: 24px; }
.mobile-sheet { border-top: 1px solid rgba(255, 255, 255, 0.08); padding: var(--s-2) 0 var(--s-3); }
.mobile-sheet[hidden] { display: none; }
.mobile-sheet__nav { display: flex; flex-direction: column; }
.mobile-sheet__nav a { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 1.25rem; font-weight: 700; color: var(--ivory) !important; }
.mobile-sheet__nav a[aria-current] { color: var(--foil-hi) !important; }
.mobile-sheet__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding-top: var(--s-3); }

/* search suggestions (devbridge autocomplete, appended to body) */
.autocomplete-suggestions { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 40px -20px rgba(var(--shadow-rgb), 0.45); overflow: auto; padding: 6px; font-family: var(--font); }
.autocomplete-suggestion { padding: 9px 12px; border-radius: 8px; color: var(--ink); cursor: pointer; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.autocomplete-selected { background: var(--page); }
.autocomplete-suggestions strong { color: var(--ink); font-weight: 900; }

/* --------------------------------------------------------------------------
   Home: shelf hero
   -------------------------------------------------------------------------- */

.hero-shelf { position: relative; overflow: hidden; }
.hero-shelf__inner {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-3);
    align-items: end; min-height: min(760px, calc(100svh - 72px)); padding-top: var(--s-5);
}
.hero-shelf__copy { align-self: center; padding-bottom: var(--s-5); }
.hero-shelf__title { font-size: var(--t-display); max-width: 9ch; }
.hero-shelf__lead { margin-top: var(--s-3); max-width: 34ch; font-size: 1.1875rem; line-height: 1.5; color: var(--ink-2); }
.hero-shelf__copy .store-row { margin-top: var(--s-4); }
.hero-shelf__web { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s-3); font-weight: 700; font-size: 0.9375rem; color: var(--ink) !important; }
.hero-shelf__web svg { width: 16px; height: 16px; transition: transform 200ms var(--ease); }
.hero-shelf__web:hover { text-decoration: underline !important; text-underline-offset: 4px; }
.hero-shelf__web:hover svg { transform: translateX(3px); }

.shelf { position: relative; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.shelf { --row: clamp(380px, 40vw, 600px); }
.shelf__row { display: flex; align-items: flex-end; justify-content: flex-end; gap: 5px; height: var(--row); padding-inline: 4px; overflow: hidden; padding-top: 24px; }
.shelf__board {
    position: relative; height: 26px; margin-left: -100vw; margin-right: calc(-50vw + 50%);
    background-color: var(--board);
    background-image: linear-gradient(180deg, var(--board-edge) 0, var(--board-edge) 3px, var(--board-shade) 4px, var(--board) 60%), var(--weave);
    background-size: 100% 100%, var(--weave-size);
    background-blend-mode: normal, soft-light;
    box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.55);
}

.spine {
    --h: 90%;
    position: relative; flex: 0 0 auto; width: clamp(42px, 3.7vw, 58px); height: calc(var(--h) * 0.6);
    display: flex; align-items: center; justify-content: center; padding: 18px 0;
    background-color: var(--cloth);
    background-image: var(--weave), linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0) 75%, rgba(0, 0, 0, 0.18));
    background-size: var(--weave-size), 100% 100%;
    background-blend-mode: soft-light, normal;
    border-radius: 3px 3px 1px 1px;
    box-shadow: 2px 0 0 rgba(0, 0, 0, 0.25);
    transform-origin: bottom center;
    transition: transform 380ms var(--ease), box-shadow 380ms var(--ease);
}
.spine::before, .spine::after { content: ""; position: absolute; left: 7px; right: 7px; height: 4px; border-top: 1px solid var(--foil-line); border-bottom: 1px solid var(--foil-line); }
.spine::before { top: 9px; }
.spine::after { bottom: 9px; }
.spine:nth-child(3n) { width: clamp(48px, 4.3vw, 66px); }
.spine:nth-child(4n+1) { width: clamp(38px, 3.3vw, 52px); }
.spine__title {
    writing-mode: vertical-rl; transform: rotate(180deg);
    max-height: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--foil-hi);
}
.spine:hover, .spine:focus-visible { transform: translateY(-18px); box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08) inset, 2px 0 0 rgba(0, 0, 0, 0.25), 0 24px 30px -18px rgba(0, 0, 0, 0.7); }
.spine:focus-visible { outline-offset: 2px; border-radius: 3px; }

.shelf__phone { flex: none; margin: 0 14px; width: calc((var(--row) - 40px) * 0.4614); }
.phone {
    position: relative; aspect-ratio: 640 / 1387; padding: 9px; border-radius: 44px;
    background: var(--phone-body);
    box-shadow: 0 0 0 1.5px var(--phone-edge) inset, 0 40px 60px -30px rgba(0, 0, 0, 0.8), 0 18px 30px -20px rgba(0, 0, 0, 0.6);
}
.phone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 36px; }
.phone--small { border-radius: 28px; padding: 6px; }
.phone--small img { border-radius: 23px; }

/* Shelf entrance: spines settle onto the board once, from a visible start. */
@media (prefers-reduced-motion: no-preference) {
    .js-ready .hero-shelf .spine, .js-ready .hero-shelf .shelf__phone { animation: settle 900ms var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
    .js-ready .hero-shelf .shelf__phone { animation-name: settle-phone; animation-duration: 1100ms; }
}
@keyframes settle { from { transform: translateY(14%); } to { transform: none; } }
@keyframes settle-phone { from { transform: translateY(6%); } to { transform: none; } }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.page-section { padding: var(--s-6) 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); margin-bottom: var(--s-4); }
.section-head__title, .catalog-head__title { color: var(--ink); font-size: var(--t-title); font-weight: 900; letter-spacing: -0.025em; line-height: 1.08; text-wrap: balance; }
.empty-note { color: var(--ink-2); }

/* --------------------------------------------------------------------------
   Book grid & card
   -------------------------------------------------------------------------- */

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: var(--s-4) clamp(16px, 2vw, 28px); }
.book-card { position: relative; min-width: 0; }
.book-card__link { display: block; color: var(--ink) !important; }
.book-card__cover {
    position: relative; aspect-ratio: 2 / 3; border-radius: 3px 7px 7px 3px; overflow: hidden;
    background: var(--cloth, var(--house)); box-shadow: var(--book-shadow);
    transition: transform 320ms var(--ease), box-shadow 320ms var(--ease);
}
.book-card__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-card__cover::after {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 9px; pointer-events: none;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(255, 255, 255, 0.16) 45%, rgba(0, 0, 0, 0.08));
}
.book-card__link:hover .book-card__cover { transform: translateY(-5px); box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.14), 0 26px 34px -18px rgba(var(--shadow-rgb), 0.55); }
.book-card__cloth {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18% 14%; text-align: center;
    background-color: var(--cloth, var(--house));
    background-image: var(--weave);
    background-size: var(--weave-size);
    background-blend-mode: soft-light;
}
.book-card__cloth::before { content: ""; position: absolute; inset: 8%; border: 1px solid var(--foil-line); }
.book-card__cloth-title { position: relative; color: var(--foil-hi); font-weight: 900; font-size: 1.0625rem; line-height: 1.15; letter-spacing: -0.01em; }
.book-card__flag { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(17, 26, 38, 0.82); color: var(--foil-hi); font-size: 13px; }
.book-card__langs { position: absolute; left: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.book-card__lang { padding: 2px 6px; border-radius: 4px; background: rgba(17, 26, 38, 0.82); color: #fff; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; line-height: 1.4; }
.book-card__title { margin-top: 14px !important; font-size: 0.9375rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.book-card__author { margin-top: 3px !important; font-size: var(--t-small); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card__actions { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity 180ms var(--ease); }
.book-card__actions form { margin: 0; }
.book-card__actions .icon-btn { width: 34px; height: 34px; background: var(--paper); border: 0; font-size: 14px; }
.book-card:hover .book-card__actions, .book-card:focus-within .book-card__actions, .book-card__actions:has(.is-on) { opacity: 1; }
@media (hover: none) { .book-card__actions { opacity: 1; } }

/* --------------------------------------------------------------------------
   Home: app tour
   -------------------------------------------------------------------------- */

.app-tour { padding-bottom: var(--s-2); }
.app-tour__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--s-5); align-items: center; }
.app-tour__lead { margin-top: var(--s-2); color: var(--ink-2); font-size: 1.125rem; max-width: 40ch; }
.tour-list { list-style: none; margin: var(--s-4) 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.tour-item {
    display: block; width: 100%; padding: 20px 0; text-align: left; background: none; border: 0; border-top: 1px solid var(--line);
    color: var(--ink-3); cursor: pointer;
}
.tour-item__title { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; transition: color 200ms var(--ease); }
.tour-item__title::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--line); transition: background-color 200ms var(--ease), transform 300ms var(--ease); flex: none; }
.tour-item__text { display: grid; grid-template-rows: 0fr; margin-left: 22px; color: var(--ink-2); max-width: 46ch; transition: grid-template-rows 360ms var(--ease), margin-top 360ms var(--ease); }
.tour-item__text > span { overflow: hidden; min-height: 0; }
.tour-item:hover .tour-item__title { color: var(--ink); }
.tour-item.is-active .tour-item__title { color: var(--ink); }
.tour-item.is-active .tour-item__title::before { background: var(--gold-deep); box-shadow: 0 0 0 1px var(--ink); transform: rotate(45deg); }
.tour-item.is-active .tour-item__text { grid-template-rows: 1fr; margin-top: 8px; }

.app-tour__stage { position: relative; display: grid; place-items: center; padding: var(--s-4) 0; }
.app-tour__swatch {
    position: absolute; inset: 8% 6% 8% 14%; border-radius: 6px;
    background-color: var(--gold);
    background-image: var(--weave), linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.08));
    background-size: var(--weave-size), 100% 100%;
    background-blend-mode: soft-light, normal;
}
.app-tour__swatch::before { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(var(--shadow-rgb), 0.22); border-radius: 2px; }
.phone--tour { width: min(300px, 74%); }
.phone--tour .tour-shot { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); opacity: 0; transition: opacity 420ms var(--ease); }
.phone--tour .tour-shot.is-active { opacity: 1; }

/* --------------------------------------------------------------------------
   Home: plan (library card)
   -------------------------------------------------------------------------- */

.plan { padding-bottom: var(--s-6); }
.plan__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-5); align-items: center; }
.plan__text { margin-top: var(--s-2); max-width: 44ch; color: var(--ink-2); font-size: 1.125rem; }
.library-card {
    max-width: 460px; justify-self: end; width: 100%;
    padding: 26px 28px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 30px 50px -36px rgba(var(--shadow-rgb), 0.45);
}
.library-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding-bottom: 14px; border-bottom: 2px solid var(--ink); font-weight: 900; font-size: 1.0625rem; letter-spacing: -0.01em; }
.library-card__label { --cloth: var(--gold); padding: 7px 14px; border-radius: 3px; font-size: var(--t-small); font-weight: 900; letter-spacing: 0.02em; color: var(--on-gold); }
.library-card__rows { margin: 0; }
.library-card__row { display: flex; justify-content: space-between; gap: var(--s-2); padding: 12px 0; border-bottom: 1px dashed var(--line-strong); }
.library-card__row dt { font-weight: 500; }
.library-card__row dd { margin: 0; font-weight: 700; color: var(--ink); }
.library-card__row.is-later { border-bottom: 0; color: var(--ink-3); }
.library-card__row.is-later dd { color: var(--ink-3); font-weight: 500; }

/* --------------------------------------------------------------------------
   Footer (cloth) with app CTA
   -------------------------------------------------------------------------- */

body.beyan .footer.site-footer { background-color: var(--house); color: var(--ivory-2); padding: 0; margin: 0; }
.site-footer__cta { position: relative; padding-top: var(--s-6); padding-bottom: var(--s-5); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.cta-stack { position: absolute; right: var(--gutter); bottom: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 0; pointer-events: none; }
.cta-stack span { display: block; height: 38px; border-radius: 2px 4px 4px 2px; box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3) inset; position: relative; }
.cta-stack span::before, .cta-stack span::after { content: ""; position: absolute; top: 7px; bottom: 7px; width: 4px; border-left: 1px solid var(--foil-line); border-right: 1px solid var(--foil-line); }
.cta-stack span::before { left: 12px; }
.cta-stack span::after { right: 12px; }
@media (max-width: 1100px) { .cta-stack { display: none; } }
.site-footer__cta-title { font-size: var(--t-display); max-width: 14ch; }
.site-footer__cta-text { margin-top: var(--s-2); font-size: 1.1875rem; color: var(--ivory-2); }
.site-footer__cta .store-row { margin-top: var(--s-4); }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-4); padding-top: var(--s-5); padding-bottom: var(--s-5); }
.site-footer .brand img { height: 28px; }
.site-footer__tagline { margin-top: var(--s-2); max-width: 30ch; color: var(--ivory-2); }
.site-footer__col { display: flex; flex-direction: column; gap: 10px; }
.site-footer__col a { color: var(--ivory-2) !important; }
.site-footer__col a:hover { color: var(--foil-hi) !important; }
.site-footer__title { font-size: 0.75rem !important; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--foil) !important; margin-bottom: 6px !important; }
.site-footer__social { display: flex; gap: 10px; }
.site-footer__social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(0, 0, 0, 0.22); }
.site-footer__bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding-top: var(--s-3); padding-bottom: var(--s-3); border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: var(--t-small); }

/* --------------------------------------------------------------------------
   Catalog (books, categories, authors)
   -------------------------------------------------------------------------- */

.catalog-head { padding: var(--s-5) 0 var(--s-3); }
.catalog-head__inner { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.catalog-head__count { margin-top: 8px !important; color: var(--ink-2); font-size: var(--t-small); }
.catalog-head--cloth { margin-bottom: var(--s-3); padding: var(--s-5) 0; }
.catalog-head--cloth .catalog-head__inner { max-width: calc(var(--shell) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.catalog-head--cloth .catalog-head__title { font-size: var(--t-display); font-weight: 900; color: var(--foil); }
.catalog-head--cloth .catalog-head__count { color: var(--ivory-2); }

.sort-select { position: relative; margin: 0; }
.sort-select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.sort-select select { appearance: none; -webkit-appearance: none; height: 44px; padding: 0 42px 0 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 500 0.9375rem var(--font); cursor: pointer; }
.catalog-head--cloth .sort-select { color: var(--ivory); }
.catalog-head--cloth .sort-select select { background: rgba(0, 0, 0, 0.22); border-color: rgba(255, 255, 255, 0.16); color: var(--ivory); }
.catalog-head--cloth .sort-select select option { color: var(--ink); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 18px; margin-bottom: var(--s-3); scrollbar-width: none; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chip-row::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink) !important; font-size: 0.9375rem; font-weight: 500; white-space: nowrap; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.chip:hover { border-color: var(--line-strong); }
.chip__swatch { width: 10px; height: 14px; border-radius: 2px; background: var(--cloth); box-shadow: inset -2px 0 0 rgba(0, 0, 0, 0.2); }
.chip.is-active { background: var(--solid); border-color: var(--solid); color: var(--on-solid) !important; }

.pager { display: flex; justify-content: center; margin-top: var(--s-5); }
body.beyan .pagination { display: flex; gap: 6px; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: none; }
body.beyan .pagination > li { display: block; border: 0 !important; background: none !important; box-shadow: none !important; padding: 0; margin: 0; }
body.beyan .pagination > li > a::before, body.beyan .pagination > li > a::after, body.beyan .pagination > li > span::before, body.beyan .pagination > li > span::after { display: none; }
body.beyan .pagination > li > a, body.beyan .pagination > li > span { float: none; display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px !important; border: 1px solid var(--line); background: var(--paper) !important; color: var(--ink); font-weight: 500; margin: 0; }
body.beyan .pagination > .active > span, body.beyan .pagination > .active > a { background: var(--solid) !important; border-color: var(--solid); color: var(--on-solid); }
body.beyan .pagination > .disabled > span { color: var(--ink-3); background: transparent; }

.empty-state { padding: var(--s-6) 0; text-align: center; color: var(--ink-2); }
.empty-state__title { font-size: var(--t-title); font-weight: 900; color: var(--ink); margin-bottom: var(--s-1) !important; }
.empty-state .btn-ink { margin-top: var(--s-3); }

.cloth-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cloth-tile { position: relative; border-radius: 4px 8px 8px 4px; overflow: hidden; background-color: var(--cloth); box-shadow: var(--book-shadow);
    background-image: var(--weave), linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0) 9%);
    background-size: var(--weave-size), 100% 100%;
    background-blend-mode: soft-light, normal; }
.cloth-tile__link { display: flex; align-items: flex-end; min-height: 150px; padding: 22px 22px 20px 30px; transition: transform 300ms var(--ease); }
.cloth-tile__link::before { content: ""; position: absolute; inset: 10px 10px 10px 18px; border: 1px solid var(--foil-line); pointer-events: none; }
.cloth-tile__name { font-size: 1.375rem; line-height: 1.1; color: var(--foil-hi); }
.cloth-tile:hover .cloth-tile__link { transform: translateY(-2px); }
.cloth-tile__subs { list-style: none; margin: 0; padding: 0 22px 20px 30px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cloth-tile__subs a { color: var(--ivory-2) !important; font-size: var(--t-small); }
.cloth-tile__subs a:hover { color: var(--foil-hi) !important; }

.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s-4) var(--s-3); }
.author-card { display: flex; flex-direction: column; align-items: center; text-align: center; color: var(--ink) !important; }
.author-card__portrait { display: grid; place-items: center; width: 132px; height: 132px; border-radius: 50%; overflow: hidden; background-color: var(--cloth); box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--line); transition: transform 300ms var(--ease); }
.author-card__portrait img { width: 100%; height: 100%; object-fit: cover; }
.author-card__initial { color: var(--foil-hi); font-weight: 900; font-size: 2.75rem; }
.author-card:hover .author-card__portrait { transform: translateY(-4px); }
.author-card__name { margin-top: 16px; font-weight: 700; line-height: 1.25; }
.author-card__count { margin-top: 3px; font-size: var(--t-small); color: var(--ink-2); }
.author-head { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-5) 0 var(--s-4); }
.author-card__portrait--large { flex: none; width: 168px; height: 168px; }
.author-card__portrait--large .author-card__initial { font-size: 4rem; }
.author-head__copy .catalog-head__title { margin-top: 6px !important; font-size: var(--t-display); }
.author-head__bio { margin-top: var(--s-2); max-width: 68ch; }

/* --------------------------------------------------------------------------
   Book page
   -------------------------------------------------------------------------- */

.book-band { color: var(--ivory); }
.book-band__inner { max-width: calc(var(--shell) + 2 * var(--gutter)); margin-inline: auto; padding: var(--s-5) var(--gutter); display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.book-band__cover { position: relative; aspect-ratio: 2 / 3; border-radius: 4px 9px 9px 4px; overflow: hidden; background: rgba(0, 0, 0, 0.2); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25), 0 40px 60px -30px rgba(0, 0, 0, 0.75); }
.book-band__cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.book-band__cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 12px; background: linear-gradient(90deg, rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0.18) 45%, rgba(0, 0, 0, 0.08)); }
.book-band__meta a { color: var(--ivory) !important; text-decoration: underline !important; text-decoration-color: var(--foil-line) !important; text-underline-offset: 4px; }
.book-band__meta a:hover { color: var(--foil-hi) !important; }
.book-band__title { margin: 0 !important; font-size: clamp(2.25rem, 1.3rem + 3.2vw, 4.25rem); }
.book-band__author { margin-top: 14px !important; font-size: 1.25rem; font-weight: 500; color: var(--ivory); }
.book-band__author a { color: var(--ivory) !important; text-decoration: underline !important; text-decoration-color: var(--foil-line) !important; text-underline-offset: 5px; }
.book-band__author a:hover { color: var(--foil-hi) !important; }
.book-band__meta { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: var(--s-3) 0 0; }
.book-band__meta dt { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ivory-2); }
.book-band__meta dd { margin: 2px 0 0; font-weight: 700; font-size: 1.0625rem; }
.book-band__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: var(--s-4); }
.book-band__actions form { margin: 0; }
.share { display: flex; gap: 10px; }

.book-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-5); padding-top: var(--s-5); align-items: start; }
.book-body__label { font-size: var(--t-title); font-weight: 900; letter-spacing: -0.025em; line-height: 1.1; color: var(--ink); margin-bottom: var(--s-2) !important; }
.prose { max-width: 68ch; font-size: 1.125rem; line-height: 1.7; color: var(--ink); }
.prose p + p { margin-top: 1em; }

.app-note { position: sticky; top: 100px; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.app-note__phone { width: 96px; }
.app-note__title { color: var(--ink); font-size: 1.125rem; font-weight: 900; letter-spacing: -0.01em; line-height: 1.2; }
.app-note p { margin-top: 8px; font-size: var(--t-small); line-height: 1.5; color: var(--ink-2); }
.app-note .store-row { margin-top: 14px; flex-direction: column; gap: 8px; }
.app-note .store-btn { min-height: 46px; padding: 0 14px; gap: 10px; }
.app-note .store-btn__big { font-size: 0.9375rem; }
.app-note .store-btn__small { font-size: 0.6875rem; }

.related-books { margin-top: var(--s-5); }

/* reviews / comments tabs under the book */
.book-detail-tabs { margin-top: var(--s-5); }
body.beyan .ebook-tab .nav-tabs { border: 0; display: flex; gap: 6px; }
body.beyan .ebook-tab .nav-tabs > li { float: none; margin: 0; }
body.beyan .ebook-tab .nav-tabs > li > a { border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-weight: 500; margin: 0; padding: 9px 18px; }
body.beyan .ebook-tab .nav-tabs > li.active > a, body.beyan .ebook-tab .nav-tabs > li.active > a:hover, body.beyan .ebook-tab .nav-tabs > li.active > a:focus { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
body.beyan .ebook-tab .tab-content { padding: var(--s-3) 0 0; border: 0; background: transparent; }

/* --------------------------------------------------------------------------
   Forms, auth, account, static pages
   -------------------------------------------------------------------------- */

body.beyan .form-control, body.beyan input[type="text"], body.beyan input[type="email"], body.beyan input[type="password"], body.beyan textarea, body.beyan select.form-control {
    min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
    font: 400 1rem var(--font); box-shadow: none; padding: 10px 14px; transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
body.beyan textarea { min-height: 120px; }
body.beyan .form-control:focus, body.beyan input:focus, body.beyan textarea:focus { border-color: var(--link); box-shadow: 0 0 0 3px rgba(237, 178, 51, 0.45); outline: none; }
body.beyan .header-search__input:focus { box-shadow: none; border-color: var(--foil-line); }
body.beyan label, body.beyan .checkbox label { font-family: var(--font); font-weight: 500; color: var(--ink); }
body.beyan .form-wrapper .form-control { padding: 10px 14px !important; }
body.beyan .form-wrapper h3 { color: var(--ink); text-align: left; }
body.beyan .form-wrapper, body.beyan .form-wrapper p, body.beyan .form-wrapper span { font-family: var(--font); }
body.beyan .btn { font-family: var(--font); border-radius: 999px; font-weight: 700; }
body.beyan .btn-primary, body.beyan .btn-default.btn-primary { background: var(--solid); border-color: var(--solid); color: var(--on-solid); min-height: 46px; padding: 0 22px; }
body.beyan .btn-primary:hover, body.beyan .btn-primary:focus { background: var(--solid-hover); border-color: var(--solid-hover); color: var(--on-solid); }
body.beyan .has-error .form-control { border-color: var(--madder); }
body.beyan .error-message, body.beyan .help-block { color: var(--madder); font-size: var(--t-small); }

body.beyan .form-wrapper { max-width: 480px; margin: var(--s-5) auto 0; }
body.beyan .form-wrapper .form, body.beyan .form-page { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 60px -40px rgba(var(--shadow-rgb), 0.45); padding: 0; overflow: hidden; }
body.beyan .form-page .top-overlay { height: 10px; background-color: var(--gold); background-image: var(--weave); background-size: var(--weave-size); background-blend-mode: soft-light; }
body.beyan .form-page .form-inner { padding: 32px; background: var(--paper); color: var(--ink-2); border-color: var(--line); }
body.beyan .form-page .forgot-password { color: var(--ink-2); }
/* Legacy Bootstrap surfaces are hard-coded white/grey in app.css; route them through the tokens so dark mode reaches them. */
body.beyan :is(.panel, .panel-default > .panel-heading, .modal-content, .dropdown-menu, .well, .list-group-item, .popover, .right-actions) { background-color: var(--paper); color: var(--ink); border-color: var(--line); }
body.beyan :is(.table-striped > tbody > tr:nth-of-type(odd), .table-hover > tbody > tr:hover) { background-color: rgba(var(--shadow-rgb), 0.04); }
body.beyan .close { color: var(--ink); text-shadow: none; }
body.beyan .form-page .lotus-anim--opening { width: 120px; margin: 28px auto -8px; }
body.beyan .form-page h3, body.beyan .form-page .title { font-size: var(--t-title); font-weight: 900; letter-spacing: -0.02em; text-transform: none; text-align: left; color: var(--ink); margin: 0 0 24px; }
body.beyan .form-page .input-icon { display: none; }
body.beyan .form-page .form-control { padding: 10px 14px !important; }
body.beyan .form-wrapper .btn-login, body.beyan .form-wrapper .btn-register, body.beyan .form-wrapper .btn-primary { width: 100%; margin: 8px 0 16px; }
body.beyan .form-wrapper a { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--gold-deep); text-underline-offset: 4px; }

body.beyan .my-account { padding-top: var(--s-5); }
body.beyan .my-account .sidebar-menu ul { display: flex; flex-direction: column; gap: 4px; padding: 10px; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
body.beyan .my-account .sidebar-menu li { display: block; padding: 0; }
body.beyan .my-account .sidebar-menu li a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
body.beyan .my-account .sidebar-menu li a:hover { background: var(--page); color: var(--ink); }
body.beyan .my-account .sidebar-menu li.active a { background: var(--solid); color: var(--on-solid); }
body.beyan .my-account .content-right { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
body.beyan .table > thead > tr > th { border-bottom: 1px solid var(--line); color: var(--ink-3); font-weight: 500; font-size: var(--t-small); }
body.beyan .table > tbody > tr > td { border-top: 1px solid var(--line); vertical-align: middle; }

body.beyan .breadcrumb, body.beyan .editorial-breadcrumb { background: transparent; padding: var(--s-3) 0 0; margin: 0; font-size: var(--t-small); color: var(--ink-3); }
body.beyan .breadcrumb-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
body.beyan .breadcrumb-list > li { padding: 0; }
body.beyan .breadcrumb-list > li + li::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
body.beyan .breadcrumb a { color: var(--ink-2); }
body.beyan .breadcrumb .active { color: var(--ink); }

body.beyan .alert { border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); margin-top: var(--s-3); }
body.beyan .alert-success { border-color: var(--ok-line); background: var(--ok-bg); }
body.beyan .alert-danger { border-color: var(--bad-line); background: var(--bad-bg); }

body.beyan .page-content, body.beyan .custom-page, body.beyan .contact-wrapper { padding-top: var(--s-5); }
body.beyan .page-content h1, body.beyan .custom-page h1 { font-size: var(--t-display); font-weight: 900; letter-spacing: -0.03em; line-height: 1; margin-bottom: var(--s-4); }

/* 404 */
body.beyan .page-error { padding: var(--s-6) 0; text-align: center; }
body.beyan .page-error .lotus-anim--opening { width: 160px; margin-bottom: var(--s-3); }
body.beyan .page-error > span { display: block; font-size: clamp(6rem, 4rem + 10vw, 12rem); font-weight: 900; line-height: 0.9; letter-spacing: -0.04em; color: var(--solid); }
body.beyan .page-error > span span { color: var(--madder); }
body.beyan .page-error .col-md-4 { float: none; width: auto; margin: var(--s-3) auto 0; }
body.beyan .page-error h1 { font-size: var(--t-title); font-weight: 900; color: var(--ink); }
body.beyan .page-error h4 { margin-top: 8px; font-size: var(--t-body); font-weight: 400; color: var(--ink-2); }

/* legacy chrome that no longer has a place */
body.beyan .scroll-top, body.beyan .top-nav, body.beyan .megamenu-wrapper, body.beyan > .sidebar { display: none !important; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .main-nav { display: none; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .header-bar { flex-wrap: wrap; gap: 12px; padding-block: 12px; min-height: 0; }
    .header-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
    .header-tools { margin-left: auto; }
    .header-tools > .lang-switch, .header-link { display: none; }
    .menu-toggle { display: grid; place-items: center; }
    html { scroll-padding-top: 130px; }

    .hero-shelf__inner { grid-template-columns: 1fr; min-height: 0; padding-top: var(--s-4); gap: var(--s-4); }
    .hero-shelf__copy { padding-bottom: 0; }
    .hero-shelf__title { max-width: 11ch; }
    .shelf { --row: 420px; }
    .shelf__row { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding-top: 28px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-snap-type: x proximity; scrollbar-width: none; }
    .shelf__row::-webkit-scrollbar { display: none; }
    .shelf__phone { order: -1; margin: 0 12px 0 0; }
    .shelf__board { margin-inline: calc(-1 * var(--gutter)); }
    .spine { height: calc(var(--h) * 0.8); }

    .app-tour__grid, .plan__grid { grid-template-columns: 1fr; gap: var(--s-4); }
    .app-tour__stage { order: -1; }
    .library-card { justify-self: start; }

    .book-band__inner { grid-template-columns: 140px minmax(0, 1fr); align-items: end; gap: 22px; padding-top: var(--s-4); padding-bottom: var(--s-4); }
    .book-band__actions { grid-column: 1 / -1; }
    .book-body { grid-template-columns: 1fr; }
    .app-note { position: static; }
    .author-head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
    .header-get-app { display: none; }
    .book-grid--home .book-card:nth-child(n+7) { display: none; }
    .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) 16px; }
    .store-row { flex-direction: column; align-items: stretch; }
    .store-btn { justify-content: flex-start; }
    .book-band__inner { grid-template-columns: 1fr; }
    .book-band__cover { width: 160px; }
    .book-band__meta { gap: 10px 24px; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .site-footer__bottom { flex-direction: column; align-items: flex-start; }
    .catalog-head__inner { align-items: flex-start; flex-direction: column; }
    .author-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .author-card__portrait { width: 112px; height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 1ms !important; animation: none !important; scroll-behavior: auto !important; }
}
.spine[hidden], .book-reader[hidden] { display: none !important; }
