:root {
  --bg: #070a10;
  --panel: #0d1420;
  --panel-border: #1c2a3f;
  --text: #e8f1f8;
  --muted: #8fa6bd;
  --accent: #00e5ff;
  --accent-dark: #06222b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.6;
}

header, main, footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

header { padding-top: 28px; }
h1 { font-size: 1.5rem; margin: 0 0 4px; color: var(--accent); }
.sub { margin: 0 0 20px; color: var(--muted); font-size: 0.9rem; }

h2 { font-size: 1rem; margin: 0 0 12px; color: var(--accent); }

section { margin-bottom: 20px; }

.panel, .editor {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 16px;
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.counts strong { color: var(--text); font-size: 1rem; }

textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  background: #05080d;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.7;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

input[type="text"] {
  background: #05080d;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.95rem;
  width: 100%;
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.replace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.replace-grid label { font-size: 0.85rem; color: var(--muted); display: block; }
.replace-grid input { margin-top: 4px; }

.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.actions-top { margin-top: 12px; flex-wrap: wrap; }

button {
  background: var(--accent-dark);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}
button:hover:not(:disabled) { background: #0a3542; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.radio { font-size: 0.9rem; cursor: pointer; }
.radio input { accent-color: var(--accent); }

.message { font-size: 0.85rem; color: var(--accent); min-height: 1em; }

footer { padding-bottom: 28px; }
footer p { color: var(--muted); font-size: 0.8rem; }

@media (max-width: 640px) {
  .replace-grid { grid-template-columns: 1fr; }
  textarea { min-height: 200px; }
  button { padding: 10px 12px; }
  h1 { font-size: 1.25rem; }
}
