/* ブラウザ版 (疑似ターミナル) だけの見た目。共通の見た目は public/style.css */

.edition {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* スマホでは上のバーが狭いので「ブラウザ版」の表示を省く */
@media (max-width: 600px) {
  .edition { display: none; }
}

/* 教材の中のブラウザ版だけの注意書き (public/style.css では隠している) */
/* revert: 段落 (p) は block、箇条書き (li) は list-item と、タグ本来の表示に戻す */
.lite-only { display: revert; }
/* 逆に、Ubuntu 版だけの文 (「この練習環境はコンテナなので…」など) はブラウザ版では隠す */
.ubuntu-only { display: none; }

/* エディタ (nano / vim の代わり。lite/editor.js) */
/* ターミナルの場所 (.term-pane) にぴったり重ねて出す。本文・ヒント・解説は隠れない */
.term-pane { position: relative; }
.modal.editor {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 8px 10px 8px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--term-bg);
  color: #e6e6e6;
  flex-direction: column;
  font-family: ui-monospace, "Cascadia Mono", Consolas, "MS Gothic", monospace;
}
.modal.editor[open] { display: flex; animation: none; }
.modal.editor [hidden] { display: none !important; }
.editor-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.editor-head h3 { margin: 0; font: inherit; font-weight: 700; font-size: 0.9rem; white-space: pre-wrap; word-break: break-all; }
.editor-keys { color: #9aa1ad; font-size: 0.78rem; font-family: system-ui, sans-serif; }
/* nano の上の帯 (白黒反転) */
.modal.editor.nano .editor-head { background: #d8dbe2; color: #16171f; padding: 1px 8px; }
.modal.editor.nano .editor-keys { color: #16171f; font-family: inherit; }
.editor-note { color: #9aa1ad; font-size: 0.76rem; margin: 4px 0 6px; font-family: system-ui, sans-serif; line-height: 1.5; }
.editor-host { flex: 1; min-height: 0; }
#editor-text {
  width: 100%;
  flex: 1;
  min-height: 0;
  resize: none;
  background: #16171f;
  color: #e6e6e6;
  border: 1px solid #363948;
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  tab-size: 4;
}
#editor-text:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 下の1行: vim のモード (-- INSERT --) やメッセージ、nano の [ Wrote 3 lines ] */
.editor-status { min-height: 1.5em; padding: 2px 4px; font-size: 0.85rem; white-space: pre-wrap; }
.editor-status.error { background: #b91c1c; color: #fff; }
/* nano の下のショートカット / vim の Esc ボタン (キーの代わりに押せる) */
.editor-shortcuts { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 2px 4px; font-size: 0.82rem; }
.editor-shortcuts button { background: none; border: 0; padding: 1px 0; color: inherit; font: inherit; cursor: pointer; }
.editor-shortcuts button b { background: #d8dbe2; color: #16171f; font-weight: 400; padding: 0 3px; margin-right: 5px; }
.editor-shortcuts button:hover { color: #fbbf77; }
/* 一覧の下の注意書き (本物にはあるが、ブラウザ版では使えないキー) */
.editor-warning { margin: 4px 4px 0; color: #fbbf77; font-size: 0.76rem; line-height: 1.5; font-family: system-ui, sans-serif; }
.modal.editor form { padding: 0; }
.modal.editor .modal-actions { align-items: center; margin-top: 6px; font-family: system-ui, sans-serif; }
.editor-help { margin-right: auto; color: #9aa1ad; font-size: 0.74rem; }
.modal.editor .modal-actions .btn { background: #262833; border-color: #363948; color: #ddd; }
.modal.editor .modal-actions .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* CodeMirror (使うときに読み込む) をターミナルの見た目に合わせる */
.editor-host .CodeMirror { height: 100%; background: #16171f; color: #e6e6e6; font: inherit; font-size: 0.9rem; line-height: 1.5; border: 1px solid #363948; border-radius: 4px; }
.editor-host .CodeMirror-gutters { background: #16171f; border-right: 1px solid #2c2e3b; }
.editor-host .CodeMirror-linenumber { color: #6b7280; }
.editor-host .CodeMirror-cursor { border-left: 2px solid #e6e6e6; }
.editor-host .cm-fat-cursor .CodeMirror-cursor { background: #8be28b; border: 0; }
.editor-host .cm-fat-cursor .CodeMirror-cursors { z-index: 1; }
.editor-host .cm-animate-fat-cursor { background-color: #8be28b; }
.editor-host .CodeMirror-selected, .editor-host .CodeMirror-focused .CodeMirror-selected { background: #3b4a6b; }
.editor-host .CodeMirror-dialog { background: #16171f; color: #e6e6e6; border-top: 1px solid #363948; padding: 2px 6px; }
.editor-host .CodeMirror-dialog input { color: inherit; font: inherit; }
.editor-host .cm-searching { background: rgba(250, 204, 21, 0.4); }
