* {
  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 20px;
  font-size: 28px;
}

.selection-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.multi-select-toggle {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid #c8cdd5;
  border-radius: 6px;
  color: #3f4855;
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.multi-select-toggle:hover {
  border-color: #8290a7;
  background: #f2f5f9;
}

.multi-select-toggle[aria-pressed="true"] {
  border-color: #8a6400;
  color: #5e4600;
  background: #fff3c4;
}

.multi-select-toggle:focus-visible {
  outline: 2px solid #365f9d;
  outline-offset: 2px;
}

.selection-toolbar__help {
  margin: 0;
  color: #68707d;
  font-size: 13px;
  line-height: 1.5;
}

.sentence-pair + .sentence-pair {
  margin-top: 28px;
}

.sentence-pair {
  position: relative;
  border: 1px solid #d9dce1;
  background: white;
}

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

.sentence-headings {
  border-bottom: 1px solid #eceef1;
}

.language-heading {
  margin: 0;
  padding: 18px 28px;
  color: #68707d;
  font-size: 14px;
}

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

.meaning-unit-row + .meaning-unit-row {
  border-top: 1px solid #eceef1;
}

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

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

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

.natural-translation {
  margin: 0;
  padding: 16px 28px 20px;
  border-top: 1px solid #eceef1;
  color: #6f7782;
  font-size: 15px;
  line-height: 1.65;
}

.natural-translation__label {
  display: block;
  margin-bottom: 4px;
  color: #8a919c;
  font-size: 12px;
  font-weight: 600;
}

.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;
  }

  .selection-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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

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