@font-face {
  font-family: 'Noto Sans Phonetic';
  src: url('fonts/NotoSans-phonetic.woff') format('woff'),
       url('fonts/NotoSans-phonetic.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #e4eaf2;
  --card: #FFF;
  --border: #2a2a33;
  --text: #000;
  --muted: #333;
  --accent: #1e90ff;
}

.script {
  font-family: 'Noto Sans Phonetic', 'Noto Sans', 'Segoe UI', 'DejaVu Sans', 'Lucida Grande', sans-serif;
  font-feature-settings: "mark", "mkmk", "ccmp";
  letter-spacing: normal;
  overflow-wrap: normal;
  word-break: normal;
}

label.field {
  display: block;
  margin-bottom: 1.25rem;
  font-weight: 600;
}

label.field:last-of-type {
  margin-bottom: 0;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.15rem;
}

.mode-btn {
  padding: 8px 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: bold .95rem/1.5 'Manrope', sans-serif;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.mode-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mode-btn.is-active {
  background: #2a2a33;
  border-color: #2a2a33;
  color: #FFF;
}

.mode-btn.is-active:hover {
  background: #1E90FF;
  border-color: #1E90FF;
  color: #FFF;
}

.output-row {
  display: flex;
  align-items: stretch;
  gap: .5rem;
}

textarea {
  display: block;
  width: 100%;
  min-height: 8rem;
  margin-top: .4rem;
  padding: 1.05rem 1rem .8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #e4eaf2;
  color: var(--text);
  font: 1.15rem/1.7 ui-monospace, monospace;
  resize: vertical;
}

textarea.script {
  font-family: 'Noto Sans Phonetic', 'Noto Sans', 'Segoe UI', 'DejaVu Sans', 'Lucida Grande', sans-serif;
  font-size: 1.35rem;
  line-height: 1.7;
  letter-spacing: normal;
  overflow-wrap: normal;
  word-break: normal;
}

textarea:focus,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

textarea[readonly] {
  cursor: default;
}

.copy-btn {
  flex: 0 0 auto;
  align-self: stretch;
  padding: 8px 16px;
  margin-top: .4rem;
  border: 0;
  border-radius: 8px;
  background: #2a2a33;
  color: #FFF;
  font: bold .95rem/1.5 'Manrope', sans-serif;
  cursor: pointer;
  transition: background .2s;
  min-width: 5.5rem;
}

.copy-btn:hover:not(:disabled) {
  background: #1E90FF;
}

.copy-btn:disabled {
  opacity: .6;
  cursor: default;
}

@media (max-width: 650px) {
  textarea { font-size: 16px; }
  textarea.script { font-size: 1.2rem; }
  .output-row { flex-direction: column; }
  .copy-btn { align-self: flex-end; margin-top: 0; min-height: 2.75rem; }
}

.status {
  min-height: 1.3em;
  margin: .7rem 0 0;
  font-size: .85rem;
  font-weight: 600;
  color: #b00020;
}

.status:empty {
  display: none;
}
