.front-sidebar .top-nav > .history-main-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 132px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(116, 216, 190, 0.4);
  border-radius: 6px;
  background: rgba(8, 14, 14, 0.34);
  color: rgba(238, 244, 234, 0.82);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.front-sidebar .top-nav > .history-main-link:hover,
.front-sidebar .top-nav > .history-main-link.is-active {
  border-color: rgba(116, 216, 190, 0.62);
  background: linear-gradient(180deg, rgba(116, 216, 190, 0.22), rgba(229, 197, 92, 0.12));
  color: #ffffff;
}

.front-sidebar .top-nav > .history-main-link svg {
  width: 17px;
  height: 17px;
}

.history-view {
  min-height: calc(100vh - 220px);
}

.history-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
}

.history-board {
  overflow: hidden;
  border: 1px solid rgba(229, 197, 92, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(229, 197, 92, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(13, 22, 20, 0.96), rgba(5, 11, 11, 0.93));
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
}

.history-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 1.1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: center;
  min-height: 96px;
  padding: 22px 26px;
  border-bottom: 1px solid rgba(229, 197, 92, 0.26);
  background:
    linear-gradient(90deg, rgba(31, 43, 38, 0.98), rgba(8, 15, 14, 0.96));
}

.history-head .panel-title {
  margin: 0;
  color: #fff8dc;
  font-size: 22px;
}

.history-head p {
  margin: 8px 0 0;
  color: rgba(226, 235, 222, 0.68);
  font-size: 13px;
}

.history-search {
  margin: 0;
}

.history-index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.history-index button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(116, 216, 190, 0.2);
  border-radius: 6px;
  background: rgba(4, 11, 11, 0.42);
  color: rgba(238, 244, 234, 0.72);
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.history-index button:hover,
.history-index button.is-active {
  border-color: rgba(229, 197, 92, 0.62);
  background:
    linear-gradient(180deg, rgba(229, 197, 92, 0.22), rgba(116, 216, 190, 0.08)),
    rgba(8, 14, 14, 0.76);
  color: #fff8dc;
}

.history-content {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 560px;
}

.history-editor {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
  border-right: 1px solid rgba(229, 197, 92, 0.24);
  background:
    radial-gradient(circle at 14% 8%, rgba(116, 216, 190, 0.13), transparent 34%),
    rgba(5, 11, 11, 0.55);
}

.history-editor > strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #f7f2d0;
  font-size: 16px;
}

.history-editor .field {
  min-width: 0;
}

.history-editor textarea {
  min-height: 180px;
  resize: vertical;
}

.history-image-field {
  gap: 8px;
}

.history-image-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(229, 197, 92, 0.48);
  border-radius: 6px;
  background: rgba(229, 197, 92, 0.12);
  color: #fff1b7;
  font-weight: 900;
  cursor: pointer;
}

.history-image-picker:hover {
  border-color: rgba(229, 197, 92, 0.78);
  background: rgba(229, 197, 92, 0.2);
}

.history-image-picker svg {
  width: 16px;
  height: 16px;
}

.history-image-field small {
  color: rgba(226, 235, 222, 0.56);
  font-size: 12px;
}

.history-image-preview {
  display: grid;
  grid-template-columns: repeat(3, 74px);
  gap: 8px;
}

.history-image-thumb {
  position: relative;
  overflow: hidden;
  min-width: 0;
  width: 74px;
  padding: 0;
  border: 1px solid rgba(116, 216, 190, 0.26);
  border-radius: 6px;
  background: rgba(1, 7, 7, 0.7);
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.history-image-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-image-thumb span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(3, 10, 10, 0.8);
  color: #fff1b7;
  font-size: 12px;
  font-weight: 900;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
}

.history-card,
.history-empty {
  border: 1px solid rgba(116, 216, 190, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(116, 216, 190, 0.09), transparent 34%),
    rgba(3, 10, 10, 0.68);
}

.history-card {
  padding: 18px;
}

.history-summary-card {
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.history-summary-card:hover {
  border-color: rgba(229, 197, 92, 0.36);
  background:
    linear-gradient(135deg, rgba(229, 197, 92, 0.1), transparent 30%),
    rgba(3, 10, 10, 0.76);
  transform: translateY(-1px);
}

.history-detail-card {
  cursor: default;
}

.history-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid rgba(116, 216, 190, 0.28);
  border-radius: 999px;
  background: rgba(116, 216, 190, 0.08);
  color: #d5f3e8;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.history-back-button:hover {
  border-color: rgba(116, 216, 190, 0.56);
  background: rgba(116, 216, 190, 0.14);
}

