.ys-tool-application {
  width: 100%;
}

.ys-tool {
  box-sizing: border-box;
  width: 100%;
  padding: 24px;
  border-radius: 8px;
  background: #f5f7fa;
  color: #21252f;
}

.ys-tool *,
.ys-tool *::before,
.ys-tool *::after {
  box-sizing: border-box;
}

.ys-tool__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.ys-tool__input {
  display: block;
  width: 100%;
  min-height: 220px;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid #c5cdd8;
  border-radius: 6px;
  background: #fff;
  color: #21252f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}

.ys-tool__input:focus {
  outline: 2px solid #0d82f3;
  outline-offset: 2px;
}

.ys-tool__select {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #c5cdd8;
  border-radius: 6px;
  background: #fff;
  color: #21252f;
  font: inherit;
}

.ys-tool__select:focus {
  outline: 2px solid #0d82f3;
  outline-offset: 2px;
}

.ys-tool__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ys-tool__button {
  appearance: none;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: #0d82f3;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ys-tool__button--secondary {
  background: #21252f;
}

.ys-tool__button--ghost {
  background: transparent;
  color: #21252f;
  box-shadow: inset 0 0 0 1px #c5cdd8;
}

.ys-tool__button:focus {
  outline: 2px solid #0d82f3;
  outline-offset: 2px;
}

.ys-tool__status {
  min-height: 1.4em;
  margin: 12px 0 0;
}

.ys-tool__status--ok {
  color: #0a7a2f;
}

.ys-tool__status--error {
	color: #b00020;
}

.ys-tool__result {
	display: inline-block;
	margin: 12px 0 0;
	padding: 6px 10px;
	border-radius: 6px;
	font-weight: 700;
}

.ys-tool__result[hidden] {
	display: none;
}

.ys-tool__result--ok {
	background: #e5f6ea;
	color: #0a7a2f;
}

.ys-tool__result--error {
	background: #fde8eb;
	color: #b00020;
}

.ys-tool__hint {
	margin: 12px 0 0;
	color: #5b6472;
	font-size: 14px;
	line-height: 1.45;
}

.ys-tool__input--compact {
  min-height: 140px;
}

.ys-tool__output {
	min-height: 160px;
	background: #fff;
}

.ys-tool__output[readonly] {
	background: #fbfcfe;
}

.ys-tool__tree {
	margin-top: 12px;
	max-height: 420px;
	overflow: auto;
	padding: 12px;
	border: 1px solid #c5cdd8;
	border-radius: 6px;
	background: #fff;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	line-height: 1.5;
}

.ys-tree__children {
	margin-left: 16px;
	padding-left: 8px;
	border-left: 1px solid #e6eaf0;
}

.ys-tree__summary {
	cursor: pointer;
}

.ys-tree__summary:focus {
	outline: 2px solid #0d82f3;
	outline-offset: 2px;
}

.ys-tree__key {
	color: #21252f;
	font-weight: 600;
}

.ys-tree__meta {
	color: #5b6472;
}

.ys-tree__leaf {
	padding: 1px 0;
}

.ys-tree__value--string {
	color: #1b8a54;
}

.ys-tree__value--number {
	color: #0d82f3;
}

.ys-tree__value--boolean {
	color: #c8962e;
}

.ys-tree__value--null {
	color: #5b6472;
}

.ys-tree__limit {
	margin-top: 8px;
	color: #b00020;
}

.ys-tool--calc .ys-tool__field,
.ys-tool--calc .ys-tool__input,
.ys-tool--convert .ys-tool__field,
.ys-tool--convert .ys-tool__input,
.ys-tool--gen .ys-tool__field,
.ys-tool--gen .ys-tool__input--compact {
	min-height: 0;
	font-family: inherit;
}

.ys-tool--gen select.ys-tool__field {
	max-width: none;
	appearance: auto;
}

.ys-tool--calc select.ys-tool__select {
	max-width: none;
	margin: 0;
}

.ys-tool__swatch {
	width: 100%;
	height: 72px;
	margin: 0 0 16px;
	border: 1px solid #c5cdd8;
	border-radius: 6px;
	background: #fff;
}

.ys-tool__preview {
	width: 100%;
	min-height: 88px;
	margin: 0 0 16px;
	border: 1px solid #c5cdd8;
	border-radius: 6px;
	background: #fff;
}

.ys-tool--convert select.ys-tool__field {
	max-width: none;
	appearance: auto;
}

.ys-tool__field {
	display: block;
	width: 100%;
	margin: 0 0 16px;
	padding: 10px 12px;
	border: 1px solid #c5cdd8;
	border-radius: 6px;
	background: #fff;
	color: #21252f;
	font: inherit;
}

.ys-tool__field:focus {
	outline: 2px solid #0d82f3;
	outline-offset: 2px;
}

.ys-tool__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 12px;
}

