* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px 0 48px;
  background: #f3f3f3;
  color: #333;
  font:
    14px/1.5 Arial,
    Helvetica,
    sans-serif;
}

a {
  color: #1a5fb4;
}

.hb-page {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
}

.hb-header {
  padding: 18px 24px;
  background-color: #2f3b4c;
}

.hb-header__title {
  margin: 0;
  color: #fff;
  font-size: 28px;
  font-weight: normal;
}

.hb-main {
  padding: 24px;
}

.hb-section_hidden {
  display: none;
}

.hb-intro p {
  margin: 0 0 14px;
}

.hb-select-bar {
  margin: 28px 0 18px;
  padding: 10px 16px;
  background: #d71920;
  color: #fff;
  text-align: center;
  font-size: 18px;
}

.hb-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
}

.hb-theme {
  display: block;
  width: 170px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.hb-theme:hover .hb-theme__preview {
  border-color: #b9141a;
}

.hb-theme:active {
  transform: scale(0.98);
}

.hb-theme__title {
  display: block;
  min-height: 36px;
  font-size: 13px;
  line-height: 1.3;
  color: #333;
}

.hb-theme__preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  height: 130px;
  margin: 0 auto;
  overflow: hidden;
  border: 2px solid #d8d8d8;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.hb-theme__preview iframe,
.hb-theme__preview img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.hb-theme_selected .hb-theme__preview {
  border-color: #d71920;
  box-shadow:
    0 0 0 2px #d71920,
    0 4px 12px rgba(215, 25, 32, 0.2);
}

.hb-size-panel {
  margin-top: 24px;
  padding: 18px 20px;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
}

.hb-size-panel__title {
  margin-bottom: 14px;
  font-size: 14px;
}

.hb-size-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 16px;
}

.hb-size-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.hb-size-item input {
  margin: 0;
  cursor: pointer;
}

.hb-actions {
  margin: 28px 0 10px;
  text-align: center;
}

.hb-show-btn,
.hb-back-btn {
  min-width: 120px;
  padding: 10px 28px;
  border: 0;
  background: #d71920;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.hb-show-btn:hover,
.hb-back-btn:hover {
  background: #b9141a;
}

.hb-banner-result {
  margin: 0 0 28px;
  padding: 20px;
  border: 1px solid #e0e0e0;
  background: #fff;
}

.hb-banner-result__preview {
  margin: 0 auto 20px;
  text-align: center;
}

.hb-banner-result__code-label {
  margin-bottom: 8px;
  color: #666;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.04em;
}

.hb-banner-result__code textarea {
  display: block;
  width: 100%;
  min-height: 120px;
  padding: 10px;
  border: 1px solid #999;
  font:
    12px/1.4 Courier,
    monospace;
  resize: vertical;
}

.hb-empty {
  margin: 24px 0;
  text-align: center;
  color: #777;
}

@media (max-width: 760px) {
  body {
    padding: 16px 0 32px;
  }

  .hb-main {
    padding: 16px;
  }

  .hb-size-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hb-theme,
  .hb-theme__preview {
    width: 140px;
  }

  .hb-theme__preview {
    height: 110px;
  }
}
