:root {
	--color-green: #147a73;
	--color-yellow: #f4ad3d;
	--color-red: #ed5f62;
	--color-text: #202b29;
	--color-background: #ffffff;
	--color-surface: #ffffff;
	--color-muted: #596764;
	--color-line: #dbe4df;
	--color-neutral: #f6f8f6;
	--kp-home-ink: var(--color-text);
	--kp-home-muted: var(--color-muted);
	--kp-home-teal: var(--color-green);
	--kp-home-teal-dark: var(--color-green);
	--kp-home-coral: var(--color-red);
	--kp-home-coral-dark: var(--color-red);
	--kp-home-coral-light: var(--color-red);
	--kp-home-coral-on: var(--color-surface);
	--kp-home-gold: var(--color-yellow);
	--kp-home-gold-soft: var(--color-yellow);
	--kp-home-cream: var(--color-background);
	--kp-home-warm: var(--color-background);
	--kp-home-peach: var(--color-background);
	--kp-home-mint: var(--color-neutral);
	--kp-home-mint-strong: var(--color-neutral);
	--kp-home-green-on: var(--color-green);
	--kp-home-white: var(--color-surface);
	--kp-home-line: var(--color-line);
	--kp-home-line-strong: var(--color-line);
	--kp-telegram-action: var(--color-green);
	--kp-home-shadow: 0 18px 50px rgba(0, 0, 0, .08);
}

body.knigopolka-home {
	--kp-ink: var(--color-text);
	--kp-muted: var(--color-muted);
	--kp-paper: var(--color-surface);
	--kp-green: var(--color-green);
	--kp-soft: var(--color-neutral);
	--kp-line: var(--color-line);
	--kp-coral: var(--color-red);
	--kp-cream: var(--color-background);
	--kp-teal: var(--color-green);
	margin: 0;
	background: var(--kp-home-cream);
	color: var(--kp-home-ink);
	font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.knigopolka-home *, .knigopolka-home *::before, .knigopolka-home *::after { box-sizing: border-box; }
.knigopolka-home img { max-width: 100%; height: auto; }
.knigopolka-home a { color: inherit; }
.kp-container { width: min(1160px, calc(100% - 40px)); margin-inline: auto; }
.kp-skip-link { position: fixed; z-index: 99999; top: 8px; left: 8px; transform: translateY(-150%); border-radius: 10px; background: var(--kp-home-white); padding: 10px 14px; font-weight: 700; }
.kp-skip-link:focus { transform: translateY(0); }

.kp-site-header {
	position: sticky;
	z-index: 100;
	top: 0;
	border-bottom: 1px solid var(--kp-home-line);
	background: var(--kp-home-white);
	backdrop-filter: blur(16px);
}
.admin-bar .kp-site-header { top: 32px; }
.kp-header-inner { display: flex; min-height: 78px; align-items: center; gap: 34px; }
.kp-brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; color: var(--kp-home-teal); font-size: 1.34rem; font-weight: 800; letter-spacing: -.035em; text-decoration: none; }
.kp-brand img { width: 46px; height: 46px; border-radius: 13px; }
.kp-brand strong, .kp-footer-brand span { color: var(--kp-home-coral); }
.kp-desktop-nav { display: flex; flex: 1; align-items: center; justify-content: center; gap: 28px; }
.kp-desktop-nav a { color: var(--kp-home-ink); font-size: .94rem; font-weight: 700; text-decoration: none; }
.kp-desktop-nav a:hover { color: var(--kp-home-coral); }
.kp-account { display: inline-flex; max-width: 220px; align-items: center; gap: 9px; color: var(--kp-home-ink); font-size: .9rem; font-weight: 750; text-decoration: none; }
.kp-account > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-account-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; overflow: hidden; border-radius: 50%; background: var(--kp-home-mint); color: var(--kp-home-teal); text-transform: uppercase; }
.kp-account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kp-login-link { display: inline-flex; min-height: 42px; flex: 0 0 auto; align-items: center; border: 1px solid var(--kp-home-teal); border-radius: 999px; padding: 0 17px; color: var(--kp-home-teal); font-size: .88rem; font-weight: 800; text-decoration: none; }

