* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #1c1e21;
  min-height: 100vh;
}

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

header h1 { font-size: 1.6rem; margin-bottom: .25rem; }

.hint { color: #555; font-size: .9rem; margin-bottom: 1rem; }
.hint code { background: #e8eaee; padding: .1rem .3rem; border-radius: 4px; }

.editor {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: stretch;
}

.pane { display: flex; flex-direction: column; gap: .4rem; }
.pane label { font-weight: 600; font-size: .9rem; }

textarea {
  width: 100%;
  min-height: 420px;
  padding: .75rem;
  border: 1px solid #c6cad2;
  border-radius: 8px;
  font: inherit;
  font-size: .95rem;
  resize: vertical;
  background: #fff;
}
textarea:focus { outline: 2px solid #4a7dff; border-color: transparent; }
textarea[readonly] { background: #fbfbfc; }

.actions { display: flex; align-items: center; }

button {
  padding: .6rem 1.1rem;
  border: none;
  border-radius: 8px;
  background: #2f6bff;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { background: #a9b6d8; cursor: not-allowed; }
button:hover:not(:disabled) { background: #1f56e0; }

.result-actions { display: flex; gap: .5rem; margin-top: .5rem; }
#copy-btn { background: #1d9a5b; }
#copy-btn:hover { background: #157a47; }
#diff-btn.secondary { background: #e8eaee; color: #1c1e21; font-weight: 500; }
#diff-btn.secondary:hover { background: #d8dbe2; }

.diff {
  min-height: 420px;
  padding: .75rem;
  border: 1px solid #c6cad2;
  border-radius: 8px;
  background: #fbfbfc;
  font-size: .95rem;
  line-height: 1.5;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.diff del { background: #ffe3e3; color: #8f1c1c; }
.diff ins { background: #d9f2e4; color: #12603a; text-decoration: none; }

.usage { color: #667; font-size: .8rem; margin-top: .35rem; }

.status { margin-top: 1rem; padding: .6rem .8rem; border-radius: 8px; font-size: .9rem; }
.status.info { background: #e8f0ff; color: #1c3d8f; }
.status.warn { background: #fff3d6; color: #7a5b00; }
.status.error { background: #ffe3e3; color: #8f1c1c; }

.hidden { display: none !important; }

.overlay {
  position: fixed; inset: 0;
  background: rgba(20, 22, 30, .55);
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.login-box {
  background: #fff; border-radius: 12px; padding: 2rem;
  display: flex; flex-direction: column; gap: .8rem; width: 320px;
}
.login-box input { padding: .6rem; border: 1px solid #c6cad2; border-radius: 8px; font: inherit; }
.error { color: #8f1c1c; font-size: .85rem; }

@media (max-width: 800px) {
  .editor { grid-template-columns: 1fr; }
  .actions { justify-content: center; }
  textarea { min-height: 240px; }
}
