[data-drug-likeness] {
  --lipophilic: var(--warning);
  --hydrophilic: var(--info);
}

[data-drug-likeness][aria-busy="true"] .workspace-output {
  opacity: 0.55;
  transition: opacity 200ms ease;
}

.dl-column {
  display: grid;
  gap: var(--space-4);
}

.dl-error {
  display: grid;
  gap: 4px;
}

.dl-error code {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.dl-error mark {
  border-radius: 2px;
  background: color-mix(in srgb, var(--danger) 22%, transparent);
  color: var(--danger);
}

.dl-figure {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.dl-art {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: var(--space-3);
  border-radius: var(--radius);
  background: var(--background-subtle);
}

.dl-art .structure {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 360px;
}

.dl-identity {
  display: grid;
  gap: 2px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dl-identity strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.dl-map circle {
  opacity: 0;
  transition: opacity 150ms ease;
}

.dl-map .lipophilic {
  fill: var(--lipophilic);
}

.dl-map .hydrophilic {
  fill: var(--hydrophilic);
}

.dl-figure[data-map="on"] .dl-map circle,
.dl-map circle.focus {
  opacity: 1;
}

.dl-map circle.focus {
  stroke: var(--text);
  stroke-width: 1.6;
}

.dl-legend {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.panel-body:has(.dl-figure[data-map="on"]) .dl-legend {
  display: flex;
}

.dl-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dl-swatch + .dl-swatch,
.dl-legend .dl-swatch:not(:first-child) {
  margin-left: var(--space-3);
}

.dl-swatch.lipophilic {
  background: var(--lipophilic);
}

.dl-swatch.hydrophilic {
  background: var(--hydrophilic);
}

.dl-rules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.dl-rule {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background-subtle);
}

.dl-rule[data-pass="false"] {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}

.dl-rule-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
}

.dl-rule-head strong {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.dl-rule-mark {
  flex: none;
  color: var(--success);
}

.dl-rule-state {
  color: var(--success);
  font-size: 12.5px;
  font-weight: 600;
}

.dl-rule[data-pass="false"] .dl-rule-mark,
.dl-rule[data-pass="false"] .dl-rule-state {
  color: var(--danger);
}

.dl-qed .dl-rule-mark {
  color: var(--text-muted);
}

.dl-qed .dl-rule-state {
  color: var(--text);
  font-size: 15px;
}

.dl-violations {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.dl-rule-note {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.dl-rule-source {
  color: var(--text-subtle);
  font-size: 11.5px;
}

.dl-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.dl-meter span {
  display: block;
  width: calc(var(--value) * 100%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.dl-radar-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
}

@media (max-width: 1180px) {
  .dl-radar-body {
    grid-template-columns: minmax(0, 1fr);
  }
}

.dl-radar {
  display: block;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  overflow: visible;
}

.dl-radar-grid {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1;
}

.dl-radar-zone {
  fill: color-mix(in srgb, var(--accent) 18%, transparent);
  stroke: color-mix(in srgb, var(--accent) 50%, transparent);
  stroke-width: 1;
}

.dl-radar-shape {
  fill: color-mix(in srgb, var(--text) 7%, transparent);
  stroke: var(--text);
  stroke-width: 2;
  stroke-linejoin: round;
}

.dl-radar-point {
  fill: var(--text);
  stroke: var(--surface);
  stroke-width: 2;
}

.dl-radar-point[data-inside="false"] {
  fill: var(--danger);
}

.dl-radar-labels text {
  fill: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
}

.dl-table tbody th,
.dl-table tfoot th {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  white-space: normal;
}

.dl-table tfoot th,
.dl-table tfoot td {
  border-top: 1px solid var(--border-strong);
  border-bottom: 0;
  font-weight: 600;
}

.dl-table tbody tr:last-child th,
.dl-table tbody tr:last-child td {
  border-bottom: 0;
}

.dl-table th small,
.dl-table td small {
  display: block;
  color: var(--text-subtle);
  font-size: 11.5px;
  font-weight: 400;
}

.dl-table .numeric {
  text-align: right;
  white-space: nowrap;
}

.dl-table td.numeric {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.dl-table td.numeric small {
  display: inline;
  font-family: var(--font-sans);
}

.dl-table tr[data-pass="false"] td.numeric {
  color: var(--danger);
}

.dl-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dl-limit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.dl-limit .icon {
  color: var(--success);
}

.dl-limit[data-pass="false"] {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  color: var(--danger);
}

.dl-limit[data-pass="false"] .icon {
  color: var(--danger);
}

.dl-atoms tbody tr:hover > *,
.dl-atoms tbody tr:focus-visible > * {
  background: var(--surface-hover);
}

.dl-atoms tbody tr:focus-visible {
  outline: none;
}

.dl-more details + details {
  border-top: 1px solid var(--border);
}

.dl-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
}

.dl-more summary::-webkit-details-marker {
  display: none;
}

.dl-more summary::after {
  content: "+";
  color: var(--text-subtle);
  font-size: 18px;
  font-weight: 400;
}

.dl-more details[open] summary::after {
  content: "\2212";
}

.dl-more details .panel-body {
  padding-top: 0;
}

.dl-subheading {
  font-size: 13px;
  font-weight: 600;
}

.dl-caption {
  margin-top: var(--space-2);
  color: var(--text-subtle);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 560px) {
  .dl-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .dl-table tbody,
  .dl-table tfoot {
    display: block;
  }

  .dl-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    column-gap: var(--space-3);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
  }

  .dl-table tbody tr:last-child {
    border-bottom: 0;
  }

  .dl-table tbody th,
  .dl-table tfoot th,
  .dl-table td {
    padding: 0;
    border: 0;
  }

  .dl-table tfoot tr {
    border-top: 1px solid var(--border-strong);
    border-bottom: 0;
  }

  .dl-table td:not(.numeric) {
    grid-column: 1 / -1;
    margin-top: 6px;
  }

  .dl-table td.dl-none {
    display: none;
  }

  .dl-atoms tbody tr {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }

  .dl-atoms tbody td.mono {
    grid-column: auto;
    margin-top: 0;
  }

  .dl-atoms tbody td:nth-child(3) {
    order: 5;
    color: var(--text-muted);
    font-size: 12.5px;
  }
}