.kp-hero { position: relative; overflow: hidden; padding: 72px 0 92px; background: var(--kp-home-white); }
.kp-hero::before { display: none; }
.kp-hero-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(360px, .96fr); align-items: center; gap: 56px; }
.kp-hero-copy { position: relative; z-index: 2; }
.kp-kicker { margin: 0 0 10px; color: var(--kp-home-teal); font-size: .78rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.kp-hero h1 { max-width: 680px; margin: 0; font-size: clamp(2.7rem, 5.2vw, 5.2rem); line-height: .98; letter-spacing: -.065em; }
.kp-slogan { margin: 25px 0 0; color: var(--kp-home-coral); font-size: clamp(1.25rem, 2vw, 1.72rem); font-weight: 800; }
.kp-hero-text { max-width: 620px; margin: 14px 0 0; color: var(--kp-home-muted); font-size: 1.12rem; line-height: 1.65; }
.kp-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.kp-primary-button, .kp-secondary-button, .kp-light-button, .kp-telegram-button { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; border: 0; border-radius: 14px; padding: 0 23px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.kp-primary-button { background: var(--kp-home-coral); color: var(--kp-home-white) !important; box-shadow: 0 10px 24px rgba(0, 0, 0, .10); }
.kp-primary-button:hover { background: var(--kp-home-coral-dark); transform: translateY(-2px); filter: brightness(.94); }
.kp-secondary-button { border: 1px solid var(--kp-home-teal); background: var(--kp-home-white); color: var(--kp-home-teal) !important; }
.kp-secondary-button:hover { background: var(--kp-home-white); transform: translateY(-2px); }
.kp-hero-visual { position: relative; display: grid; min-height: 510px; place-items: center; }
.kp-hero-visual img { position: relative; z-index: 2; width: min(100%, 520px); border: 1px solid var(--kp-home-line); border-radius: 40px; box-shadow: var(--kp-home-shadow); }
.kp-hero-shape { position: absolute; border-radius: 50%; }
.kp-shape-one, .kp-shape-two { display: none; }

.kp-search-section { position: relative; z-index: 5; margin-top: -42px; }
.kp-search-section .knigopolka-book-search { box-shadow: var(--kp-home-shadow); }
.kp-home-search { border: 1px solid var(--kp-home-line); border-radius: 22px; background: var(--kp-home-white); padding: 22px; box-shadow: var(--kp-home-shadow); }
.kp-home-search > label { display: block; margin: 0 0 12px; font-size: 1.05rem; font-weight: 850; }
.kp-search-control { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px; border: 1px solid var(--kp-home-line-strong); border-radius: 15px; background: var(--kp-home-white); padding: 6px 7px 6px 16px; }
.kp-search-control svg { width: 22px; fill: none; stroke: var(--kp-home-teal); stroke-linecap: round; stroke-width: 1.8; }
.kp-search-control input { min-width: 0; min-height: 44px; border: 0; outline: 0; background: transparent; color: var(--kp-home-ink); font: inherit; font-size: 1rem; }
.kp-search-control button { min-height: 44px; border: 0; border-radius: 11px; background: var(--kp-home-teal); padding: 0 23px; color: var(--kp-home-white); font: inherit; font-weight: 800; cursor: pointer; }

.kp-section { padding: 76px 0; }
.kp-section:nth-of-type(even) { background: var(--kp-home-white); }
.kp-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.kp-section-heading h2, .kp-nearby-grid h2, .kp-owner-cta h2, .kp-personal-card h2 { margin: 0; font-size: clamp(1.85rem, 3vw, 2.65rem); line-height: 1.08; letter-spacing: -.045em; }
.kp-section-heading p:not(.kp-kicker), .kp-nearby-grid > div > p:not(.kp-kicker), .kp-owner-cta p, .kp-personal-card p { max-width: 690px; margin: 10px 0 0; color: var(--kp-home-muted); line-height: 1.6; }
.kp-section-heading > a { flex: 0 0 auto; color: var(--kp-home-teal); font-weight: 800; text-decoration: none; }
.kp-section-heading > a:hover { color: var(--kp-home-coral); }

.kp-quick-section { padding-top: 68px; }
.kp-quick-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 14px; border: 1px solid var(--kp-home-line); border-radius: 22px; background: var(--kp-home-mint); padding: 24px; }
.kp-quick-form label { display: grid; gap: 8px; font-weight: 800; }
.kp-quick-form label span { font-size: .86rem; }
.kp-quick-form select { width: 100%; min-height: 52px; border: 1px solid var(--kp-home-line-strong); border-radius: 13px; background: var(--kp-home-white); padding: 0 14px; color: var(--kp-home-ink); font: inherit; }

.kp-book-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.kp-book-row .knigopolka-book-card { min-width: 0; border-color: var(--kp-home-line); border-radius: 22px; background: var(--kp-home-white); box-shadow: 0 12px 34px rgba(0, 0, 0, .06); transition: transform .2s ease, box-shadow .2s ease; }
.kp-book-row .knigopolka-book-card:hover { transform: translateY(-4px); box-shadow: var(--kp-home-shadow); }
.kp-book-row .knigopolka-cover { min-height: 0; aspect-ratio: 2 / 3; background: var(--kp-home-mint); }
.kp-book-row .knigopolka-cover img { aspect-ratio: auto; object-fit: contain; }
.kp-book-row .knigopolka-card-body { padding: 19px; }
.kp-book-row .knigopolka-book-card h2 { font-size: 1.22rem; }
.kp-book-row .knigopolka-card-footer { padding-top: 14px; border-top: 1px solid var(--kp-home-line); }
.kp-book-row .knigopolka-card-footer strong { color: var(--kp-home-coral); }
.kp-book-row .knigopolka-card-footer span { color: var(--kp-home-muted); font-size: .86rem; }
.kp-book-row .knigopolka-wishlist-button { border-color: var(--kp-home-teal); color: var(--kp-home-teal) !important; }
.kp-book-row .knigopolka-card-offer-link { background: var(--kp-home-mint); color: var(--kp-home-teal); }
.kp-empty-state { display: flex; min-height: 150px; align-items: center; justify-content: space-between; gap: 20px; border: 1px dashed var(--kp-home-line-strong); border-radius: 20px; background: var(--kp-home-white); padding: 28px; }
.kp-empty-state p { margin: 0; color: var(--kp-home-muted); }
.kp-empty-state a { color: var(--kp-home-teal); font-weight: 800; }

.kp-free-section { background: var(--kp-home-white) !important; }
.kp-nearby-section { border-block: 1px solid var(--kp-home-line); background: var(--kp-home-white) !important; color: var(--kp-home-ink); }
.kp-nearby-grid { display: grid; grid-template-columns: .75fr 1.25fr; align-items: start; gap: 64px; }
.kp-nearby-section .kp-kicker { color: var(--kp-home-teal); }
.kp-nearby-section .kp-nearby-grid > div > p { color: var(--kp-home-muted); }
.kp-districts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.kp-districts a { display: flex; min-height: 58px; align-items: center; justify-content: space-between; border: 1px solid var(--kp-home-line); border-radius: 14px; background: var(--kp-home-white); padding: 0 17px; color: var(--kp-home-ink); font-weight: 750; text-decoration: none; }
.kp-districts a:hover { border-color: var(--kp-home-teal); }
.kp-districts span { color: var(--kp-home-teal); font-size: 1.25rem; }

.kp-how-section { background: var(--kp-home-white) !important; }
.kp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.kp-steps article { border: 1px solid var(--kp-home-line); border-radius: 20px; background: var(--kp-home-white); padding: 25px; }
.kp-steps article > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--kp-home-coral); color: var(--kp-home-white); font-weight: 900; }
.kp-steps article:nth-child(2) > span { background: var(--kp-home-gold); color: var(--kp-home-ink); }
.kp-steps article:nth-child(3) > span { background: var(--kp-home-teal); }
.kp-steps h3 { margin: 20px 0 8px; font-size: 1.18rem; }
.kp-steps p { margin: 0; color: var(--kp-home-muted); line-height: 1.55; }

