.site-header {
  border-bottom: 1px solid #111;
  box-shadow: var(--shadow-1);
}

.site-header__top {
  background: linear-gradient(180deg, var(--bg-header-1) 0%, var(--bg-header-2) 100%);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  color: #fff;
}

.logo:hover {
  color: #fff;
  text-decoration: none;
}

.logo__icon {
  width: 46px;
  height: 46px;
  border-radius: 5px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo__title {
  display: block;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.logo__sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.58);
}

.site-header__actions {
  display: flex;
  gap: 8px;
}

.theme-toggle {
  width: 44px;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle__icon {
  font-size: 17px;
  line-height: 1;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.is-open {
  display: flex;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 10, 14, 0.62);
  cursor: pointer;
}

.modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--line-main);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
  border-radius: var(--radius-md);
  padding: 20px;
}

.modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: none;
  color: var(--text-soft);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal__close:hover {
  color: var(--text-main);
}

.modal__title {
  font-size: 24px;
  color: var(--text-strong);
  margin-bottom: 14px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.modal-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal-form__field span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 700;
}

.modal-form__field input {
  width: 100%;
  border: 1px solid var(--line-main);
  background: var(--bg-subtle);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  font-family: var(--font-main);
  font-size: 14px;
}

.modal-form__field input:focus {
  outline: none;
  border-color: var(--brand);
}

.modal-form__submit {
  margin-top: 4px;
}

.modal-form__result {
  min-height: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.modal-form__result.is-success {
  color: #2d7d32;
}

.modal__note {
  margin-top: 4px;
  font-size: 13px;
  color: #b2452f;
  background: #fff3ef;
  border: 1px solid #f3c5ba;
  border-radius: var(--radius-sm);
  padding: 9px 10px;
}

[data-theme='dark'] .modal__note {
  background: #3b2520;
  border-color: #6a342b;
  color: #ffc0b4;
}


.cat-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line-main);
  margin-bottom: 6px;
  box-shadow: var(--shadow-1);
}

.frow {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.12s;
  cursor: pointer;
}

.frow:last-child {
  border-bottom: 0;
}

.frow:hover {
  background: var(--bg-hover);
}

.frow-indicator {
  width: 5px;
  flex-shrink: 0;
}

.fi-new {
  background: var(--brand);
}

.fi-read {
  background: #c8c8c8;
}

.frow-icon {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  padding: 14px 0;
}

.frow-icon-link {
  color: inherit;
  text-decoration: none;
}

.frow-icon-link:hover {
  color: var(--link);
  text-decoration: none;
}

.frow-info {
  flex: 1;
  min-width: 0;
  padding: 14px 12px 14px 0;
}

.frow-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}

.frow-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.42;
}

.frow-desc-link {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
}

.frow-desc-link:hover {
  color: var(--link);
  text-decoration: underline;
}

.frow-num {
  min-width: 88px;
  border-left: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.frow-num strong {
  font-size: 17px;
  color: var(--text-main);
}

.frow-num span {
  font-size: 12px;
  color: var(--text-soft);
}

.frow-last {
  min-width: 210px;
  width: 210px;
  max-width: 210px;
  border-left: 1px solid var(--line-subtle);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.frow-last-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--link);
  margin-bottom: 4px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  min-height: 36px;
}

.frow-last-meta {
  font-size: 12px;
  color: var(--text-soft);
}

.sbar {
  background: var(--bg-subtle);
  border: 1px solid var(--line-main);
  margin-top: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
  box-shadow: var(--shadow-1);
}

.sbar strong {
  color: var(--text-main);
}

.online-part {
  margin-left: auto;
  text-align: right;
}