.ys-tool__radios {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin: 0 0 16px;
}

.ys-tool__radio {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 500;
}

.ys-tool__results {
	margin: 16px 0 0;
	padding: 12px 14px;
	border: 1px solid #c5cdd8;
	border-radius: 6px;
	background: #fff;
}

.ys-tool__results[hidden] {
	display: none;
}

.ys-tool__results-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 0;
	border-top: 1px solid #e6eaf0;
}

.ys-tool__results-row:first-child {
	border-top: 0;
}

.ys-tool__results-row dt {
	margin: 0;
	font-weight: 600;
}

.ys-tool__results-row dd {
	margin: 0;
	text-align: right;
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.ys-tool__checks {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin: 0 0 16px;
}

.ys-tool__check {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 500;
}

.ys-tool__option-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 12px;
	margin: 0 0 8px;
}

.ys-tool--image .ys-tool__stage {
	position: relative;
	margin: 12px 0 0;
	max-width: 100%;
	overflow: hidden;
	border: 1px solid #c5cdd8;
	border-radius: 6px;
	background: #f4f6f8;
}

.ys-tool--image .ys-tool__stage[hidden] {
	display: none;
}

.ys-tool--image canvas {
	display: block;
	max-width: 100%;
	height: auto;
	vertical-align: top;
	touch-action: none;
}

.ys-tool--image .ys-tool__stage--pick canvas {
	cursor: crosshair;
}