.kp-owner-cta { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 38px; overflow: hidden; border-radius: 28px; background: var(--kp-home-teal); padding: 44px; color: var(--kp-home-white); box-shadow: var(--kp-home-shadow); }
.kp-owner-cta::after { position: absolute; width: 190px; height: 190px; right: -70px; top: -100px; border: 32px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; }
.kp-owner-cta .kp-kicker, .kp-owner-cta p { color: var(--kp-home-coral-on); }
.kp-owner-cta > div:last-child { position: relative; z-index: 2; display: grid; justify-items: center; gap: 9px; }
.kp-light-button { background: var(--kp-home-white); color: var(--kp-home-teal) !important; box-shadow: 0 10px 26px rgba(0, 0, 0, .12); }
.kp-owner-cta small { color: var(--kp-home-coral-on); }

.kp-personal-section { padding-top: 0; }
.kp-personal-card { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 42px; border: 1px solid var(--kp-home-line); border-radius: 25px; background: var(--kp-home-white); padding: 34px; box-shadow: 0 12px 35px rgba(0,0,0,.06); }
.kp-personal-links { display: grid; gap: 9px; }
.kp-personal-links a { display: flex; min-height: 52px; align-items: center; justify-content: space-between; border-radius: 13px; background: var(--kp-home-mint); padding: 0 16px; color: var(--kp-home-teal); font-weight: 800; text-decoration: none; }
.kp-personal-links a:hover { background: var(--kp-home-mint-strong); }
.kp-join-card { grid-template-columns: 1fr auto; }
.kp-telegram-button { background: var(--kp-telegram-action); color: var(--kp-home-white) !important; }

