:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d1d5db;
  --accent: #0f766e;
  --accent-dark: #115e59;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: linear-gradient(150deg, #ecfeff 0%, #f8fafc 55%, #e0f2fe 100%);
  color: var(--text);
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
}

.actions {
  display: flex;
  gap: 0.6rem;
}

button {
  border: 0;
  border-radius: 0.6rem;
  padding: 0.55rem 0.9rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.toolbar button {
  background: #e5e7eb;
  color: #111827;
  padding: 0.35rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.86rem;
}

.toolbar button:hover {
  background: #d1d5db;
}

.editor-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.panel {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  min-height: 72vh;
  overflow: hidden;
}

.panel-title {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

#editor {
  flex: 1;
  width: 100%;
  border: 0;
  resize: none;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  font-family: Consolas, "Courier New", monospace;
  color: var(--text);
  background: #fbfdff;
}

#editor:focus {
  outline: 2px solid rgba(15, 118, 110, 0.35);
  outline-offset: -2px;
}

.shortcut-note {
  margin: 0;
  padding: 0.65rem 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.preview {
  padding: 1rem;
  line-height: 1.75;
  overflow: auto;
}

.preview h1,
.preview h2,
.preview h3 {
  line-height: 1.3;
}

.preview pre {
  padding: 0.8rem;
  background: #111827;
  color: #e5e7eb;
  border-radius: 0.6rem;
  overflow: auto;
}

.preview code {
  font-family: Consolas, "Courier New", monospace;
}

.preview blockquote {
  border-left: 4px solid var(--accent);
  margin: 1rem 0;
  padding: 0.2rem 0 0.2rem 0.8rem;
  color: #374151;
}

.preview ul,
.preview ol {
  padding-left: 1.35rem;
}

.preview li {
  margin: 0.2rem 0;
}

@media (max-width: 900px) {
  .editor-wrap {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 42vh;
  }
}
