/* Shared HTML tools UI */
.ht-hero {
  padding: 48px 0 20px;
  background: linear-gradient(135deg, #fff 0%, #fff5f5 100%);
}
.ht-hero-inner { max-width: 820px; margin: 0 auto; text-align: center; }
.ht-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: #10172f;
  letter-spacing: -0.02em;
}
.ht-hero p {
  margin: 0 auto;
  max-width: 700px;
  color: #5c6478;
  font-size: 17px;
  line-height: 1.7;
}
.ht-wrap { padding: 24px 0 64px; background: #f7f8fc; }
.ht-card {
  background: #fff;
  border: 1px solid #e8ebf5;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 14px 36px rgba(17, 24, 47, 0.06);
  box-sizing: border-box;
}
.ht-privacy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  color: #1b5e20;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
}
.ht-privacy strong { font-weight: 800; }
.ht-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #10172f;
  margin-bottom: 8px;
}
.ht-textarea {
  display: block;
  width: 100%;
  min-height: 180px;
  height: 200px;
  resize: vertical;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #18213a;
  border: 2px solid #d8deea;
  border-radius: 12px;
  outline: none;
  background: #fafbff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  box-sizing: border-box;
}
.ht-textarea:focus {
  border-color: #E53935;
  box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.12);
  background: #fff;
}
.ht-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.ht-btn {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 16px;
  color: #fff !important;
  line-height: 1.2;
  transition: opacity .2s, transform .2s;
}
.ht-btn:hover { opacity: .92; transform: translateY(-1px); }
.ht-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.ht-btn-primary { background: linear-gradient(135deg, #ef5350, #c62828); box-shadow: 0 8px 18px rgba(229,57,53,.22); }
.ht-btn-green { background: #2e7d32; }
.ht-btn-blue { background: #1565c0; }
.ht-btn-gray { background: #455a64; }
.ht-btn-dark { background: #10172f; }
.ht-btn-outline {
  background: #fff;
  color: #10172f !important;
  border: 1.5px solid #cfd5e6;
}
.ht-section { margin-top: 20px; }
.ht-section h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 800;
  color: #10172f;
}
.ht-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.ht-stat {
  background: #f7f8fc;
  border: 1px solid #e8ebf5;
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 100px;
}
.ht-stat b { display: block; font-size: 18px; color: #E53935; line-height: 1.2; }
.ht-stat span { font-size: 12px; color: #5c6478; font-weight: 600; }
.ht-options-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ht-field { margin-bottom: 12px; }
.ht-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #384057;
  margin-bottom: 6px;
}
.ht-field select,
.ht-field input[type="text"],
.ht-field input[type="number"],
.ht-field input[type="search"] {
  width: 100%;
  border: 1.5px solid #d8deea;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #18213a;
  background: #fff;
  box-sizing: border-box;
}
.ht-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 8px;
}
.ht-checks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #18213a;
  cursor: pointer;
}
.ht-results {
  margin-top: 12px;
  border: 1px solid #e8ebf5;
  border-radius: 12px;
  background: #fafbff;
  max-height: 480px;
  overflow: auto;
}
.ht-result-text {
  margin: 0;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #18213a;
}
.ht-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ht-table th,
.ht-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f8;
  vertical-align: top;
  word-break: break-word;
}
.ht-table th { background: #fff; color: #5c6478; font-weight: 700; position: sticky; top: 0; }
.ht-status {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #10172f;
  min-height: 22px;
}
.ht-status b { color: #E53935; }
.ht-drop-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #5c6478;
  font-weight: 600;
}
.ht-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.ht-preview-frame {
  width: 100%;
  min-height: 360px;
  border: 1px solid #e8ebf5;
  border-radius: 12px;
  background: #fff;
}
.ht-preview-frame.is-dark { background: #10172f; }
.ht-preview-wrap {
  border: 1px solid #e8ebf5;
  border-radius: 12px;
  overflow: hidden;
  background: #eceff5;
  display: flex;
  justify-content: center;
  padding: 12px;
}
.ht-preview-shell {
  width: 100%;
  max-width: 100%;
  transition: max-width .2s;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(17,24,47,.08);
}
.ht-preview-shell.is-tablet { max-width: 768px; }
.ht-preview-shell.is-mobile { max-width: 390px; }
.ht-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
}
.ht-badge.ok { background: #e8f5e9; color: #2e7d32; }
.ht-badge.warn { background: #fff8e1; color: #f57f17; }
.ht-badge.bad { background: #ffebee; color: #c62828; }
@media (max-width: 991px) {
  .ht-options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ht-split { grid-template-columns: 1fr; }
}
.ht-entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
  max-height: 220px;
  overflow: auto;
}
.ht-entity-item {
  border: 1px solid #e8ebf5;
  border-radius: 10px;
  background: #fafbff;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ht-entity-item:hover { border-color: #E53935; background: #fff; }
.ht-entity-item .ch { font-size: 18px; color: #10172f; }
.ht-entity-item .nm { font-size: 11px; color: #5c6478; font-family: ui-monospace, Menlo, Consolas, monospace; }
.ht-preview-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.ht-meta-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px;
  padding: 14px;
  font-size: 13px;
}
.ht-meta-grid .k { color: #5c6478; font-weight: 700; }
.ht-meta-grid .v { color: #18213a; word-break: break-word; font-family: ui-monospace, Menlo, Consolas, monospace; }
@media (max-width: 575px) {
  .ht-card { padding: 16px; }
  .ht-options-grid { grid-template-columns: 1fr; }
  .ht-btn { width: 100%; }
  .ht-meta-grid { grid-template-columns: 1fr; }
}
