/* ===== マークダウン練習帳 ===== */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --border: #d9dee4;
  --text: #1f2328;
  --muted: #5d6874;
  --accent: #2f6fde;
  --accent-soft: #e6eefc;
  --accent-text: #ffffff;
  --success: #1a7f37;
  --success-soft: #dcf5e3;
  --warn-soft: #fff6d6;
  --warn-border: #e8c75a;
  --code-bg: #eff1f3;
  --pre-bg: #f6f8fa;
  --mark: #fff3a3;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  --radius: 10px;
  --font: "Poppins", "Noto Sans JP", sans-serif;
  --mono: "Poppins", "Noto Sans JP", sans-serif;
  --header-h: auto;
  color-scheme: light;
}

/* ダークモード（既定）。<html data-theme="light"> でライトモード */
:root[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1d232b;
  --border: #2e3640;
  --text: #e4e8ec;
  --muted: #97a1ac;
  --accent: #5b93f0;
  --accent-soft: #1d2d4a;
  --accent-text: #0b1220;
  --success: #4ac26b;
  --success-soft: #16301f;
  --warn-soft: #2d2714;
  --warn-border: #8a7424;
  --code-bg: #242b34;
  --pre-bg: #1d232b;
  --mark: #5c5012;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button, input, textarea { font: inherit; color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- ヘッダー ---------- */

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-right: auto; font-weight: 700; }
.brand-mark {
  display: block;
  width: 32px; height: 32px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(20, 24, 70, .35);
}
.brand-name { font-size: 16px; white-space: nowrap; }
.editor-portal-link { display: inline-flex; align-items: center; gap: .35rem; padding: .4rem .8rem; border: 1px solid var(--accent); border-radius: 99px; color: var(--accent); background: var(--accent-soft); box-shadow: 0 3px 12px rgba(20, 38, 60, .24); font-size: .82rem; font-weight: 700; line-height: 1; text-decoration: none; transition: background .18s ease, transform .18s ease; }
.editor-portal-link:hover { background: var(--surface-2); transform: translateY(-2px); }

.header-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .toolbar button:focus-visible, .segmented button:focus-visible,
.sidebar-tabs button:focus-visible, .icon-btn:focus-visible, .hint:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn-small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-ghost { background: transparent; }

.theme-toggle { min-width: 32px; justify-content: center; }

.badge {
  display: inline-block;
  min-width: 2.2em;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11px;
  text-align: center;
}

.filename-field input {
  height: 32px;
  width: 150px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 13px;
}
.filename-field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.segmented button {
  height: 30px;
  padding: 0 10px;
  border: 0;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button.active { background: var(--accent); color: var(--accent-text); }

/* ヘッダーのボタン類は丸め切る */
.app-header .btn,
.app-header .segmented,
.app-header .filename-field input { border-radius: 999px; }
.app-header .btn { padding: 0 14px; }
.app-header .segmented button:first-child { padding-left: 14px; }
.app-header .segmented button:last-child { padding-right: 14px; }

/* ---------- レイアウト ---------- */

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
}
.workspace.has-sidebar { grid-template-columns: 1fr 1fr minmax(320px, 400px); }
.workspace[data-view="edit"] .preview-pane,
.workspace[data-view="preview"] .editor-pane { display: none; }
.workspace[data-view="edit"],
.workspace[data-view="preview"] { grid-template-columns: 1fr; }
.workspace[data-view="edit"].has-sidebar,
.workspace[data-view="preview"].has-sidebar { grid-template-columns: 1fr minmax(320px, 400px); }

.pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pane-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 42px;
}
.pane-title { margin: 0 auto 0 0; font-size: 14px; font-weight: 700; }
.pane-meta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }

/* ---------- ツールバー ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.toolbar button {
  height: 30px;
  min-width: 30px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.toolbar button:hover { background: var(--surface); border-color: var(--border); }
.toolbar .sep { width: 1px; height: 18px; margin: 0 4px; background: var(--border); }

/* ---------- エディタ ---------- */

