.ed-host {
  margin: 1.25rem 0 2rem;
}

.ed {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.ed-input-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.ed-label {
  font-weight: 700;
  font-size: 1.05rem;
}

.ed-textarea {
  width: 100%;
  min-height: 14rem;
  max-height: 60vh;
  resize: vertical;
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}

.ed-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

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

.ed-count {
  margin-left: auto;
}

.ed-samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.ed-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ed-results {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.ed-results .empty {
  padding: 18px;
}

.ed-section-title {
  margin: 8px 0 0;
  font-size: 1.15rem;
}

.ed-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
}

.ed-facts dt {
  color: var(--muted);
  font-weight: 600;
}

.ed-facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.ed-message {
  font-family: var(--font-code);
  font-size: 0.9rem;
}

.ed-chain {
  margin: 0;
  padding-left: 1.2rem;
}

.ed-yourcode {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-s);
  padding: 6px 10px;
}

.ed-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.ed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ed-table th,
.ed-table td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.ed-table th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.ed-table td:nth-child(3) {
  overflow-wrap: anywhere;
  min-width: 14rem;
}

.ed-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
  min-width: 0;
  scroll-margin-top: 80px;
}

.ed-card-top {
  border-color: var(--ok);
}

.ed-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 14px 16px 6px;
}

.ed-card-title {
  flex: 1 1 100%;
  margin: 4px 0 0;
  font-size: 1.1rem;
  line-height: 1.35;
}

.ed-card-body {
  display: grid;
  gap: 12px;
  padding: 6px 16px 16px;
  min-width: 0;
}

.ed-block h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--muted);
  text-transform: none;
}

.ed-block p {
  margin: 0;
}

.ed-snippet {
  margin: 0;
  padding: 10px 12px;
  max-height: 16rem;
  overflow: auto;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  font-family: var(--font-code);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre;
}

.ed-snippet mark {
  background: var(--warn-soft);
  color: inherit;
  border-bottom: 2px solid var(--warn);
  border-radius: 2px;
  padding: 0 1px;
}

.ed-more {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 8px 12px;
}

.ed-more > summary {
  cursor: pointer;
  font-weight: 600;
}

.ed-more > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ed-more ul {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.ed-more .ed-snippet {
  margin-top: 10px;
}

.ed-fixes {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 10px;
}

.ed-fix-text {
  overflow-wrap: anywhere;
}

.ed-code {
  position: relative;
  margin-top: 8px;
}

.ed-code pre {
  margin: 0;
  padding: 10px 12px;
  padding-right: 4.5rem;
  overflow: auto;
  background: var(--code-bg);
  color: var(--code-fg);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  font-family: var(--font-code);
  font-size: 0.84rem;
  line-height: 1.5;
}

.ed-copy {
  position: absolute;
  top: 6px;
  right: 6px;
}

.ed-links {
  margin: 0;
  padding-left: 1.2rem;
}

.ed-rest {
  border: 1px dashed var(--line);
  border-radius: var(--radius-m);
  padding: 8px 12px;
}

.ed-rest > summary {
  cursor: pointer;
  font-weight: 600;
}

.ed-unknown .panel-body ol {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 6px;
}

@media (max-width: 640px) {
  .ed-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .ed-facts dd {
    margin-bottom: 8px;
  }

  .ed-count {
    margin-left: 0;
    flex: 1 1 100%;
  }

  .ed-card-head,
  .ed-card-body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .ed-table th:nth-child(1),
  .ed-table td:nth-child(1) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ed-card,
  .ed-more {
    scroll-behavior: auto;
    transition: none;
  }
}

.ed,
.ed-results,
.ed-card-body {
  grid-template-columns: minmax(0, 1fr);
}

.ed > *,
.ed-results > *,
.ed-card-body > *,
.ed-card-body .ed-block,
.ed-more {
  min-width: 0;
  max-width: 100%;
}

.ed-summary .panel-head,
.ed-javac .panel-head,
.ed-unknown .panel-head {
  padding-top: 10px;
  padding-bottom: 10px;
}

.ed-summary .panel-head h3,
.ed-javac .panel-head h3,
.ed-unknown .panel-head h3,
.ed-section-title {
  margin: 0;
  font-size: 1.05rem;
}

.ed-block p,
.ed-fix-text,
.ed-more li {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .ed-table,
  .ed-table tbody,
  .ed-table tr,
  .ed-table td {
    display: block;
    width: 100%;
  }

  .ed-table thead {
    display: none;
  }

  .ed-table tr {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }

  .ed-table td {
    border: 0;
    padding: 2px 4px;
  }

  .ed-table td:nth-child(3) {
    min-width: 0;
  }
}
