*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scrollbar-gutter: stable;
  scrollbar-color: var(--kk-scrollbar) var(--kk-scrollbar-track);
  scrollbar-width: auto;
}
* {
  scrollbar-color: var(--kk-scrollbar) var(--kk-scrollbar-track);
}
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: var(--kk-scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--kk-scrollbar);
  border: 3px solid var(--kk-scrollbar-track);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--kk-scrollbar-hover);
}
::-webkit-scrollbar-thumb:active {
  background: var(--kk-scrollbar-active);
}
body {
  margin: 0;
  background: var(--kk-bg);
  color: var(--kk-text);
  font: var(--kk-text-md)/var(--kk-leading-body) var(--kk-sans);
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
a:hover {
  color: var(--kk-primary);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button {
  background: none;
  border: 0;
}
input,
textarea,
select {
  max-width: 100%;
}
textarea {
  resize: none;
  min-height: 120px;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
svg {
  flex-shrink: 0;
}
h1,
h2,
h3,
h4 {
  font-family: var(--kk-serif);
  font-weight: 400;
  line-height: var(--kk-leading-heading);
  color: var(--kk-ink);
  margin: 0 0 20px;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(32px, 3.6vw, 50px);
}
h2 {
  font-size: 34px;
}
h3 {
  font-size: 22px;
}
p {
  margin: 0 0 16px;
}
:focus-visible {
  outline: var(--kk-focus-width) solid var(--kk-focus);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.shell {
  width: 100%;
  max-width: var(--kk-container);
  margin-inline: auto;
  padding-inline: 32px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Skip-link: визуально скрыта, видна только при фокусе с клавиатуры */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 16px;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  z-index: var(--kk-layer-skip);
  background: var(--kk-bg);
  color: var(--kk-ink);
  border-radius: var(--kk-radius-control, 8px);
  box-shadow: var(--kk-shadow-popover);
  text-decoration: none;
}
.icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  fill: none;
}
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--kk-control);
  min-height: var(--kk-control);
  padding: 10px;
  border-radius: var(--kk-radius-control);
  color: var(--kk-muted);
}
.iconbtn:hover {
  background: var(--kk-surface-warm);
  color: var(--kk-primary);
}
.iconbtn:active {
  background: var(--kk-line);
}
.btn-k {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--kk-space-3);
  min-height: var(--kk-control);
  padding: 10px 24px;
  border: 1px solid var(--kk-primary);
  border-radius: var(--kk-radius-pill);
  background: var(--kk-primary);
  color: var(--kk-surface);
  font-size: var(--kk-text-sm);
  font-weight: 600;
  transition: background var(--kk-motion-fast), border-color var(--kk-motion-fast);
}
.btn-k:hover {
  background: var(--kk-primary-hover);
  color: var(--kk-surface);
}
.btn-k:active {
  transform: translateY(1px);
}
.btn-k.ghost {
  background: var(--kk-surface);
  color: var(--kk-primary);
}
.btn-k.ghost:hover {
  background: var(--kk-surface-warm);
}

/* State semantics are shared by the site and the local catalogue. */
:is(.btn-k, .iconbtn, .save-control, .load-more-button)[aria-busy="true"] { cursor: progress; }
.btn-k:disabled:hover { background: var(--kk-primary); }
.btn-k.ghost:disabled:hover { background: var(--kk-surface); }
.btn-k:disabled:active { transform: none; }
.btn-k.neutral { background: var(--kk-surface); border-color: var(--kk-control-border); color: var(--kk-ink); }
.btn-k.neutral:hover { background: var(--kk-surface-warm); }
.btn-k.neutral:disabled:hover { background: var(--kk-surface); }
.iconbtn:disabled:hover { background: none; color: var(--kk-muted); }
.btn-k[aria-busy="true"] > .kk-spinner { position: absolute; right: 4px; }
.kk-link { color: var(--kk-primary); text-decoration: underline; text-underline-offset: .2em; }
.kk-spinner { display: inline-block; width: 18px; height: 18px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: kk-spin 800ms linear infinite; }
@keyframes kk-spin { to { transform: rotate(360deg); } }
.kk-badge { display: inline-flex; align-items: center; gap: var(--kk-space-2); padding: var(--kk-space-1) var(--kk-space-3); border-radius: var(--kk-radius-pill); background: var(--kk-surface-warm); color: var(--kk-text); font: 600 var(--kk-text-xs)/1.5 var(--kk-sans); }
.kk-badge.is-success { color: var(--kk-success); background: var(--kk-success-bg); }