.editor-wrap { position: relative; flex: 1; min-height: 0; }
#editor {
  display: block;
  width: 100%;
  height: 100%;
  padding: 16px 18px 40vh;
  border: 0;
  resize: none;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.75;
  tab-size: 2;
  outline: none;
}
.drop-overlay {
  position: absolute; inset: 8px;
  display: none; place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  pointer-events: none;
}
.editor-wrap.dragging .drop-overlay { display: grid; }

/* ---------- ヒント ---------- */

.hints {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn-border);
}
.hints[hidden] { display: none; }
.hint {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 2px 4px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 4px;
}
.hint:hover { text-decoration: underline; }
.hint-more { margin: 0; padding: 0 4px; font-size: 12px; color: var(--muted); }

/* ---------- プレビュー ---------- */

.preview-scroll { flex: 1; min-height: 0; overflow: auto; }
#preview { padding: 16px 24px 40vh; }

.markdown-body { line-height: 1.8; word-wrap: break-word; overflow-wrap: anywhere; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  line-height: 1.35;
  margin: 1.5em 0 .6em;
  font-weight: 700;
}
.markdown-body h1 { font-size: 1.9em; padding-bottom: .25em; border-bottom: 1px solid var(--border); }
.markdown-body h2 { font-size: 1.5em; padding-bottom: .25em; border-bottom: 1px solid var(--border); }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1.05em; }
.markdown-body h5 { font-size: .95em; }
.markdown-body h6 { font-size: .9em; color: var(--muted); }
.markdown-body p { margin: 0 0 1em; }
.markdown-body a { color: var(--accent); }
.markdown-body img { max-width: 100%; height: auto; vertical-align: middle; border-radius: 4px; }
.markdown-body hr { border: 0; border-top: 2px solid var(--border); margin: 1.8em 0; }
.markdown-body ul, .markdown-body ol { margin: 0 0 1em; padding-left: 1.8em; }
.markdown-body li > ul, .markdown-body li > ol { margin: .2em 0; }
.markdown-body li > p { margin: .4em 0; }
.markdown-body .task-list-item { list-style: none; }
.markdown-body .task-list-item input { margin: 0 .35em 0 -1.4em; vertical-align: middle; }
.markdown-body blockquote {
  margin: 0 0 1em;
  padding: .3em 1em;
  color: var(--muted);
  border-left: 4px solid var(--border);
}
.markdown-body blockquote > :last-child { margin-bottom: 0; }
.markdown-body code {
  font-family: var(--mono);
  font-size: .88em;
  padding: .15em .4em;
  border-radius: 4px;
  background: var(--code-bg);
}
.markdown-body pre {
  position: relative;
  margin: 0 0 1em;
  padding: 14px 16px;
  overflow: auto;
  border-radius: 8px;
  background: var(--pre-bg);
  border: 1px solid var(--border);
  line-height: 1.55;
}
.markdown-body pre[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 4px; right: 8px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}
.markdown-body pre code { padding: 0; background: none; font-size: .88em; }
.markdown-body .table-wrap { overflow-x: auto; margin: 0 0 1em; }
.markdown-body table { border-collapse: collapse; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border); padding: 6px 12px; }
.markdown-body th { background: var(--surface-2); font-weight: 700; }
.markdown-body tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.markdown-body mark { background: var(--mark); color: inherit; padding: 0 .1em; }
.markdown-body kbd {
  font-family: var(--mono);
  font-size: .82em;
  padding: .1em .45em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface-2);
}
.markdown-body .footnotes { margin-top: 2em; font-size: .88em; color: var(--muted); }
.markdown-body .footnotes hr { margin: 1em 0; }
.markdown-body .footnote-back { text-decoration: none; }
.markdown-body .footnote-ref a { text-decoration: none; }
.md-alert {
  margin: 0 0 1em;
  padding: .5em 1em;
  border-left: 4px solid #2f6fde;
  border-radius: 0 6px 6px 0;
  background: color-mix(in srgb, #2f6fde 8%, transparent);
}
.md-alert > :last-child { margin-bottom: 0; }
.md-alert-title { font-weight: 700; margin: 0 0 .3em !important; color: #2f6fde; }
.md-alert-tip { border-color: #1a9f4a; background: color-mix(in srgb, #1a9f4a 8%, transparent); }
.md-alert-tip .md-alert-title { color: #1a9f4a; }
.md-alert-important { border-color: #8250df; background: color-mix(in srgb, #8250df 8%, transparent); }
.md-alert-important .md-alert-title { color: #8a5ce6; }
.md-alert-warning { border-color: #c48a00; background: color-mix(in srgb, #c48a00 10%, transparent); }
.md-alert-warning .md-alert-title { color: #b07c00; }
.md-alert-caution { border-color: #d6313d; background: color-mix(in srgb, #d6313d 8%, transparent); }
.md-alert-caution .md-alert-title { color: #d6313d; }
.md-alert-note .md-alert-title::before { content: "ℹ️ "; }
.md-alert-tip .md-alert-title::before { content: "💡 "; }
.md-alert-important .md-alert-title::before { content: "❗ "; }
.md-alert-warning .md-alert-title::before { content: "⚠️ "; }
.md-alert-caution .md-alert-title::before { content: "🛑 "; }

/* ---------- サイドパネル ---------- */

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sidebar[hidden] { display: none; }
.sidebar-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-tabs { display: flex; flex: 1; gap: 2px; }
.sidebar-tabs button {
  flex: 1;
  padding: 8px 4px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}
.sidebar-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.icon-btn {
  width: 30px; height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); }

.panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.panel[hidden] { display: none; }
.panel-intro { padding: 10px 12px 6px; border-bottom: 1px solid var(--border); }
.panel-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; position: relative; }
.panel-lead { margin: 0 0 10px; font-size: 13px; }
.panel-note { margin: 8px 0 14px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.panel-note code, .panel-lead code { font-family: var(--mono); background: var(--code-bg); padding: 0 .3em; border-radius: 3px; }

#dict-search {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
#dict-search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.dict-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.dict-nav button {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
}
.dict-nav button:hover { border-color: var(--accent); color: var(--accent); }

.dict-cat[hidden], .dict-item[hidden], .dict-empty[hidden] { display: none; }
.dict-cat-title {
  margin: 4px 0 8px;
  padding: 4px 8px;
  font-size: 14px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}
.dict-item {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dict-item h4 { margin: 0 0 4px; font-size: 14px; }
.dict-desc { margin: 0 0 8px; font-size: 13px; line-height: 1.6; }
.dict-demo { display: grid; grid-template-columns: 1fr; gap: 6px; }
.dict-col { min-width: 0; }
.dict-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; font-weight: 700; }
.dict-md {
  margin: 0;
  padding: 8px 10px;
  background: var(--pre-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
.dict-result {
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.dict-result > :last-child { margin-bottom: 0; }
.dict-result h1 { font-size: 1.5em; margin-top: .4em; }
.dict-result h2 { font-size: 1.3em; margin-top: .4em; }
.dict-result h1, .dict-result h2, .dict-result h3,
.dict-result h4, .dict-result h5, .dict-result h6 { margin: .4em 0; }
.dict-result hr { margin: .8em 0; }
.dict-note {
  margin: 8px 0 0;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.6;
  background: var(--warn-soft);
  border-radius: 6px;
}
.dict-actions { display: flex; gap: 6px; margin-top: 8px; }
.dict-empty { color: var(--muted); font-size: 13px; }

.syntax-box {
  margin: 0;
  padding: 8px 10px;
  background: var(--pre-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 13px;
}

.image-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.image-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.image-thumb {
  display: grid;
  place-items: center;
  height: 130px;
  overflow: hidden;
  background: var(--surface-2);
  padding: 8px;
}
.image-thumb img { display: block; max-width: 100%; max-height: 114px; width: auto; height: auto; object-fit: contain; }
.image-card figcaption { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; }
.image-name { font-size: 13px; font-weight: 700; }
.image-name small { font-weight: 400; color: var(--muted); }
.image-md {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 6px;
  background: var(--code-bg);
  border-radius: 4px;
  word-break: break-all;
}
.image-actions { display: flex; gap: 6px; }

.progress { height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--success); transition: width .3s; }
.progress-label { margin: 6px 0 12px; font-size: 13px; font-weight: 700; }
.practice-list { list-style: none; margin: 0; padding: 0; }
.practice-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background .2s, border-color .2s;
}
.practice-item.done { background: var(--success-soft); border-color: var(--success); }
.practice-mark {
  flex: none;
  width: 22px; height: 22px;
  margin-top: 1px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.practice-item.done .practice-mark { background: var(--success); border-color: var(--success); color: #fff; }
.practice-item.done .practice-mark::before { content: "✓"; font-weight: 700; }
.practice-body { min-width: 0; flex: 1; }
.practice-body h4 { margin: 0 0 2px; font-size: 14px; }
.practice-body p { margin: 0 0 6px; font-size: 13px; line-height: 1.6; }
.practice-body summary { font-size: 12px; color: var(--accent); cursor: pointer; }
.practice-body details .dict-md { margin: 6px 0; }
.practice-reset {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.6;
}
.practice-reset p { margin: 0 0 8px; }

/* ---------- マークダウンとは ---------- */

.about-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.about-dialog[open] { display: flex; flex-direction: column; }
.about-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.about-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.about-body { overflow: auto; padding: 20px 28px 28px; }

/* ---------- ツアーガイド ---------- */

.tour { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.tour[hidden] { display: none; }
.tour-spot {
  position: fixed;
  border-radius: 10px;
  box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(0, 0, 0, .55);
  transition: top .25s, left .25s, width .25s, height .25s;
}
.tour-spot.is-center { box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); }
.tour-bubble {
  position: fixed;
  width: min(360px, calc(100% - 24px));
  padding: 14px 16px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  pointer-events: auto;
  transition: top .25s, left .25s;
}
.tour-step { margin: 0 0 2px; font-size: 12px; color: var(--accent); font-weight: 700; }
.tour-title { margin: 0 0 6px; font-size: 16px; }
.tour-text { margin: 0 0 8px; font-size: 14px; line-height: 1.7; }
.tour-wait { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.tour-wait:empty { display: none; }
.tour-actions { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- トースト ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: #1f2328;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- レスポンシブ ---------- */

@media (max-width: 1100px) {
  .workspace.has-sidebar,
  .workspace[data-view="edit"].has-sidebar,
  .workspace[data-view="preview"].has-sidebar { grid-template-columns: 1fr 1fr; }
  .workspace[data-view="edit"].has-sidebar,
  .workspace[data-view="preview"].has-sidebar { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(420px, 100%);
    border-radius: 0;
    z-index: 50;
    box-shadow: -8px 0 32px rgba(0, 0, 0, .2);
  }
}

@media (max-width: 760px) {
  body { font-size: 14px; }
  .app-header { padding: 8px 12px; }
  .brand { width: 100%; }
  .filename-field input { width: 120px; }
  .toolbar { flex-wrap: nowrap; overflow-x: auto; }
  .toolbar button, .toolbar .sep { flex: none; }
  .workspace { padding: 8px; gap: 8px; }
  .workspace[data-view="split"],
  .workspace[data-view="split"].has-sidebar {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  #preview { padding: 12px 16px 30vh; }
  #editor { padding: 12px 14px 30vh; }
}