.ys-tool--image .ys-tool__stage--alpha {
	background-color: #fff;
	background-image:
		linear-gradient(45deg, #d5dbe3 25%, transparent 25%),
		linear-gradient(-45deg, #d5dbe3 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #d5dbe3 75%),
		linear-gradient(-45deg, transparent 75%, #d5dbe3 75%);
	background-size: 16px 16px;
	background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.ys-tool[data-ys-tool="image-palette-extractor"] .ys-tool__table th {
	width: auto;
}

.ys-tool--image textarea.ys-tool__output,
.ys-tool--image textarea.ys-tool__field {
	width: 100%;
	min-height: 96px;
	resize: vertical;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	word-break: break-all;
}

.ys-tool--dev .ys-tool__actions {
	margin: 0 0 16px;
}

.ys-freq-wrap {
	max-height: 28rem;
	overflow: auto;
	margin: 0 0 16px;
}

.ys-tool[data-ys-tool="word-frequency-counter"] .ys-tool__table th,
.ys-tool[data-ys-tool="invisible-character-remover"] .ys-tool__table th {
	width: auto;
}

.ys-tool__table {
	width: 100%;
	margin: 0 0 16px;
	border-collapse: collapse;
	font-size: 14px;
}

.ys-tool__table th,
.ys-tool__table td {
	padding: 6px 8px;
	border-bottom: 1px solid #d5dbe3;
	text-align: left;
	vertical-align: top;
	word-break: break-word;
}

.ys-tool__table th {
	width: 28%;
	font-weight: 600;
}

.ys-tool[data-ys-tool="html-link-extractor"] .ys-tool__table {
	table-layout: fixed;
}

.ys-tool[data-ys-tool="html-link-extractor"] .ys-tool__table th {
	width: auto;
}

.ys-tool[data-ys-tool="url-query-string-builder"] .ys-qsb__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
	gap: 8px;
	align-items: end;
	margin: 0 0 12px;
}

.ys-tool[data-ys-tool="url-query-string-builder"] .ys-qsb__row .ys-tool__field {
	margin-bottom: 0;
}

.ys-tool[data-ys-tool="url-query-string-builder"] .ys-qsb__prefix {
	display: flex;
	gap: 8px;
	align-items: center;
	margin: 0 0 16px;
	font-weight: 600;
}

.ys-diff__row {
	margin: 0;
	padding: 4px 8px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 13px;
	line-height: 1.45;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.ys-diff__row--a {
	background: #fde8e8;
}

.ys-diff__row--b {
	background: #e5f6e8;
}

.ys-diff__row--same {
	background: #fff;
}

.ys-diff__row--skip {
	color: #3d4754;
	background: #eef2f6;
}

.ys-contrast__samples {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 0 0 12px;
}

.ys-contrast__swatch {
	width: 48px;
	height: 48px;
	border: 1px solid #c5cdd8;
	border-radius: 6px;
}

.ys-contrast__ratio,
.ys-contrast__check,
.ys-pxrem__number,
.ys-pxrem__decl {
	margin: 0 0 8px;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.ys-contrast__check,
.ys-pxrem__decl,
.ys-pxrem__number {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ys-chmod__groups {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin: 0 0 16px;
}

.ys-chmod__group {
	margin: 0;
	padding: 8px 10px 10px;
	border: 1px solid #d5dbe3;
	border-radius: 6px;
}

.ys-chmod__group legend {
	padding: 0 4px;
	font-weight: 600;
}

.ys-chmod__group .ys-tool__check {
	margin: 6px 0 0;
}

.ys-clamp__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 12px;
}

.ys-clamp__meta,
.ys-clamp__decl,
.ys-unicode__summary {
	margin: 0 0 8px;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.ys-clamp__decl,
.ys-unicode__summary {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ys-unicode__summary {
	white-space: pre-line;
}

.ys-tool[data-ys-tool="unicode-code-point-inspector"] .ys-tool__block {
	overflow-x: auto;
}

.ys-tool[data-ys-tool="unicode-code-point-inspector"] .ys-tool__table th,
.ys-tool[data-ys-tool="ipv4-subnet-calculator"] .ys-tool__table th,
.ys-tool[data-ys-tool="ipv6-subnet-calculator"] .ys-tool__table th,
.ys-tool[data-ys-tool="unicode-normalization"] .ys-tool__table th,
.ys-tool[data-ys-tool="ieee-754-converter"] .ys-tool__table th,
.ys-tool[data-ys-tool="bitwise-calculator"] .ys-tool__table th,
.ys-tool[data-ys-tool="json-pointer-resolver"] .ys-tool__table th,
.ys-tool[data-ys-tool="line-set-compare"] .ys-tool__table th,
.ys-tool[data-ys-tool="subresource-integrity-generator"] .ys-tool__table th,
.ys-tool[data-ys-tool="source-map-decoder"] .ys-tool__table th {
	width: auto;
}

.ys-norm__output {
	margin: 0 0 12px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ys-tool [data-ys-b-wrap][hidden] {
	display: none;
}

.ys-tool input[type="file"] {
	max-width: 100%;
	font: inherit;
}

.ys-set__heading {
	margin: 12px 0 4px;
	font-weight: 600;
}

.ys-set__list,
.ys-map__embed {
	margin: 0 0 12px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ys-tool__block[hidden] {
	display: none;
}

.ys-coord__set {
	margin: 0 0 16px;
	padding: 12px 12px 0;
	border: 1px solid #c5cdd8;
	border-radius: 6px;
}

.ys-coord__set legend {
	padding: 0 6px;
	font-weight: 600;
}

.ys-coord__fields {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0 12px;
}

@media (max-width: 600px) {
  .ys-tool {
    padding: 16px;
  }

  .ys-tool__button {
    flex: 1 1 calc(50% - 8px);
  }

  .ys-tool__grid {
    grid-template-columns: 1fr;
  }

  .ys-coord__fields {
    grid-template-columns: 1fr 1fr;
  }

  .ys-tool__option-row {
    grid-template-columns: 1fr;
  }

  .ys-tool[data-ys-tool="url-query-string-builder"] .ys-qsb__row {
    grid-template-columns: 1fr;
  }

  .ys-chmod__groups,
  .ys-clamp__grid {
    grid-template-columns: 1fr 1fr;
  }
}