.kp-site-footer { border-top: 1px solid var(--kp-home-line); background: var(--kp-home-white); padding: 46px 0 54px; }
.kp-footer-grid { display: grid; grid-template-columns: 1.1fr 1fr auto; align-items: start; gap: 40px; }
.kp-footer-brand strong { color: var(--kp-home-teal); font-size: 1.35rem; }
.kp-footer-brand p { margin: 7px 0 0; color: var(--kp-home-muted); }
.kp-site-footer nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.kp-site-footer nav a, .kp-parent-project { color: var(--kp-home-ink); font-size: .9rem; font-weight: 700; text-decoration: none; }
.kp-parent-project { color: var(--kp-home-teal); }
.kp-bottom-nav { display: none; }

.kp-primary-button:focus-visible, .kp-secondary-button:focus-visible, .kp-light-button:focus-visible, .kp-telegram-button:focus-visible, .kp-site-header a:focus-visible, .kp-bottom-nav a:focus-visible, .kp-home-search input:focus-visible, .kp-home-search button:focus-visible, .kp-quick-form select:focus-visible { outline: 3px solid var(--kp-home-gold); outline-offset: 3px; }

@media (max-width: 960px) {
	.kp-desktop-nav { gap: 15px; }
	.kp-hero-grid { grid-template-columns: 1fr .78fr; gap: 25px; }
	.kp-hero-visual { min-height: 390px; }
	.kp-book-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
	.admin-bar .kp-site-header { top: 46px; }
	.kp-container { width: min(100% - 30px, 620px); }
	.kp-site-header { position: relative; top: 0 !important; }
	.kp-header-inner { min-height: 68px; }
	.kp-brand { font-size: 1.14rem; }
	.kp-brand img { width: 40px; height: 40px; border-radius: 11px; }
	.kp-desktop-nav { display: none; }
	.kp-account { margin-left: auto; }
	.kp-account > span:last-child { display: none; }
	.kp-login-link { min-height: 38px; margin-left: auto; padding: 0 12px; font-size: .76rem; }
	.kp-hero { padding: 46px 0 76px; }
	.kp-hero-grid { display: flex; flex-direction: column; gap: 32px; }
	.kp-hero h1 { font-size: clamp(2.55rem, 12vw, 4rem); }
	.kp-hero-text { font-size: 1rem; }
	.kp-hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
	.kp-primary-button, .kp-secondary-button, .kp-light-button, .kp-telegram-button { min-height: 50px; padding-inline: 16px; }
	.kp-hero-visual { min-height: 0; }
	.kp-hero-visual img { width: min(86vw, 410px); border-radius: 30px; }
	.kp-shape-one { width: 300px; height: 300px; }
	.kp-shape-two { width: 95px; height: 95px; border-width: 18px; }
	.kp-search-section { margin-top: -28px; }
	.kp-home-search { padding: 17px; }
	.kp-search-control { grid-template-columns: 21px 1fr; padding-right: 10px; }
	.kp-search-control button { grid-column: 1 / -1; width: 100%; }
	.kp-section { padding: 58px 0; }
	.kp-section-heading { align-items: start; }
	.kp-section-heading > a { padding-top: 5px; font-size: .9rem; }
	.kp-quick-form { grid-template-columns: 1fr; padding: 19px; }
	.kp-book-row { display: flex; width: calc(100% + 15px); gap: 14px; overflow-x: auto; padding: 2px 15px 18px 0; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.kp-book-row::-webkit-scrollbar { display: none; }
	.kp-book-row .knigopolka-book-card { width: min(78vw, 310px); flex: 0 0 auto; scroll-snap-align: start; }
	.kp-book-row .knigopolka-cover { min-height: 0; aspect-ratio: 2 / 3; }
	.kp-nearby-grid, .kp-personal-card, .kp-owner-cta, .kp-join-card { grid-template-columns: 1fr; gap: 27px; }
	.kp-districts { gap: 9px; }
	.kp-districts a { min-height: 52px; padding-inline: 13px; font-size: .88rem; }
	.kp-steps { grid-template-columns: 1fr; }
	.kp-steps article { display: grid; grid-template-columns: 42px 1fr; column-gap: 15px; padding: 19px; }
	.kp-steps h3 { align-self: center; margin: 0; }
	.kp-steps p { grid-column: 2; margin-top: 5px; }
	.kp-owner-cta { padding: 30px 24px; }
	.kp-owner-cta > div:last-child { justify-items: stretch; }
	.kp-personal-card { padding: 25px 20px; }
	.kp-telegram-button { width: 100%; }
	.kp-footer-grid { grid-template-columns: 1fr; gap: 26px; }
	.kp-site-footer { padding-bottom: calc(116px + env(safe-area-inset-bottom)); }
	.kp-bottom-nav { position: fixed; z-index: 120; display: grid; grid-template-columns: repeat(5, 1fr); right: 0; bottom: 0; left: 0; border-top: 1px solid var(--kp-home-line); background: var(--kp-home-white); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 28px rgba(0,0,0,.08); backdrop-filter: blur(16px); }
	.kp-bottom-nav a { display: grid; min-width: 0; justify-items: center; gap: 2px; color: var(--kp-home-muted); font-size: .64rem; font-weight: 750; text-decoration: none; }
	.kp-bottom-nav a > span { display: grid; width: 31px; height: 27px; place-items: center; color: inherit; font-size: 1.35rem; line-height: 1; }
	.kp-bottom-nav a.is-active { color: var(--kp-home-teal); }
	.kp-bottom-nav .kp-bottom-add > span { margin-top: -16px; width: 42px; height: 42px; border-radius: 50%; background: var(--kp-home-coral); color: var(--kp-home-white); box-shadow: 0 7px 18px rgba(0,0,0,.12); }
}

@media (max-width: 410px) {
	.kp-hero-actions { grid-template-columns: 1fr; }
	.kp-section-heading { display: grid; }
	.kp-districts { grid-template-columns: 1fr; }
	.kp-empty-state { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	.kp-primary-button, .kp-secondary-button, .kp-light-button, .kp-book-row .knigopolka-book-card { transition: none; }
}