.online-top {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.online-names {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  font-size: 13px;
}

.thread-pager {
  background: var(--bg-pager);
  border: 1px solid var(--line-main);
  padding: 9px 16px;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.thread-pager--top {
  border-bottom: 0;
}

.thread-pager--bottom {
  border-top: 0;
}

.thread-pager__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thread-table {
  border: 1px solid var(--line-main);
  background: var(--bg-card);
  box-shadow: var(--shadow-1);
}

.trow {
  display: grid;
  grid-template-columns: 1fr 150px 210px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.1s;
}

.trow:last-child {
  border-bottom: 0;
}

.trow:hover {
  background: var(--bg-hover);
}

.trow.pin {
  background: var(--bg-pinned);
}

.trow-main {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 14px 16px;
}

.trow-bar {
  width: 4px;
  margin: -14px 12px -14px -16px;
  border-radius: 2px;
}

.bar-pin {
  background: #f0a126;
}

.bar-new {
  background: var(--link);
}

.pin-badge {
  background: #f0a126;
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 2px;
  margin-right: 6px;
}

.trow-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trow-title-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.trow-title-link:hover {
  color: var(--link);
  text-decoration: underline;
}

.trow-meta {
  font-size: 13px;
  color: var(--text-soft);
}

.trow-stats,
.trow-last-cell {
  border-left: 1px solid var(--line-subtle);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.trow-stat-row {
  font-size: 13px;
  color: var(--text-soft);
  text-align: right;
}

.trow-stat-row strong {
  color: var(--text-main);
}

.trow-last-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.trow-last-text strong {
  color: var(--link);
}

.topic-head {
  background: var(--bg-soft);
  border: 1px solid var(--line-main);
  padding: 14px 18px;
  margin-bottom: 6px;
}

.topic-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.topic-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-delete {
  background: linear-gradient(180deg, #ff5fa8, #e2438f);
  border-color: #a52762;
  color: #fff;
}

.btn-delete:hover {
  background: linear-gradient(180deg, #ff78b7, #ea5a9d);
}

.topic-title {
  font-size: 24px;
  color: var(--text-strong);
  line-height: 1.3;
}

.topic-date {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-soft);
}

.posts-area {
  border: 1px solid var(--line-main);
  background: var(--bg-soft);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 6px;
}

.post {
  background: var(--bg-card);
  border: 1px solid var(--line-main);
  display: grid;
  grid-template-columns: 185px 1fr;
}

.post-aside {
  background: var(--bg-subtle);
  border-right: 1px solid var(--line-soft);
  padding: 18px 14px;
  text-align: center;
}

.post-ava {
  width: 100px;
  height: 100px;
  border-radius: 5px;
  background: #d0d0d0;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #606060;
}

.post-ava-img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.post-nick {
  display: inline-block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.post-role {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post-info-table {
  width: 100%;
  text-align: left;
  font-size: 13px;
  color: var(--text-soft);
  border-collapse: collapse;
}

.post-info-table td {
  padding: 3px 0;
  vertical-align: top;
}

.post-info-table td:last-child {
  color: var(--text-main);
  padding-left: 6px;
}

.post-body {
  padding: 16px 20px;
  min-width: 0;
}

.post-body-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.post-body-date {
  font-size: 14px;
  color: var(--text-soft);
}

.post-body-num {
  font-size: 14px;
  color: var(--text-soft);
  background: var(--bg-subtle);
  padding: 2px 9px;
  border-radius: 2px;
}

.post-quote {
  border-left: 4px solid #b8b8b8;
  background: var(--bg-subtle);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 14px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.65;
}

.post-quote .bbcode-quote {
  border-left: 4px solid #9d9d9d;
  background: rgba(0, 0, 0, 0.03);
  padding: 10px 14px;
  margin: 8px 0;
  font-style: italic;
}

[data-theme='dark'] .post-quote .bbcode-quote {
  background: rgba(255, 255, 255, 0.04);
}

.post-quote .bbcode-quote__author {
  font-style: normal;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}

.post-quote .bbcode-quote__content {
  color: var(--text-muted);
}

.post-quote-who {
  font-style: normal;
  font-weight: 700;
  color: var(--text-main);
  font-size: 13px;
  margin-bottom: 5px;
}

.post-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-main);
  word-break: break-word;
}

.post-text .bbcode-quote {
  border-left: 4px solid #a4a4a4;
  background: var(--bg-subtle);
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 2px;
}

.post-text .bbcode-quote__author {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 5px;
}

.post-text .bbcode-quote__content {
  color: var(--text-muted);
  font-style: italic;
}

.post-text .bbcode-quote__content br {
  display: block;
  content: '';
  margin-top: 6px;
}

.post-text p {
  margin-bottom: 12px;
}

.post-text p:last-child {
  margin-bottom: 0;
}

.post-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.post-actions form {
  display: inline;
}

.pact {
  border: 0;
  background: none;
  padding: 0;
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--text-soft);
  cursor: pointer;
}

.pact:hover {
  color: var(--link);
}

.pact-delete {
  color: #e2438f;
  font-weight: 700;
}

.pact-delete:hover {
  color: #bf2e74;
}

.reply-section {
  border: 1px solid var(--line-main);
  background: var(--bg-card);
}

.reply-head {
  background: linear-gradient(180deg, #434343, #262626);
  color: rgba(255, 255, 255, 0.8);
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
}

.reply-body {
  padding: 18px;
}

.qprev {
  border-left: 4px solid #a1a1a1;
  background: var(--bg-subtle);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--text-muted);
  display: none;
  position: relative;
}

.qprev.on {
  display: block;
}

.qprev-rm {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: none;
  color: var(--text-soft);
  font-size: 18px;
  cursor: pointer;
}

.bb-row {
  display: flex;
  gap: 5px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.bb-b {
  border: 1px solid var(--line-main);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  border-radius: 2px;
  padding: 5px 10px;
  cursor: pointer;
}

.bb-b:hover {
  background: var(--bg-hover);
}

.reply-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 14px;
  border: 1px solid var(--line-main);
  background: #fafafa;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 15px;
  resize: vertical;
}

[data-theme='dark'] .reply-form textarea {
  background: #1a1e26;
}

.reply-foot {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reply-note {
  font-size: 13px;
  color: var(--text-soft);
}

.send-btn {
  background: linear-gradient(180deg, #505050, #2d2d2d);
  border: 1px solid #111;
  color: #fff;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 9px 22px;
  cursor: pointer;
}

.ok-note {
  display: none;
  margin-top: 10px;
  background: #f0f8ec;
  border: 1px solid #b8dca8;
  color: #3a6b28;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
}

.ok-note.on {
  display: block;
}

.page-card {
  border: 1px solid var(--line-main);
  background: var(--bg-card);
  padding: 18px;
  box-shadow: var(--shadow-1);
}

.page-title {
  font-size: 24px;
  margin-bottom: 6px;
  color: var(--text-strong);
}

.page-date {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.page-content {
  font-size: 16px;
  line-height: 1.75;
}

@media (max-width: 1000px) {
  .trow {
    grid-template-columns: 1fr;
  }

  .trow-stats,
  .trow-last-cell {
    border-left: 0;
    border-top: 1px solid var(--line-subtle);
  }
}

@media (max-width: 860px) {
  .frow {
    flex-wrap: wrap;
  }

  .frow-info {
    min-width: 220px;
    padding-right: 12px;
  }

  .frow-last {
    min-width: 100%;
    border-left: 0;
    border-top: 1px solid var(--line-subtle);
  }
}

@media (max-width: 760px) {
  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .logo {
    min-height: auto;
  }

  .site-header__actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .topic-title {
    font-size: 20px;
  }

  .topic-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .post {
    grid-template-columns: 1fr;
  }

  .post-aside {
    text-align: left;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px 12px;
    align-items: center;
  }

  .post-info-table {
    grid-column: 1 / -1;
  }

  .sbar {
    gap: 8px;
  }

  .online-part {
    margin-left: 0;
    text-align: left;
  }

  .online-names {
    justify-content: flex-start;
  }
}