.history-card-top,
.history-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(226, 235, 222, 0.58);
  font-size: 12px;
}

.history-card-tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.history-delete-button {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 107, 107, 0.36);
  border-radius: 999px;
  background: rgba(255, 107, 107, 0.1);
  color: #ffb5b5;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.history-delete-button:hover {
  border-color: rgba(255, 107, 107, 0.68);
  background: rgba(255, 107, 107, 0.18);
  color: #ffd7d7;
}

.history-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(229, 197, 92, 0.34);
  border-radius: 999px;
  background: rgba(229, 197, 92, 0.12);
  color: #fff1b7;
  font-weight: 900;
}

.history-card h3 {
  margin: 14px 0 10px;
  color: #ffffff;
  font-size: 18px;
  line-height: 1.35;
}

.history-card p {
  margin: 0;
  color: rgba(238, 244, 234, 0.78);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.history-summary-content {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.history-card-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 160px));
  gap: 8px;
  margin-top: 14px;
}

.history-card-images a {
  display: block;
  min-width: 0;
  border-radius: 6px;
}

.history-card-images img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid rgba(116, 216, 190, 0.22);
  border-radius: 6px;
  background: rgba(1, 7, 7, 0.6);
}

.history-card-foot {
  justify-content: flex-start;
  margin-top: 16px;
  flex-wrap: wrap;
}

.history-card-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.history-card-foot strong {
  margin-left: auto;
  color: #fff1b7;
  font-size: 12px;
}

.history-card-foot svg {
  width: 15px;
  height: 15px;
}

.history-comments {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(116, 216, 190, 0.15);
}

.history-comments-head {
  color: #fff8dc;
  font-size: 13px;
  font-weight: 900;
}

.history-comment-list {
  display: grid;
  gap: 8px;
}

.history-comment,
.history-comment-empty {
  padding: 10px 12px;
  border: 1px solid rgba(238, 244, 234, 0.08);
  border-radius: 6px;
  background: rgba(1, 7, 7, 0.48);
}

.history-comment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px 12px;
}

.history-comment strong {
  color: #f7f2d0;
  font-size: 13px;
}

.history-comment span,
.history-comment-empty {
  color: rgba(226, 235, 222, 0.54);
  font-size: 12px;
}

.history-comment p {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(238, 244, 234, 0.78);
  font-size: 13px;
  line-height: 1.65;
}

.history-comment .history-card-images {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 104px));
  margin-top: 4px;
}

.history-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.history-comment-form textarea {
  min-height: 54px;
  resize: vertical;
}

.history-comment-form .button {
  min-height: 54px;
}

.history-comment-actions {
  display: grid;
  gap: 8px;
}

.history-comment-image-picker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid rgba(116, 216, 190, 0.28);
  border-radius: 6px;
  background: rgba(116, 216, 190, 0.08);
  color: rgba(238, 244, 234, 0.82);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.history-comment-image-picker:hover {
  border-color: rgba(116, 216, 190, 0.52);
  background: rgba(116, 216, 190, 0.14);
}

.history-comment-image-picker svg {
  width: 14px;
  height: 14px;
}

.history-comment-image-preview {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, 58px);
}

.history-comment-image-preview .history-image-thumb {
  width: 58px;
}

.history-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  color: rgba(226, 235, 222, 0.62);
  text-align: center;
}

.history-empty svg {
  width: 34px;
  height: 34px;
  color: #e5c55c;
}

.history-empty strong {
  margin-top: 10px;
  color: #fff8dc;
}

@media (max-width: 1180px) {
  .history-content,
  .history-head {
    grid-template-columns: 1fr;
  }

  .history-index {
    justify-content: flex-start;
  }

  .history-editor {
    border-right: 0;
    border-bottom: 1px solid rgba(229, 197, 92, 0.24);
  }

  .history-comment-form {
    grid-template-columns: 1fr;
  }

  .history-image-preview {
    grid-template-columns: repeat(3, 58px);
  }

  .history-image-thumb {
    width: 58px;
  }

  .history-card-images {
    grid-template-columns: repeat(2, minmax(0, 120px));
  }
}
