:root {
  --surface: #ffffff;
  --border: #d9dce3;
  --bg: #f5f6fb;
  --text: #111827;
  --muted: #475467;
  --accent: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", "Roboto", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
}

header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.9rem;
}

header p {
  margin: 0;
  color: var(--muted);
}

.editor-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.editor-panel,
.output-panel {
  flex: none;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.editor-surface {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.editor-surface #toolbar {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

#toolbar {
  width: 100%;
}

#editor {
  min-height: 320px;
  border: none;
  background: #fff;
}

.editor-meta {
  margin-top: 0.6rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}

#charCount.limit {
  color: #b91c1c;
  font-weight: 600;
}

.output-panel label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

#output {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  resize: vertical;
  background: #fdfdfd;
  color: var(--text);
  font-family: "JetBrains Mono", "Cascadia Code", monospace;
  font-size: 0.95rem;
}

.button-row {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

#copyBtn {
  background: var(--accent);
  color: #fff;
}

#copyBtn:not(:disabled):hover {
  background: #1d4ed8;
}

#copyBtn:disabled {
  opacity: 0.65;
  cursor: default;
}

#resetBtn {
  background: #e4e7ec;
  color: #101828;
}

#resetBtn:hover {
  background: #d0d5dd;
}

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

code {
  background: #eef2ff;
  padding: 0.05rem 0.35rem;
  border-radius: 6px;
}

@media (max-width: 768px) {
  body {
    background: #fff;
  }

  .app {
    padding: 1.25rem 1rem 2rem;
  }
}
