/* Markdown to HTML Converter v3 — 一体型エディタカード */
.mdc { margin: 10px 0 28px; }
.mdc-card {
  border: 1.5px solid #221d18;
  border-radius: 16px;
  background: #fff;
  box-shadow: 6px 6px 0 rgba(34, 29, 24, 0.12);
  overflow: hidden;
}

/* ---------- ツールバー ---------- */
.mdc-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: #fff4e6;
  border-bottom: 1.5px solid #221d18;
}
.mdc-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.mdc-brand-md {
  background: #221d18;
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
}
.mdc-brand-arrow { color: #ff7a00; font-weight: 900; }
.mdc-brand-html {
  background: #ff7a00;
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
}
.mdc-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.mdc-opt { cursor: pointer; }
.mdc-opt input { position: absolute; opacity: 0; pointer-events: none; }
.mdc-opt span {
  display: inline-block;
  padding: 6px 13px;
  border: 1.5px solid rgba(34, 29, 24, 0.35);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  color: #6b6157;
  transition: all 0.15s ease;
  user-select: none;
}
.mdc-opt:hover span { border-color: #221d18; color: #221d18; }
.mdc-opt input:checked + span {
  background: #221d18;
  border-color: #221d18;
  color: #fff;
}
.mdc-opt input:checked + span::before { content: "✓ "; color: #ffb168; }
.mdc-opt input:focus-visible + span { outline: 2px solid #ff7a00; outline-offset: 1px; }

/* ---------- ペイン ---------- */
.mdc-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.mdc-pane { display: flex; flex-direction: column; min-width: 0; }
.mdc-pane--out { border-left: 1.5px solid #221d18; }
.mdc-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 8px 14px;
  border-bottom: 1px solid #e8e0d6;
  background: #fffdf9;
}
.mdc-pane-name {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #6b6157;
}
.mdc-pane-tools { display: inline-flex; align-items: center; gap: 8px; }
.mdc-mini {
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 800;
  color: #6b6157;
  background: #fff;
  border: 1.5px solid rgba(34, 29, 24, 0.3);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mdc-mini:hover { border-color: #ff7a00; color: #ff7a00; }
.mdc-tabs {
  display: inline-flex;
  background: #f3ede6;
  border-radius: 999px;
  padding: 3px;
}
.mdc-tab {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 800;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6b6157;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mdc-tab.is-active { background: #fff; color: #221d18; box-shadow: 0 1px 4px rgba(34, 29, 24, 0.18); }
.mdc-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 15px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #ff7a00;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mdc-copy:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(255, 122, 0, 0.45); }
.mdc-copy-done { font-size: 11.5px; font-weight: 800; color: #16a34a; opacity: 0; transition: opacity 0.25s ease; white-space: nowrap; }
.mdc-copy-done.is-visible { opacity: 1; }

/* エディタ領域 */
.mdc-pane textarea {
  flex: 1;
  width: 100%;
  min-height: 460px;
  padding: 16px 18px;
  border: 0;
  border-radius: 0;
  resize: vertical;
  font-family: Menlo, Consolas, "Hiragino Sans", monospace;
  font-size: 13px;
  line-height: 1.8;
  background: #fff;
  color: #221d18;
}
.mdc-pane textarea:focus { outline: none; background: #fffdf6; }
.mdc-pane textarea::placeholder { color: #b3a99c; }
/* 出力側はコードエディタ風のダーク */
#mdc-output {
  background: #26211b;
  color: #f2ead9;
  caret-color: #ff7a00;
}
#mdc-output:focus { background: #2b251e; }
#mdc-output::placeholder { color: #7d7466; }
#mdc-output::selection { background: rgba(255, 122, 0, 0.35); }

.mdc-preview {
  flex: 1;
  min-height: 460px;
  max-height: 680px;
  overflow: auto;
  padding: 18px 22px;
  background: #fff;
  font-size: 14.5px;
  line-height: 1.85;
}
.mdc-preview h1, .mdc-preview h2, .mdc-preview h3 { margin: 1.1em 0 0.5em; line-height: 1.4; }
.mdc-preview h1:first-child, .mdc-preview h2:first-child { margin-top: 0; }
.mdc-preview table { border-collapse: collapse; margin: 12px 0; }
.mdc-preview th, .mdc-preview td { border: 1px solid #c8bfb4; padding: 6px 12px; }
.mdc-preview th { background: #fff4e6; }
.mdc-preview code { background: #f3ede6; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.mdc-preview pre { background: #26211b; color: #f2ead9; padding: 12px 16px; border-radius: 8px; overflow-x: auto; }
.mdc-preview pre code { background: none; color: inherit; padding: 0; }
.mdc-preview blockquote { border-left: 4px solid #ff7a00; margin: 12px 0; padding: 4px 0 4px 14px; color: #6b6157; }
.mdc-preview ul, .mdc-preview ol { padding-left: 1.5em; margin: 10px 0; }
.mdc-preview a { color: #d95e00; }
.mdc-placeholder { color: #a89d90; }

/* ---------- ステータスバー ---------- */
.mdc-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-top: 1.5px solid #221d18;
  background: #fffdf9;
  font-family: Menlo, Consolas, monospace;
  font-size: 11px;
  color: #8a7f71;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 768px) {
  .mdc-toolbar { gap: 10px; }
  .mdc-opts { margin-left: 0; }
  .mdc-panes { grid-template-columns: 1fr; }
  .mdc-pane--out { border-left: 0; border-top: 1.5px solid #221d18; }
  .mdc-pane textarea, .mdc-preview { min-height: 280px; }
  .mdc-status { flex-direction: column; gap: 2px; }
}
