:root {
  color-scheme: dark;
  --bg: #070c11;
  --bg-raised: #0d141b;
  --panel: #111921;
  --panel-soft: #151e28;
  --line: rgba(160, 180, 200, .12);
  --text: #f7f8fb;
  --muted: #a2acb8;
  --muted-2: #788592;
  --blue: #2d78ff;
  --blue-bright: #5596ff;
  --sidebar: 86px;
  --header: 82px;
  --radius: 13px;
}

body.light-mode {
  --bg: #eef2f6;
  --bg-raised: #ffffff;
  --panel: #ffffff;
  --panel-soft: #e4ebf3;
  --line: rgba(32, 54, 75, .13);
  --text: #15202b;
  --muted: #596777;
  --muted-2: #718091;
  background: radial-gradient(circle at 72% -20%, #d8e8ff 0, transparent 36%), var(--bg);
}
body.light-mode .topbar, body.light-mode .sidebar { background: rgba(249, 251, 253, .92); }
body.light-mode .search-field, body.light-mode .book-card, body.light-mode .text-link, body.light-mode .meta-pill, body.light-mode .person-card, body.light-mode .author-row, body.light-mode .login-panel, body.light-mode .login-side { background: #fff; }
body.light-mode .sidebar { background: linear-gradient(180deg, #f6f9fc, #e9eff5); }
body.light-mode .nav-link:hover, body.light-mode .nav-link.active { background: #dce8f5; }
body.light-mode .search-field input, body.light-mode .search-field svg, body.light-mode .icon-button, body.light-mode .profile-trigger, body.light-mode .nav-link, body.light-mode .text-link, body.light-mode .back-link, body.light-mode .author-line, body.light-mode .duration-line, body.light-mode .meta-pill, body.light-mode .meta-pill svg, body.light-mode .eyebrow, body.light-mode .login-form label { color: var(--text); }
body.light-mode .landing-copy { background: linear-gradient(135deg, #ffffff, #edf4fb); }
body.light-mode .landing-copy p, body.light-mode .detail-copy p { color: var(--muted); }
body.light-mode .landing-stats, body.light-mode .profile-hero, body.light-mode .person-card, body.light-mode .login-side { background: #fff; }
body.light-mode .eyebrow, body.light-mode .empty-state { background: #f6f9fc; }
body.light-mode .login-form input { background: #f7fafc !important; color: var(--text) !important; }
body.light-mode .login-form input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 1000px #f7fafc inset; caret-color: var(--text); }
body.light-mode .profile-tab.active { color: var(--text); }
body.light-mode .login-avatar { background: #edf3f9; color: var(--text); border-color: var(--line); }
body.light-mode .language-selector { background: #edf3f9; border-color: var(--line); }
body.light-mode .notification-panel { background: #fff; }
body.light-mode .notification-item:hover { background: #f1f6fb; }

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 72% -20%, #122132 0, transparent 36%), var(--bg); color: var(--text); font-family: "DM Sans", system-ui, sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.app-shell { min-height: 100vh; }
.topbar { position: fixed; z-index: 20; inset: 0 0 auto; height: var(--header); display: flex; align-items: center; gap: 28px; padding: 0 28px; background: rgba(5, 9, 13, .88); border-bottom: 1px solid rgba(155, 176, 196, .06); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 168px; font-size: 25px; font-weight: 600; letter-spacing: -.04em; }
.brand-mark { width: 34px; height: 34px; object-fit: cover; border-radius: 9px; box-shadow: 0 4px 16px rgba(196, 28, 145, .2); }
.search-field { display: flex; align-items: center; gap: 15px; width: min(100%, 558px); height: 52px; padding: 0 18px; background: #10171e; border: 1px solid rgba(163, 185, 211, .08); border-radius: 13px; color: var(--muted); }
.search-field svg { width: 22px; color: #f4f7fb; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.search-field input::placeholder { color: #9ba6b3; }
.top-actions { display: flex; align-items: center; gap: 21px; margin-left: auto; }
.icon-button, .profile-trigger { display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; }
.icon-button { width: 30px; height: 42px; color: #f1f3f7; }
.icon-button.active-icon { width: 40px; height: 40px; border-radius: 50%; background: #1d2b40; color: var(--blue-bright); }
.icon-button svg { width: 25px; height: 25px; }
.notification-wrap { position: relative; display: inline-flex; }
.notification-button { position: relative; }
.notification-badge { position: absolute; top: 2px; right: -3px; display: grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; border: 2px solid var(--bg); border-radius: 999px; background: #e4374f; color: #fff; font-size: 9px; font-weight: 700; line-height: 1; }
.notification-panel { position: absolute; top: calc(100% + 12px); right: -10px; z-index: 40; width: min(360px, calc(100vw - 30px)); max-height: min(500px, calc(100vh - 110px)); overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 15px; background: #101921; box-shadow: 0 18px 45px rgba(0,0,0,.38); }
.notification-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 4px 5px 11px; border-bottom: 1px solid var(--line); }
.notification-heading span { color: var(--muted); font-size: 12px; }
.notification-list { display: grid; gap: 4px; padding-top: 6px; }
.notification-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) 16px; align-items: center; gap: 9px; padding: 10px 7px; border-radius: 10px; }
.notification-item:hover { background: #182632; }
.notification-item-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--blue-bright); background: rgba(45,120,255,.14); }
.notification-item-icon svg { width: 17px; height: 17px; }
.notification-item strong, .notification-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-item strong { font-size: 13px; }
.notification-item small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.notification-item > svg { width: 15px; height: 15px; color: var(--muted); }
.notification-empty { margin: 0; padding: 18px 6px 8px; color: var(--muted); font-size: 13px; }
.form-link { color: var(--blue-bright); font-size: 13px; font-weight: 600; }
.profile-trigger { gap: 11px; padding: 4px 0 4px 4px; font-size: 16px; white-space: nowrap; }
.profile-trigger svg { width: 17px; }
.language-selector { display: inline-flex; align-items: center; justify-content: center; }
.language-toggle { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; perspective: 700px; }
.language-toggle-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.75,.25,1); }
.language-toggle.is-english .language-toggle-inner { transform: rotateY(180deg); }
.language-flag { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: #121c27; box-shadow: 0 4px 14px rgba(0,0,0,.2); font-size: 22px; line-height: 1; backface-visibility: hidden; }
.language-flag-en { transform: rotateY(180deg); }
.language-toggle:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 3px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; overflow: hidden; border-radius: 50%; color: white; font-weight: 700; background: linear-gradient(145deg, #e7e9ed, #232b35 62%, #070a0e); border: 1px solid rgba(255,255,255,.25); }
.avatar-reader { background: radial-gradient(circle at 50% 30%, #5c6673 0 14%, transparent 15%), radial-gradient(circle at 50% 80%, #11151c 0 32%, transparent 33%), linear-gradient(145deg, #f7f8fa, #5d6875); color: transparent; }
.login-avatar { background: #121a22; color: #eaf1fb; }
.login-avatar svg { width: 23px; height: 23px; }

.sidebar { position: fixed; z-index: 12; top: var(--header); bottom: 0; left: 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 22px 14px; background: linear-gradient(180deg, #091016, #080d12); border-right: 1px solid rgba(154, 178, 203, .08); }
.side-nav { display: grid; gap: 5px; }
.nav-link { position: relative; display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; padding: 0; border-radius: 10px; color: #edf1f5; font-size: 16px; transition: background .2s, color .2s; }
.nav-link svg { width: 25px; height: 25px; }
.nav-link span { position: absolute; left: calc(100% + 10px); top: 50%; z-index: 30; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: #111b25; color: #f5f8fc; font-size: 14px; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-5px, -50%); transition: opacity .16s ease, transform .16s ease; box-shadow: 0 10px 24px rgba(0,0,0,.24); }
.nav-link:hover, .nav-link:focus-visible { background: #151e28; color: #fff; }
.nav-link:hover span, .nav-link:focus-visible span { opacity: 1; transform: translate(0, -50%); }
.nav-link.active { background: linear-gradient(100deg, #212a3c, #1a2130); }
.main-content { min-height: 100vh; padding: calc(var(--header) + 34px) 42px 60px calc(var(--sidebar) + 48px); outline: none; }

.landing-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 320px); gap: 24px; align-items: stretch; max-width: 1200px; margin: 0 auto 34px; }
.landing-copy { padding: clamp(24px, 5vw, 54px); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, rgba(17, 25, 33, .94), rgba(10, 16, 22, .96)), radial-gradient(circle at 80% 25%, rgba(45, 120, 255, .24), transparent 32%); }
.landing-copy h1 { margin: 0; font-size: clamp(38px, 7vw, 82px); line-height: .95; letter-spacing: -.06em; }
.landing-copy p { max-width: 720px; margin: 18px 0 0; color: #c7d0db; font-size: clamp(16px, 2vw, 20px); line-height: 1.55; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.landing-stats { display: grid; place-items: center; min-height: 260px; padding: 24px; text-align: center; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #111b25, #0b1218); }
.landing-stats strong, .login-side strong { display: block; font-size: clamp(58px, 8vw, 96px); line-height: .85; letter-spacing: -.08em; }
.landing-stats span, .login-side span { display: block; max-width: 210px; margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.45; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 17px; }
.section-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.045em; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.section-heading .section-copy { min-width: 0; }
.text-link { display: inline-flex; align-items: center; gap: 13px; padding: 10px 14px; border-radius: 10px; background: #121a22; color: #f0f3f7; font-size: 14px; white-space: nowrap; }
.text-link:hover { background: #1b2733; }
.text-link svg { width: 16px; height: 16px; }
.book-shelf { position: relative; margin-bottom: 31px; }
.shelf-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 205px); grid-template-rows: 1fr; gap: 18px; overflow-x: auto; overscroll-behavior-inline: contain; padding: 0 1px 8px; scrollbar-width: thin; scrollbar-color: #2a3948 transparent; }
.shelf-track.search-results { grid-auto-flow: initial; grid-auto-columns: initial; grid-template-columns: repeat(auto-fill, minmax(160px, 205px)); align-items: start; overflow-x: visible; }
.shelf-track::-webkit-scrollbar { height: 5px; }
.shelf-track::-webkit-scrollbar-thumb { background: #2a3948; border-radius: 5px; }
.book-card { min-width: 0; overflow: hidden; background: linear-gradient(180deg, #151e27, #10171e); border: 1px solid rgba(165, 186, 209, .06); border-radius: 10px; transition: transform .2s, border .2s, box-shadow .2s; }
.book-card:hover { transform: translateY(-3px); border-color: rgba(92, 151, 255, .4); box-shadow: 0 14px 30px rgba(0,0,0,.25); }
.book-card-link { position: relative; display: block; }
.book-card.is-locked .cover::after { background: linear-gradient(180deg, rgba(5,9,13,.18) 10%, rgba(5,9,13,.86) 100%); }
.lock-badge { position: absolute; top: 10px; right: 10px; z-index: 3; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; background: rgba(5, 10, 15, .78); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); }
.lock-badge svg { width: 18px; height: 18px; }
.cover { position: relative; aspect-ratio: .76; overflow: hidden; display: flex; align-items: end; padding: 15px 11px; background: linear-gradient(135deg, #304e69, #bd6d36 62%, #402018); isolation: isolate; }
.cover::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--cover-image) center/cover; opacity: 1; mix-blend-mode: normal; }
.cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(5,9,13,.02) 25%, rgba(5,9,13,.78) 100%); }
.cover.has-artwork::after { display: none; }
.cover[data-variant="stone"] { background: linear-gradient(145deg, #8b765e, #312719); }
.cover[data-variant="gold"] { background: linear-gradient(145deg, #b8802f, #241810 80%); }
.cover[data-variant="night"] { background: linear-gradient(145deg, #375366, #101c28 60%, #17100d); }
.cover[data-variant="fire"] { background: linear-gradient(145deg, #d95f1e, #271312 80%); }
.cover[data-variant="mountain"] { background: linear-gradient(145deg, #566d78, #202f3f 60%, #121a1a); }
.cover[data-variant="sand"] { background: linear-gradient(145deg, #bf915e, #3b2416 77%); }
.cover-title { align-self: center; width: 100%; margin-top: auto; text-align: center; color: #fcf8ee; font-family: "Libre Baskerville", serif; font-size: clamp(13px, 1.5vw, 19px); line-height: 1.25; letter-spacing: .03em; text-transform: uppercase; text-shadow: 0 2px 10px rgba(0,0,0,.45); }
.cover-author { position: absolute; bottom: 9px; left: 0; width: 100%; text-align: center; color: rgba(255,255,255,.8); font-family: "Libre Baskerville", serif; font-size: 8px; letter-spacing: .15em; text-transform: uppercase; }
.cover.has-artwork .cover-title, .cover.has-artwork .cover-author { display: none !important; }
.media-badge { position: absolute; right: 9px; bottom: 8px; z-index: 2; display: flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 50%; background: #0a1118; color: #fff; border: 1px solid rgba(255,255,255,.15); }
.media-badge svg { width: 17px; height: 17px; }
.card-details { padding: 10px 11px 11px; }
.card-title { overflow: hidden; margin: 0; font-size: 14px; font-weight: 500; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.card-author { overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { display: grid; place-items: center; min-height: 390px; padding: 30px; text-align: center; border: 1px dashed rgba(155, 180, 209, .2); border-radius: 16px; background: #0b1218; }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 11px; font-weight: 600; }
.primary-button { background: var(--blue); color: white; }
.primary-button:hover { background: var(--blue-bright); }
.secondary-button { background: var(--panel-soft); border: 1px solid var(--line); }

.detail-page { max-width: 1220px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 20px; color: #e5ebf1; font-size: 14px; }
.back-link svg { width: 20px; }
.detail-layout { display: grid; grid-template-columns: minmax(230px, 410px) minmax(0, 1fr); gap: 55px; align-items: start; }
.detail-cover { max-width: 410px; width: 100%; justify-self: center; overflow: hidden; border-radius: 15px; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.detail-cover .cover-title { font-size: clamp(21px, 2.4vw, 34px); }
.detail-cover .cover-author { font-size: 11px; bottom: 18px; }
.detail-info { padding-top: 0; }
.eyebrow { display: inline-flex; padding: 9px 14px; margin-bottom: 16px; border-radius: 20px; background: #141c24; color: #dfe7f1; font-size: 13px; }
.detail-info h1 { margin: 0; font-size: clamp(30px, 4vw, 55px); line-height: 1.05; letter-spacing: -.06em; }
.author-line { margin: 17px 0 20px; color: #d3d9e0; font-size: 18px; }
.author-line a { color: #27a5ff; }
.meta-grid { display: flex; flex-wrap: wrap; gap: 11px; margin-bottom: 26px; }
.meta-pill { display: inline-flex; align-items: center; gap: 10px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: #101820; color: #e3e8ee; font-size: 14px; }
.meta-pill svg { width: 20px; height: 20px; color: #dfe5eb; }
.duration-line { display: flex; align-items: center; gap: 12px; margin: 0 0 23px; color: #e6ebf0; }
.duration-line svg { width: 22px; }
.listen-button { width: min(100%, 400px); height: 58px; margin-bottom: 32px; font-size: 18px; }
.listen-button svg { width: 21px; fill: currentColor; stroke: none; }
.book-primary-action { display: grid; align-items: start; width: min(100%, 400px); margin-bottom: 30px; }
.book-primary-action .listen-button { margin-bottom: 0; }
.book-action-page-count { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.book-action-page-count svg { width: 17px; height: 17px; }
.icon-action-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-soft); color: var(--muted); }
.icon-action-button:hover, .icon-action-button[aria-pressed="true"] { border-color: rgba(85,150,255,.65); background: rgba(45,120,255,.16); color: var(--blue-bright); }
.icon-action-button svg { width: 20px; height: 20px; }
.book-engagement { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: min(100%, 400px); margin: 0 0 30px; }
.book-engagement .book-reactions { width: auto; margin: 0; }
.save-book-button { flex: 0 0 44px; margin: 0; }
.resume-hint { margin-top: 8px; color: var(--muted); font-size: 12px; }
.book-reactions { display: flex; flex-wrap: wrap; gap: 10px; width: min(100%, 400px); margin: -10px 0 30px; }
.reaction-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); color: var(--muted); }
.reaction-button svg { width: 18px; height: 18px; }
.reaction-button strong { min-width: 1.2em; color: var(--text); font-size: 13px; text-align: center; }
.reaction-button:hover, .reaction-button.active { border-color: rgba(85,150,255,.65); background: rgba(45,120,255,.16); color: var(--blue-bright); }
.reaction-button.active strong { color: var(--blue-bright); }
.detail-copy h3 { margin: 0 0 10px; font-size: 18px; }
.detail-copy p { max-width: 760px; margin: 0; color: #c8d0d9; font-size: 16px; line-height: 1.65; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 27px; }
.person-card { padding: 18px; background: #0e161e; border: 1px solid var(--line); border-radius: 14px; }
.person-card h3 { margin: 0 0 8px; font-size: 17px; }
.person-card p { margin: 0 0 16px; color: var(--muted); }

.page-title { max-width: 1200px; margin: 0 auto 28px; }
.page-title h1 { margin: 0; font-size: 34px; letter-spacing: -.06em; }
.page-title p { margin: 7px 0 0; color: var(--muted); }
.filter-bar { display: flex; gap: 8px; margin: 0 auto 24px; max-width: 1200px; overflow-x: auto; }
.filter-chip { padding: 9px 14px; border: 1px solid var(--line); border-radius: 20px; background: transparent; color: var(--muted); white-space: nowrap; }
.filter-chip.active, .filter-chip:hover { background: #1d2b40; border-color: #2c5b98; color: white; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; max-width: 1200px; margin: 0 auto; }

.profile-page { max-width: 930px; margin: 0 auto; }
.profile-hero { display: flex; align-items: center; gap: 21px; padding: 27px; margin-bottom: 25px; background: linear-gradient(135deg, #121d29, #0e151d); border: 1px solid var(--line); border-radius: 17px; }
.profile-hero > div { min-width: 0; }
.profile-hero .avatar { width: 82px; height: 82px; font-size: 27px; }
.profile-hero h1 { margin: 0; font-size: 30px; letter-spacing: -.05em; }
.profile-avatar-button { position: relative; flex: 0 0 auto; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.profile-avatar-button .avatar { display: flex; }
.profile-avatar-button:hover .profile-edit-badge, .profile-avatar-button:focus-visible .profile-edit-badge { opacity: 1; }
.profile-avatar-button:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 4px; }
.profile-edit-badge { position: absolute; right: -2px; bottom: 1px; display: grid; place-items: center; width: 25px; height: 25px; border: 2px solid var(--panel); border-radius: 50%; background: var(--blue); color: #fff; font-size: 14px; opacity: .9; }
.avatar-image { background: #1a2632; }
.avatar-image img { width: 100%; height: 100%; object-fit: cover; }
.profile-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.profile-logout { white-space: nowrap; }
.profile-edit-form { display: grid; gap: 15px; padding: 20px; margin: -10px 0 25px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.profile-edit-form label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
.profile-edit-form input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-raised); color: var(--text); }
.profile-edit-form input[type="file"] { padding: 10px 12px; }
.profile-edit-form small { color: var(--muted); font-size: 12px; }
.profile-edit-actions { display: flex; gap: 10px; }
.profile-tabs { display: flex; gap: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.profile-tab { padding: 0 0 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); }
.profile-tab.active { border-color: var(--blue); color: white; }
.author-list { display: grid; gap: 13px; }
.author-row { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 13px; background: #0f171f; border: 1px solid var(--line); }
.author-row .avatar { width: 48px; height: 48px; background: linear-gradient(145deg, #385879, #111820); }
.author-row strong { display: block; }
.author-row span { color: var(--muted); font-size: 13px; }

.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: 330px; padding: 13px 16px; border-radius: 10px; background: #eaf2ff; color: #12233a; font-size: 14px; box-shadow: 0 12px 35px rgba(0,0,0,.35); transform: translateY(20px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

.login-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 24px; align-items: stretch; max-width: 980px; margin: 0 auto; }
.login-panel, .login-side { border: 1px solid var(--line); border-radius: 18px; background: #0f171f; }
.login-panel { padding: clamp(24px, 5vw, 46px); }
.login-panel h1 { max-width: 620px; margin: 0; font-size: clamp(34px, 5vw, 58px); line-height: 1; letter-spacing: -.06em; }
.login-panel p { color: var(--muted); line-height: 1.55; }
.login-form { display: grid; gap: 15px; max-width: 440px; margin-top: 24px; }
.login-form label { display: grid; gap: 7px; color: #dce5ef; font-size: 14px; }
.login-form input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #091118; color: var(--text); outline: 0; }
.login-form input:focus { border-color: rgba(85, 150, 255, .7); box-shadow: 0 0 0 3px rgba(45, 120, 255, .18); }
.login-form .primary-button { width: 100%; margin-top: 4px; }
.form-note { margin: 0; font-size: 12px; }
.auth-switch { margin: 0; font-size: 14px; }
.auth-switch a { color: var(--blue-bright); font-weight: 700; }
.login-side { display: grid; place-items: center; padding: 24px; text-align: center; background: linear-gradient(145deg, #101a25, #0b1218); }

@media (max-width: 1060px) {
  .topbar { gap: 15px; padding: 0 20px; }
  .brand { flex-basis: auto; }
  .search-field { max-width: 440px; }
  .main-content { padding-left: calc(var(--sidebar) + 28px); padding-right: 28px; }
  .top-actions { gap: 11px; }
  .language-toggle { width: 36px; height: 36px; }
  .detail-layout { gap: 35px; }
  .landing-hero { grid-template-columns: 1fr; }
  .landing-stats { min-height: 180px; }
}
@media (max-width: 760px) {
  :root { --header: 70px; }
  .topbar { gap: 14px; padding: 0 15px; }
  .brand { gap: 7px; font-size: 20px; }
  .brand-mark { width: 29px; }
  .search-field { order: 3; flex: 1 1 100%; width: auto; max-width: none; height: 43px; }
  .topbar { flex-wrap: wrap; height: auto; min-height: var(--header); padding-bottom: 12px; }
  .top-actions { margin-left: auto; gap: 5px; }
  .hide-small { display: none; }
  .language-selector { order: 4; flex: 1 1 100%; justify-content: center; }
  .profile-name, .profile-trigger > svg { display: none; }
  .profile-trigger { padding-left: 6px; }
  .sidebar { top: var(--header); width: var(--sidebar); }
  .main-content { padding: calc(var(--header) + 74px) 16px 40px calc(var(--sidebar) + 16px); }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 21px; }
  .section-heading p { font-size: 13px; }
  .text-link { padding: 8px; font-size: 0; }
  .text-link svg { margin: 0; }
  .shelf-track { grid-auto-columns: 153px; gap: 12px; }
  .shelf-track.search-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; gap: 28px; }
  .detail-cover { width: min(100%, 310px); }
  .detail-info h1 { font-size: 35px; }
  .people-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .page-title h1 { font-size: 29px; }
  .profile-hero { padding: 20px; }
  .profile-hero { align-items: flex-start; flex-wrap: wrap; }
  .profile-actions { width: 100%; margin-left: 0; }
  .profile-actions .secondary-button { flex: 1; }
  .login-page { grid-template-columns: 1fr; }
  .landing-copy { padding: 24px; }
  .landing-actions .primary-button, .landing-actions .secondary-button { width: 100%; }
}
@media (min-width: 761px) and (max-width: 900px) {
  .shelf-track { grid-auto-columns: 175px; gap: 14px; }
  .shelf-track.search-results { grid-template-columns: repeat(auto-fill, minmax(160px, 175px)); }
  .detail-layout { grid-template-columns: minmax(220px, 360px) minmax(0, 1fr); gap: 28px; }
  .detail-cover { max-width: 360px; }
}
@media (max-width: 420px) {
  .topbar { gap: 9px; }
  .profile-trigger .avatar { width: 36px; height: 36px; }
  .book-grid { gap: 10px; }
}
