/* ===== Page Head (枠の外) ===== */
.hxhe-pagehead {
  margin: 0 0 10px;
}
.hxhe-pagehead-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  word-break: break-word;
}
.hxhe-pagehead-subtitle {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
}

/* ===== App Wrapper ===== */
.hxhe-app {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

/* ===== Input Box ===== */
.hxhe-inputbox {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 12px;
  background: #fafafa;
}

.hxhe-help {
  color: #374151;
  font-size: 13px;
  margin-bottom: 10px;
}
.hxhe-help p { margin: 0 0 8px; }
.hxhe-help ul { margin: 0; padding-left: 18px; color: #6b7280; }

.hxhe-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 10px 0 10px;
}
.hxhe-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #111827;
}

.hxhe-label {
  display: block;
  font-weight: 800;
  margin: 8px 0 6px;
  color: #111827;
  font-size: 14px;
}

.hxhe-textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  background: #fff;
}

.hxhe-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.hxhe-btn {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
}

.hxhe-btn:hover { background: #f9fafb; }

.hxhe-btn-primary {
  border-color: #111827;
  background: #111827;
  color: #fff;
}
.hxhe-btn-primary:hover { background: #0b0f19; }

.hxhe-btn-ghost {
  border-color: #d1d5db;
  background: #fff;
}

.hxhe-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.hxhe-status {
  margin-top: 10px;
  font-size: 14px;
  color: #374151;
}
.hxhe-status-info { color: #1f2937; }
.hxhe-status-ok { color: #065f46; }
.hxhe-status-warn { color: #92400e; }
.hxhe-status-error { color: #b91c1c; }

/* ===== Result Box (入力欄の下で横幅最大) ===== */
.hxhe-resultbox {
  margin-top: 12px;
}

.hxhe-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 10px;
}
.hxhe-summary-label { color: #6b7280; font-weight: 800; }
.hxhe-summary-value { font-size: 16px; font-weight: 900; color: #111827; }
.hxhe-summary-range { color: #6b7280; font-weight: 800; }

.hxhe-results {}

/* 初期表示 */
.hxhe-empty {
  border: 1px dashed #d1d5db;
  border-radius: 12px;
  padding: 22px 14px;
  color: #6b7280;
  background: #fff;
  text-align: center;
}

/* ===== Accordion ===== */
.hxhe-acc {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fff;
  margin-bottom: 10px;
  overflow: hidden;
}

/* summaryのデフォルトマーカーは使うが、見た目は整える */
.hxhe-acc-summary {
  cursor: pointer;
  list-style: none;
  padding: 12px;
}
.hxhe-acc-summary::-webkit-details-marker { display: none; }

.hxhe-acc-summary::before {
  content: "＋";
  display: inline-block;
  font-weight: 900;
  margin-right: 10px;
  color: #111827;
}
.hxhe-acc[open] .hxhe-acc-summary::before {
  content: "－";
}

.hxhe-acc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.hxhe-acc-title {
  font-weight: 900;
  color: #111827;
  line-height: 1.35;
  /* 折り返しは許可しつつ、できるだけ見やすく */
  word-break: break-word;
}

.hxhe-acc-count {
  font-weight: 900;
  color: #111827;
  white-space: nowrap;
}

.hxhe-acc-url {
  margin-top: 6px;
  color: #6b7280;
  word-break: break-all;
  font-size: 13px;
}
.hxhe-acc-url a {
  color: #4b5563;
  text-decoration: underline;
}

.hxhe-acc-body {
  border-top: 1px solid #eef2f7;
  padding: 12px;
  background: #fff;
}

/* ===== Tree ===== */
.hxhe-tree {
  padding-left: 6px;
  border-left: 2px solid #eef2f7;
}

.hxhe-tree-empty {
  color: #9ca3af;
  font-size: 13px;
  padding: 6px 0 2px 6px;
}

.hxhe-hrow {
  --indent: 0;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  padding: 6px 0 6px calc(var(--indent) * 18px);
  position: relative;
}

.hxhe-hrow::before {
  content: "";
  position: absolute;
  left: calc(var(--indent) * 18px - 6px);
  top: 18px;
  width: 10px;
  border-top: 2px solid #eef2f7;
}

.hxhe-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 28px;
  padding: 0 6px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #111827;
  font-weight: 900;
  font-size: 12px;
}

.hxhe-htext {
  color: #111827;
  line-height: 1.6;
  word-break: break-word;
}

/* エラー表示（URL取得失敗など） */
.hxhe-card-ng {
  border-color: #fee2e2;
  background: #fff7f7;
}
