body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  background: #f6f8fa;
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* 横スクロール完全防止！ */
}

.navbar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center; /* 高さ中央揃え */
  gap: 16px;
  padding: 22px 38px 0 0;
  box-sizing: border-box;
  background: transparent;
}
.navbar span {
  margin-right: 12px;
  color: #124076;
  font-weight: 600;
  font-size: 1.07em;
  letter-spacing: 0.01em;
  align-self: center;
  vertical-align: middle;
  line-height: 1.6;
}
.navbar button {
  background: #fff;
  color: #124076;
  border: 1.7px solid #124076;
  padding: 7px 18px;
  border-radius: 7px;
  font-size: 1.07em;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border 0.13s;
  box-shadow: none;
  outline: none;
  align-self: center;
  vertical-align: middle;
  line-height: 1.6;
}
.navbar button:hover {
  background: #124076;
  color: #fff;
  border-color: #124076;
}

/* メインフォームの中央揃え */
.main.single-column {
  max-width: 540px;
  margin: 54px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  padding: 34px 30px 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  box-sizing: border-box;
  min-width: 0;
}

.single-column form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 10px;
  width: 100%;
  box-sizing: border-box;
}

.single-column label {
  font-size: 1.07em;
  color: #274272;
  font-weight: 500;
  margin-bottom: 2px;
  width: 100%;
  box-sizing: border-box;
}

.single-column input[type="text"] {
  width: 100%;
  font-size: 1em;
  padding: 9px 10px;
  border: 1.2px solid #b2becd;
  border-radius: 7px;
  margin-top: 6px;
  background: #fafcff;
  transition: border 0.18s;
  box-sizing: border-box;
}

.single-column input[type="text"]:focus,
.single-column textarea:focus {
  border: 1.2px solid #2366d1;
  outline: none;
  background: #f0f8ff;
}

/* テキストエリアをより大きく＋読みやすく */
.big-textarea,
.single-column textarea {
  width: 100%;
  min-height: 200px;
  height: 210px;
  font-size: 1.09em;
  font-family: 'Segoe UI', 'Arial', 'Consolas', monospace;
  padding: 14px 12px;
  border-radius: 8px;
  border: 1.5px solid #b2becd;
  margin-top: 6px;
  background: #f8f8fd;
  resize: vertical;
  transition: border 0.18s;
  box-sizing: border-box;
}

.single-column textarea:focus {
  border: 1.5px solid #2366d1;
  background: #f0f8ff;
}

.required-label {
  color: #e84d5a;
  font-weight: bold;
  font-size: 0.96em;
  margin-left: 6px;
}
.optional-label {
  color: #888;
  font-size: 0.93em;
  margin-left: 6px;
}

/* ---- ファイル選択ボタンのカスタム ---- */
.custom-file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.custom-file input[type="file"] {
  opacity: 0;
  width: 0.1px;
  height: 0.1px;
  position: absolute;
  z-index: -1;
}
.file-label {
  display: inline-block;
  background: #fff;
  color: #2366d1;
  border: 1.7px solid #2366d1;
  padding: 9px 23px;
  border-radius: 7px;
  font-size: 1em;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.14s, color 0.14s, border 0.14s;
  box-shadow: none;
}
.file-label:hover {
  background: #2366d1;
  color: #fff;
  border-color: #2366d1;
}
.file-name {
  font-size: 0.98em;
  color: #324d7c;
  margin-left: 2px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  white-space: nowrap;
}

/* 通常ボタン（フォーム送信など） */
.single-column button,
button {
  margin-top: 12px;
  padding: 13px 0;
  font-size: 1.09em;
  border-radius: 8px;
  background: #2366d1;
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: 0 2px 8px rgba(35,102,209,0.06);
  width: 100%;
}
.single-column button:hover,
button:hover {
  background: #124076;
}

/* 結果ブロックは上に余白少なめでピシッと */
.single-column #result, .single-column .result-block {
  background: #f7fafd;
  padding: 18px;
  border-radius: 8px;
  margin-top: 0;
  margin-bottom: 22px;
  min-height: 44px;
  color: #26333d;
  font-size: 1.07em;
  box-shadow: 0 2px 8px rgba(35,102,209,0.03);
  white-space: pre-wrap;
  width: 100%;
  box-sizing: border-box;
}

/* スクロール時の横幅崩れ防止 */
.main.single-column,
.single-column form,
.single-column label,
.single-column #result,
.single-column .result-block {
  box-sizing: border-box;
}

/* ファイルサイズ説明 */
.filesize-note {
  color: #666;
  font-size: 0.98em;
  margin-top: 2px;
  margin-bottom: 10px;
  word-break: break-all;
}

/* メディアクエリでスマホ対応 */
@media (max-width: 600px) {
  .main.single-column {
    max-width: 98vw;
    padding: 4vw 2vw;
    min-width: 0;
  }
  .navbar { padding-right: 2vw; }
  .custom-file .file-name { max-width: 32vw; }
}
@media (max-width: 700px) {
  .main, .side-info-block, .main-form { padding: 4vw 2vw; }
  .main-form textarea { height: 140px; font-size: 13px; }
  h2 { font-size: 1.17em; }
}

/* ------- markdown / result装飾ここから下（任意） --------- */
.result-block h1, .result-block h2, .result-block h3, .result-block h4, .result-block h5, .result-block h6 {
  font-weight: bold;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  color: #2366d1;
}
.result-block ul, .result-block ol {
  margin-left: 1.2em;
  margin-bottom: 1.1em;
}
.result-block li {
  margin-bottom: 0.18em;
}
.result-block pre, .result-block code {
  background: #eef4fa;
  color: #3d4451;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.97em;
}
.result-block strong {
  color: #124076;
}
.result-block blockquote {
  border-left: 4px solid #b3d5fd;
  background: #f3f7fb;
  margin: 1em 0;
  padding: 0.9em 1em;
  color: #40546a;
  border-radius: 5px;
  font-style: italic;
}
