:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #20232a;
  background: #e8f1fb;
}

body {
  max-width: 760px;
  margin: 32px auto;
  padding: 0 20px 32px;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(239,246,255,0.96), rgba(227,238,251,0.92) 45%, rgba(216,229,247,0.9) 100%);
}

.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.site-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #1d4f9c;
}

label {
  display: block;
  margin-bottom: 10px;
  color: #4d5b6b;
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 140px;
  padding: 14px 16px;
  font-size: 1rem;
  line-height: 1.6;
  border: 1px solid #d7dfe8;
  border-radius: 16px;
  resize: vertical;
  background: #f8fafc;
  box-shadow: inset 0 1px 2px rgba(16,24,40,0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: #f08b3a;
  box-shadow: 0 0 0 4px rgba(240, 139, 58, 0.12);
}

button {
  margin-top: 12px;
  padding: 12px 18px;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f69d9, #0d5bb2);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(15,105,217,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button-row button {
  margin-top: 0;
}

button:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #1069e3, #0a57a8);
  box-shadow: 0 16px 28px rgba(15,105,217,0.16);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 0;
}

button.toggle-button {
  padding: 10px 14px;
  font-size: 0.95rem;
  border-radius: 999px;
  background: #f0f4f9;
  color: #333;
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.08);
}

button.toggle-button:hover {
  background: #dde5ef;
}

#transcriberForm {
  padding: 24px;
  border-radius: 24px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 20px 40px rgba(15,23,42,0.08);
}

#transcriberForm label,
#output,
.result-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sentence-word {
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.sentence-word:hover {
  background: transparent;
}

.sentence-word.no-link {
  cursor: default;
  text-decoration: none;
}

.sentence-word.not-found {
  color: #6a6a6a;
}

.tooltip {
  position: absolute;
  z-index: 1000;
  display: none;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(27, 70, 124, 0.12);
  background: rgba(255,255,255,0.98);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  font-size: 0.95rem;
  color: #111;
}

.tooltip.show {
  display: block;
}

.tooltip .tooltip-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.tooltip .result-meta {
  margin-top: 8px;
}

.tooltip .result-alternatives,
.tooltip .result-notes {
  margin-top: 10px;
}

.result-value {
  margin: 10px 0;
  font-size: 1rem;
}

.result-alternatives,
.result-notes,
.result-notes-summary {
  margin-top: 14px;
}

.result-alternatives ul,
.result-notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
}

.modal.show {
  display: flex;
}

.modal-content {
  position: relative;
  width: min(620px, 90vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #e1e5ea;
  color: #111;
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-close:hover {
  background: #c7cdd4;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-content .result-meta {
  margin-top: 12px;
}

#outputList .sentence-text {
  padding: 18px 20px;
  line-height: 1.8;
  border-radius: 18px;
  background: #fcfdff;
  border: 1px solid #e6ecf5;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  white-space: pre-wrap;
}

#outputList .sentence-text span {
  display: inline;
}

#outputList .sentence-text .sentence-word + .sentence-word {
  margin-left: 0.1rem;
}

#outputList .sentence-text .sentence-word {
  padding: 0 3px;
  border-radius: 6px;
}

#outputList .sentence-text .sentence-word:hover {
  text-decoration: none;
  background: rgba(17, 81, 209, 0.08);
}

#output {
  margin-top: 24px;
  padding: 18px 20px;
  min-height: 30px;
  border: 1px solid #e1e8f3;
  border-radius: 18px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 8px 30px rgba(15,23,42,0.06);
  white-space: pre-wrap;
}

#outputList {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.result-item {
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(14, 54, 105, 0.08);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.result-token {
  font-size: 1.08rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #12315a;
}

.result-meta {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  color: #333;
}

.result-meta span {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f1f5f9;
}

.status.found {
  color: #1f6e3f;
}

.status.not-found {
  color: #b02a37;
}

pre {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
}