@font-face {
  font-family: "Finbook Navigation";
  src: url("/fonts/golos-text-normal-cyrillic.woff2") format("woff2");
  font-display: swap;
}

html:not(.app-route) { scrollbar-gutter: stable; scrollbar-width: thin; }
html.app-route #public-materials, html.cover-has-materials #public-materials { display: none; }

.public-header {
  box-sizing: border-box;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 30px);
  padding: max(8px, env(safe-area-inset-top)) max(16px, calc((100% - 1152px) / 2), env(safe-area-inset-right)) 8px max(16px, calc((100% - 1152px) / 2), env(safe-area-inset-left));
  border-bottom: 1px solid #d9d4c6;
  background: #f7f4eb;
  color: #314838;
  font: 400 14px/1.25 "Finbook Navigation", system-ui, sans-serif;
}

.public-header a {
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}

.public-header a:focus-visible {
  outline: 2px solid #42664a;
  outline-offset: 2px;
}

.public-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  white-space: nowrap;
  font: 400 24px/1 Georgia, serif;
}

.public-brand img { width: 28px; height: 28px; }

.public-nav {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(6px, 1.35vw, 20px);
}

.public-nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  white-space: nowrap;
  text-align: center;
  text-underline-offset: 5px;
}

.public-nav a[aria-current="page"], .public-nav a:active { text-decoration: underline; }

.public-account {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid #859681;
  border-radius: 6px;
  white-space: nowrap;
}

.public-account:active { background: #e5ebdf; }

@media (hover: hover) and (pointer: fine) {
  .public-nav a:hover { text-decoration: underline; }
  .public-account:hover { background: #e5ebdf; }
}

@media (max-width: 960px) {
  .public-header { grid-template-columns: 1fr auto; gap: 0 12px; }
  .public-nav { grid-area: 2 / 1 / 3 / -1; justify-content: space-between; }
}

@media (max-width: 620px) {
  .public-header { padding-bottom: 4px; }
  .public-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 6px;
    row-gap: 0;
    margin-top: 6px;
    border-top: 1px solid #d9d4c6;
  }
  .public-nav a { white-space: normal; font-size: 12px; }
}
