* {
  box-sizing:border-box
}
body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:var(--body)/1.5 'Open Sans',sans-serif;
  -webkit-font-smoothing:antialiased
}
a {
  color:inherit;
  text-underline-offset:4px
}
a:hover {
  text-decoration-thickness:2px
}
img {
  max-width:100%;
  object-fit:cover
}
button,input,select,textarea {
  font:inherit;
  color:inherit
}
button,.button,summary {
  cursor:pointer
}
button,.button {
  min-height:44px;
  border:0;
  border-radius:30px;
  padding:11px 22px;
  font-weight:600;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center
}
button:disabled {
  cursor:wait;
  opacity:.6
}
.primary {
  background:var(--brand-yellow);
  color:var(--text)
}
.primary:hover {
  background:var(--brand-yellow-dark)
}
.secondary {
  background:var(--text);
  color:var(--bg)
}
.text-button {
  background:transparent;
  text-decoration:underline;
  padding:8px 12px
}
.danger {
  color:var(--red)
}
input,select,textarea {
  width:100%;
  min-height:44px;
  border:1px solid var(--input-border);
  border-radius:var(--radius);
  padding:10px 12px;
  background:var(--bg)
}
textarea {
  min-height:100px;
  resize:vertical
}
input[type=checkbox],input[type=radio] {
  width:22px;
  min-height:22px;
  accent-color:var(--text);
  flex-shrink:0
}
label {
  display:grid;
  gap:6px
}
label:has(input[type=checkbox]),label:has(input[type=radio]) {
  display:flex;
  align-items:center;
  gap:12px
}
:focus-visible {
  outline:3px solid var(--text);
  outline-offset:3px
}
input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline-color:var(--text);
  border-color:var(--brand-yellow)
}
.skip {
  position:absolute;
  top:-80px;
  left:16px;
  z-index:20;
  background:var(--brand-yellow);
  padding:12px
}
.skip:focus {
  top:8px
}
.masthead {
  max-width:1287px;
  margin:auto;
  padding:10px 24px;
  display:flex;
  gap:24px;
  align-items:center
}
.masthead img {
  object-fit:contain
}
.masthead nav {
  margin-inline-start:auto;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:16px
}
.app-title {
  max-width:180px;
  line-height:1.35
}
.page {
  max-width:1287px;
  margin:auto;
  padding:12px 24px 80px
}
h1 {
  font-size:var(--h1);
  line-height:1.2;
  margin:0 0 28px;
  font-weight:700;
  text-wrap:balance
}
h2 {
  font-size:var(--h2);
  line-height:1.3;
  margin:32px 0 20px
}
h3 {
  font-size:var(--h3);
  line-height:1.4;
  margin:0 0 12px
}
p {
  margin:8px 0 16px;
  overflow-wrap:anywhere
}
.page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  margin-bottom:24px
}
.page-heading h1 {
  margin:0
}
.auth-sheet {
  max-width:460px;
  margin:5vh auto;
  padding-block:24px
}
.auth-sheet form {
  display:grid;
  gap:20px;
  margin:28px 0
}
.auth-sheet form p:empty {
  display:none
}
.error {
  color:var(--red)
}
.notice {
  background:var(--panel);
  padding:16px;
  border-inline-start:5px solid var(--brand-yellow)
}
/* «Нашёл ошибку» (2026-10-12) */
.report-open {
  font-weight:400
}
.report-dialog {
  width:min(560px,calc(100vw - 32px));
  border:1px solid var(--line);
  padding:20px
}
.report-dialog form {
  display:grid;
  gap:12px
}
.report-dialog label {
  display:grid;
  gap:6px
}
.report-dialog textarea {
  width:100%
}
.report-dialog pre {
  max-height:200px;
  overflow:auto;
  font-size:.75rem;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
.report-actions {
  display:flex;
  gap:8px
}
.report-pre{max-height:320px;overflow:auto;font-size:.75rem;white-space:pre-wrap;overflow-wrap:anywhere}
/* Журнал (2026-10-12) */
.audit-filters {
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  gap:12px;
  margin:16px 0
}
.audit-filters label {
  display:grid;
  gap:4px
}
.audit-days {
  align-self:center
}
.audit-table {
  width:100%;
  border-collapse:collapse;
  font-size:.9375rem
}
.audit-table th,.audit-table td {
  text-align:left;
  padding:8px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  overflow-wrap:anywhere
}
.audit-table th {
  font-weight:700
}
@media(max-width:768px) {
  .audit-table thead {
    display:none
  }
  .audit-table tr {
    display:grid;
    padding:8px 0;
    border-bottom:1px solid var(--line)
  }
  .audit-table td {
    border:0;
    padding:2px 0
  }
}
/* Шапка (2026-10-12): разделы - жирные, текущий отмечен жёлтой полосой; пользователь под иконкой */
.masthead .main-nav {
  margin-inline-start:auto;
  display:flex;
  flex-wrap:wrap;
  align-items:stretch;
  gap:4px
}
.masthead .main-nav a {
  display:flex;
  align-items:center;
  min-height:44px;
  padding:0 12px;
  font-weight:700;
  color:var(--ink);
  text-decoration:none;
  border-bottom:4px solid transparent
}
.masthead .main-nav a:hover {
  background:var(--accent-soft,#fbf2d4);
  box-shadow:none
}
.masthead .main-nav a.on {
  border-bottom-color:var(--accent)
}
.nav-tools {
  display:flex;
  align-items:center;
  gap:8px
}
.report-open {
  gap:6px;
  min-height:40px;
  padding:6px 12px;
  border:1px solid var(--ink);
  background:#fff;
  color:var(--ink);
  font-weight:600
}
.user-menu {
  position:relative
}
.user-menu summary {
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border:1px solid var(--ink);
  color:var(--ink)
}
.user-menu summary::-webkit-details-marker {
  display:none
}
.user-menu[open] summary {
  background:var(--ink);
  color:#fff
}
.user-pop {
  position:absolute;
  right:0;
  top:calc(100% + 6px);
  z-index:20;
  min-width:220px;
  display:grid;
  gap:8px;
  padding:14px;
  background:#fff;
  border:2px solid var(--ink)
}
.user-pop span {
  color:var(--muted);
  font-size:.875rem
}
.user-pop .text-button {
  justify-content:start;
  padding:0;
  min-height:0
}
/* строка 1: логотип, «Нашёл ошибку», пользователь; строка 2: разделы - на всех ширинах */
header.masthead {
  flex-wrap:wrap;
  row-gap:4px;
  padding-bottom:0
}
.nav-tools {
  order:2;
  margin-inline-start:auto
}
.masthead .main-nav {
  order:3;
  width:100%;
  margin-inline-start:-12px
}
@media(max-width:700px) {
  .masthead .main-nav {
    gap:0;
    margin-inline-start:-8px
  }
  .masthead .main-nav a {
    padding:0 8px;
    min-height:40px
  }
}
