* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color: #202124;
  background: #f6f7f9;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

h1 {
  margin: 0 0 32px;
  font-size: 28px;
}

.sentence-pair + .sentence-pair {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid #d9dce1;
}

.sentence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border: 1px solid #d9dce1;
  background: white;
}

.language-panel {
  min-width: 0;
  min-height: 240px;
  padding: 28px;
}

.language-panel + .language-panel {
  border-left: 1px solid #d9dce1;
}

h2 {
  margin: 0 0 24px;
  color: #68707d;
  font-size: 14px;
}

.sentence {
  position: relative;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 2;
}

.sentence__search-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.alignment-control {
  display: inline;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.alignment-fragment {
  padding: 2px 0;
  border-radius: 3px;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
  transition: background-color 120ms ease, text-decoration-color 120ms ease;
}

.alignment-fragment.is-hovered {
  background: #edf2fb;
  text-decoration-color: #8290a7;
  text-decoration-style: dashed;
}

.alignment-fragment.is-focused {
  background: #e4ecfb;
  text-decoration-color: #526b94;
}

.alignment-fragment.is-selected {
  background: #ffe48a;
  text-decoration: none;
}

.alignment-control:focus-visible {
  outline: 2px solid #365f9d;
  outline-offset: 2px;
}

.hangul-syllable {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  isolation: isolate;
}

.hangul-syllable__original {
  position: relative;
  z-index: 1;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  pointer-events: none;
}

.hangul-syllable__components {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1em;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
}

.hangul-syllable__marker {
  position: absolute;
  z-index: 0;
  border-radius: 3px;
  background: transparent;
}

.hangul-syllable__marker.is-hovered {
  background: #edf2fb;
}

.hangul-syllable__marker.is-focused {
  background: #e4ecfb;
}

.hangul-syllable__marker.is-selected {
  background: #ffe48a;
}

.hangul-syllable__hit {
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  pointer-events: auto;
}

.hangul-syllable__hit:focus-visible {
  outline-offset: 1px;
}

@media (max-width: 700px) {
  main {
    padding: 32px 16px;
  }

  .sentence-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .language-panel {
    min-height: 0;
    padding: 24px;
  }

  .language-panel + .language-panel {
    border-top: 1px solid #d9dce1;
    border-left: 0;
  }
}
