/* Bitty Box — Cognitive Co-Pilot visual theme.
   CSS-only: preserve host controls, app state, and the content inside viewer frames. */
:root {
  color-scheme: dark;
  --bb-space: #040407;
  --bb-surface: #0e0d1c;
  --bb-gold: #ffd159;
  --bb-gold-soft: #ffe082;
  --bb-cyan: #00e5ff;
  --bb-purple: #9333ea;
  --bb-magenta: #ec4899;
  --bb-muted: #b6b1c7;
  --bb-edge: rgba(255, 209, 89, .23);
  --bb-glass: rgba(12, 12, 24, .82);
  --text-color: #eeeaf7;
  --selected-text-color: #ffd159;
  --text-placeholder-color: #b6b1c7;
  --text-link-color: #8beeff;
  --background-color: #0e0d1c;
  --shadow-color: #000;
  --divider-color: rgba(255, 209, 89, .16);
  --secondary-text-color: #b6b1c7;
  background: var(--bb-space);
}
body {
  color: var(--text-color);
  background:
    radial-gradient(ellipse at 15% 40%, rgba(245, 184, 46, .15), transparent 48%),
    radial-gradient(ellipse at 85% 30%, rgba(147, 51, 234, .20), transparent 45%),
    radial-gradient(ellipse at 90% 65%, rgba(236, 72, 153, .15), transparent 50%),
    radial-gradient(ellipse at 70% 100%, rgba(0, 229, 255, .09), transparent 43%),
    radial-gradient(ellipse at 50% 110%, rgba(255, 209, 89, .17), transparent 56%),
    linear-gradient(180deg, #040407, #090811 70%, #100c1b);
  background-attachment: fixed;
  min-height: 100svh;
  font-family: Lato, system-ui, sans-serif;
  margin: 0;
}
/* Decoration cannot receive a click, selection, drag or keyboard event. */
html:has(.editor-container)::before {
  content: "";
  position: fixed;
  inset: -60px 0;
  z-index: 0;
  pointer-events: none;
  opacity: .65;
  background-image:
    radial-gradient(1px 1px at 31px 41px, #ffe082 90%, transparent),
    radial-gradient(1px 1px at 177px 213px, #eeeaf7 90%, transparent),
    radial-gradient(1.5px 1.5px at 267px 93px, #00e5ff 90%, transparent),
    radial-gradient(1px 1px at 79px 263px, #ec4899 90%, transparent),
    radial-gradient(1px 1px at 328px 286px, #eeeaf7 90%, transparent);
  background-size: 379px 337px, 443px 391px, 613px 457px, 557px 509px, 701px 631px;
  animation: bb-stardrift 70s linear infinite alternate;
}
html:has(.editor-container)::after {
  content: "";
  position: fixed;
  z-index: 0;
  left: -35%;
  right: -35%;
  bottom: -100px;
  height: 320px;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 209, 89, .18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 72, 153, .15) 1px, transparent 1px);
  background-size: 55px 55px;
  transform: perspective(340px) rotateX(63deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, #000 15%, transparent 95%);
  -webkit-mask-image: linear-gradient(to top, #000 15%, transparent 95%);
  animation: bb-horizon 28s linear infinite;
}
@keyframes bb-stardrift { to { transform: translateY(-55px); } }
@keyframes bb-horizon { to { background-position: 0 55px, 0 55px; } }
.editor-container {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: none !important;
  min-width: 0;
  min-height: calc(100svh - 220px);
  margin: 152px 24px 68px;
  padding: 100px 38px 38px;
  border: 1px solid var(--bb-edge);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 209, 89, .035), transparent 35%, rgba(147, 51, 234, .045)),
    var(--bb-glass);
  box-shadow: 0 24px 80px rgba(0,0,0,.5), 0 0 45px rgba(245,184,46,.05), inset 0 1px rgba(255,255,255,.035);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), margin-right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 1200px) {
  body.preview .editor-container {
    width: calc(100% - 560px - 48px);
    max-width: calc(100% - 560px - 48px) !important;
    margin-right: calc(560px + 24px);
    margin-left: 24px;
  }
}
/* Cosmetic wordmark and caption; no additional controls or product features. */
.editor-container::before {
  content: "BITTY BOX";
  position: fixed;
  top: 30px;
  left: 36px;
  font: 800 28px/1.2 Orbitron, system-ui, sans-serif;
  letter-spacing: .12em;
  background: linear-gradient(100deg, #fff9c4, #ffd159 40%, #00e5ff 60%, #a855f7 80%, #ec4899);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(245,184,46,.17));
  pointer-events: none;
}
.editor-container::after {
  content: "A PAGE, PACKED INTO A LINK.";
  position: fixed;
  top: 70px;
  left: 37px;
  color: var(--bb-muted);
  font: 600 11px/1.4 Rajdhani, system-ui, sans-serif;
  letter-spacing: .25em;
  pointer-events: none;
}
#editor.ql-container {
  font-family: Lato, system-ui, sans-serif;
  width: 100%;
  max-width: 100%;
}
#editor .ql-editor {
  color: var(--text-color);
  font-family: Lato, system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.8;
  padding: 0;
  width: 100%;
  max-width: 100%;
  min-height: calc(100svh - 360px);
  caret-color: var(--bb-gold);
  overflow-wrap: anywhere;
}
#editor .ql-editor h1,
#editor .ql-editor h2 { color: #fff7dc; }
#editor .ql-editor a { color: var(--bb-cyan); }
#editor .ql-code-block-container {
  background: #080811;
  border: 1px solid rgba(0,229,255,.16);
  border-radius: 10px;
}
#placeholder {
  left: 38px;
  top: 100px;
  margin: 0;
  padding: 0;
  max-width: calc(100% - 76px);
  color: var(--bb-muted);
  font: 400 18px/1.8 Lato, system-ui, sans-serif;
  font-style: normal;
}
#placeholder::first-line {
  color: var(--bb-gold-soft);
  font-family: Orbitron, system-ui, sans-serif;
  font-weight: 600;
  font-size: 22px;
  line-height: 2;
}
#placeholder p { margin-top: 24px; }
#ib-info {
  color: #d6b96e;
  font-family: Rajdhani, system-ui, sans-serif;
  font-size: 13px;
  letter-spacing: .08em;
  text-underline-offset: 5px;
}
#ib-info:hover { color: var(--bb-gold-soft); }
#doc-title {
  top: 24px;
  left: 26px;
  margin: 0;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--bb-gold-soft);
  background: rgba(255,209,89,.05);
  border: 1px solid rgba(255,209,89,.14);
  line-height: 44px;
  min-height: 44px;
  font-family: Rajdhani, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 600;
  max-width: calc(100% - 60px);
}
#doc-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#doc-title.open {
  background: rgba(255,209,89,.12);
  color: var(--bb-gold-soft);
  border-color: rgba(255,209,89,.4);
}
body.edited #doc-title.open::after { color: var(--bb-gold-soft); }
#doc-title-text:empty::after { opacity: .85; }
#menubar {
  top: 25px;
  right: 32px;
  left: auto;
  width: auto;
  height: auto;
  align-items: center;
  z-index: 3000;
}
#menubar:empty { display: none; }
#menubar > .toolbar-right:empty { display: none; }
#menubar > .toolbar-right {
  height: auto;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.toolbar-right .menu-item {
  margin: 0;
  min-height: 44px;
  line-height: 44px;
  border-radius: 8px;
  padding: 0 15px;
  font: 600 16px/44px Rajdhani, system-ui, sans-serif;
  letter-spacing: .05em;
}
#length {
  color: var(--bb-muted);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
#mainmenu > .menu-item {
  color: var(--bb-gold-soft);
  background: rgba(255,209,89,.085);
  border: 1px solid rgba(255,209,89,.2);
}
#mainmenu > .menu-item:hover,
.menu-visible > .menu-item,
.toolbar-right .menu-item:hover {
  color: #fff7dc !important;
  background: rgba(255,209,89,.15);
}
#formatbar {
  position: fixed;
  left: 32px;
  right: auto;
  top: 97px;
  height: auto !important;
  width: fit-content;
  max-width: calc(100vw - 64px);
  padding: 5px;
  gap: 2px;
  border: 1px solid rgba(0,229,255,.17);
  border-radius: 11px;
  background: rgba(12,12,24,.9);
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
#format-toggle {
  min-width: 40px;
  padding: 0 9px;
  line-height: 44px;
  border-radius: 7px;
  color: var(--bb-gold-soft);
  font-family: Rajdhani, system-ui, sans-serif;
}
#formatbar .ql-formats { opacity: 1; }
#formatbar.ql-snow .ql-picker { color: var(--text-color); }
#formatbar.ql-snow .ql-stroke { stroke: var(--text-color); }
#formatbar.ql-snow .ql-fill { fill: var(--text-color); }
#formatbar.ql-snow button:hover,
#formatbar.ql-snow button.ql-active,
#formatbar .ql-picker-label:hover,
#format-toggle:hover { background: rgba(0,229,255,.08); border-radius: 7px; }
#formatbar.ql-snow button:hover .ql-stroke,
#formatbar.ql-snow button.ql-active .ql-stroke { stroke: var(--bb-gold); }
#formatbar.ql-snow button.ql-active .ql-fill { fill: var(--bb-gold); }
#formatbar .ql-picker-options {
  border: 1px solid rgba(0,229,255,.25);
  border-radius: 10px;
  background: #0e0d1c !important;
  box-shadow: 0 16px 45px rgba(0,0,0,.5);
}
#formatbar .ql-color-picker .ql-picker-item { border-radius: 3px; }
#menu-contents,
#md-contents,
#editor .ql-tooltip,
dialog.menu,
dialog.dialog {
  box-sizing: border-box;
  color: var(--text-color);
  background: rgba(14,12,28,.97);
  border: 1px solid rgba(255,209,89,.28);
  border-radius: 14px;
  box-shadow: 0 18px 65px rgba(0,0,0,.6), 0 0 25px rgba(147,51,234,.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
#menu-contents {
  top: 54px;
  right: -4px;
  min-width: 220px;
  padding: 9px;
  margin: 0;
  max-width: calc(100vw - 40px);
}
#menu-contents a {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 7px;
  font: 600 16px/44px Rajdhani, system-ui, sans-serif;
  letter-spacing: .025em;
}
#menubar .menu a:hover { color: var(--bb-gold-soft); background: rgba(255,209,89,.09); }
#menu-contents hr,
dialog.menu hr { border: 0; border-top: 1px solid rgba(255,209,89,.15); margin: 7px 0; height: 0; background: transparent; }
#menubar .disabled { opacity: 1; color: var(--bb-muted); font: 600 12px/24px Rajdhani, sans-serif; letter-spacing: .1em; }
#md-contents {
  width: min(520px, calc(100vw - 80px));
  max-width: calc(100vw - 80px);
  left: 0;
  top: 55px;
  padding: 18px;
  gap: 7px;
  margin: 0;
  line-height: 1.5;
}
#md-contents .inputrow {
  padding: 0 0 8px;
  gap: 12px;
  margin: 0;
  border-bottom: 1px solid rgba(255,209,89,.1);
}
#md-contents .inputrow:focus-within { border-bottom: 1px solid rgba(0,229,255,.45); }
#md-contents label {
  min-width: 83px;
  margin: 0;
  color: var(--bb-muted);
  font: 600 14px/44px Rajdhani, system-ui, sans-serif;
}
#md-contents input,
#editor .ql-tooltip input,
dialog.menu input,
#search {
  box-sizing: border-box;
  min-width: 0;
  color: var(--text-color);
  background: rgba(4,4,7,.55);
  border: 1px solid rgba(182,177,199,.16);
  border-radius: 8px;
  min-height: 44px;
  padding: 9px 12px;
  margin: 0;
  font: 400 16px/1.4 Lato, system-ui, sans-serif;
}
#md-contents input:not([type="checkbox"]) { width: 100%; flex: 1; }
#md-contents input::placeholder { color: #918aab; }
#md-contents input:focus,
#search:focus,
#editor .ql-tooltip input:focus { outline: 2px solid rgba(0,229,255,.6); outline-offset: 2px; }
#md-contents #md-include { flex: 0 0 18px; width: 18px; min-height: 18px; height: 18px; margin: 13px 0; accent-color: var(--bb-gold); }
#copy-message {
  position: fixed;
  top: auto;
  right: auto;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid rgba(255,209,89,.4);
  border-radius: 11px;
  background: rgba(14,12,28,.96);
  color: var(--bb-gold-soft);
  font: 600 16px/1.4 Rajdhani, system-ui, sans-serif;
  padding: 14px 22px;
  text-align: center;
  max-width: calc(100vw - 50px);
  box-sizing: border-box;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  z-index: 5000;
}
/* --- Preview Side Panel & PREVIEW Tab --- */
.preview-side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 92vw);
  height: 100vh;
  height: 100svh;
  z-index: 5000;
  background: rgba(10, 9, 20, 0.96);
  border-left: 1px solid var(--bb-edge);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(147, 51, 234, 0.12);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  opacity: 0;
  pointer-events: none;
}

body.preview .preview-side-panel {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.preview-panel-header {
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 209, 89, 0.15);
  background: rgba(255, 209, 89, 0.03);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.preview-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: bb-preview-pulse 2s infinite ease-in-out;
}
@keyframes bb-preview-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.preview-panel-heading {
  font-family: Orbitron, system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: var(--bb-gold-soft);
}

.preview-panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-panel-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 209, 89, 0.08);
  border: 1px solid rgba(255, 209, 89, 0.2);
  color: var(--bb-gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-size: 15px;
}
.preview-panel-btn:hover {
  background: rgba(255, 209, 89, 0.22);
  color: #fff;
  border-color: var(--bb-gold);
  transform: scale(1.05);
}

.preview-panel-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #040407;
}

.preview-frame-content {
  width: 100%;
  height: 100%;
  border: none;
  background: #040407;
  display: block;
}

.preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 7, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 4900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

@media (max-width: 1199px) {
  body.preview .preview-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Toolbar PREVIEW Tab */
.toolbar-right .preview-tab-title {
  color: var(--bb-gold-soft);
  background: rgba(255, 209, 89, 0.09);
  border: 1px solid rgba(255, 209, 89, 0.28);
  font-family: Orbitron, Rajdhani, system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
}
.toolbar-right .preview-tab-title:hover {
  background: rgba(255, 209, 89, 0.2);
  color: #fff !important;
  border-color: var(--bb-gold);
  box-shadow: 0 0 14px rgba(255, 209, 89, 0.28);
}
body.preview .toolbar-right .preview-tab-title,
.toolbar-right .preview-tab-title.active {
  background: var(--bb-gold);
  color: #040407 !important;
  border-color: var(--bb-gold);
  box-shadow: 0 0 18px rgba(255, 209, 89, 0.45);
  font-weight: 800;
}

/* Docked Right-Edge PREVIEW Tab */
.preview-edge-tab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4800;
  background: rgba(14, 13, 28, 0.94);
  border: 1px solid var(--bb-edge);
  border-right: none;
  border-radius: 12px 0 0 12px;
  padding: 20px 8px;
  cursor: pointer;
  color: var(--bb-gold-soft);
  box-shadow: -6px 0 25px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.preview-edge-tab:hover {
  background: rgba(255, 209, 89, 0.18);
  color: #fff;
  border-color: var(--bb-gold);
  box-shadow: -8px 0 30px rgba(255, 209, 89, 0.3);
  padding-right: 12px;
}
.preview-edge-tab .preview-edge-tab-badge {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: Orbitron, Rajdhani, system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2em;
}
body.preview .preview-edge-tab {
  right: min(560px, 92vw);
  background: var(--bb-gold);
  color: #040407;
  border-color: var(--bb-gold);
  box-shadow: -8px 0 25px rgba(255, 209, 89, 0.4);
}
#doc-file { background-color: #0e0d1c; color: var(--bb-gold-soft); border: 1px solid var(--bb-edge); }
#drop-zone { background-color: var(--bb-gold); }
/* Viewer chrome only. Never target or restyle the page within #iframe. */
#menu {
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255,209,89,.35);
  background: rgba(12,12,24,.93);
  color: var(--bb-gold);
  mix-blend-mode: normal;
  opacity: 1;
  box-shadow: 0 8px 25px rgba(0,0,0,.2);
}
#menu svg { width: 26px; height: 26px; margin: 10px; }
#menu:hover, #menu.open { font-size: 18px; color: var(--bb-gold); }
#menu:hover svg, #menu.open svg { background: transparent; }
#menu svg .inner, #menu:hover svg .inner, #menu.open svg .inner { fill: var(--bb-gold); }
dialog.menu { top: 78px; right: 16px; bottom: auto; padding: 10px; max-width: min(320px, calc(100vw - 32px)); margin: 0; }
dialog.menu .url { width: 100%; opacity: 1; color: var(--bb-muted); margin: 0 0 8px; font-size: 14px; }
dialog.menu .menu-item { border-radius: 8px; min-height: 44px; box-sizing: border-box; font: 600 17px/44px Rajdhani, sans-serif; }
dialog.menu .menu-item:hover { color: var(--bb-gold-soft); background: rgba(255,209,89,.09); }
dialog.menu .menu-icons .menu-item { width: 48px; height: 48px; padding: 12px; line-height: 24px; color: var(--bb-gold); }
dialog::backdrop { background: rgba(4,4,7,.5); backdrop-filter: blur(5px); }
dialog.dialog button { color: var(--bb-gold-soft); background: rgba(255,209,89,.09); border: 1px solid var(--bb-edge); box-shadow: none; border-radius: 8px; min-height: 44px; }
/* Companion pages use the same visual vocabulary, with their original content. */
body:has(> .back) { box-sizing: border-box; max-width: 46rem; margin: 0 auto; padding: 100px 28px 60px; font: 18px/1.8 Lato, system-ui, sans-serif; }
body:has(> .back) h1 { font-family: Orbitron, system-ui, sans-serif; color: var(--bb-gold-soft); letter-spacing: -.025em; }
body:has(> .back) a { color: var(--bb-gold-soft); }
body:has(> .back) .back { border-color: var(--bb-edge); background: rgba(255,209,89,.08); font-family: Rajdhani, sans-serif; border-radius: 10px; }
body:has(> .back) small { color: var(--bb-muted); }
body:has(#results) { padding: 70px 24px; box-sizing: border-box; }
#search { width: min(660px, 100%); margin: 0 auto 26px; }
#results a { color: var(--text-color); background: var(--bb-glass); border: 1px solid var(--bb-edge); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.3); }
#results .info, #results .info * { font-family: Lato, system-ui, sans-serif; }
#results .title { color: var(--bb-gold-soft); }
#results .delete { color: var(--bb-gold-soft); background: #0e0d1c; border-color: var(--bb-edge); }
::selection { color: #fff; background: rgba(37,99,235,.65); }
@media (max-width: 760px) {
  .editor-container { width: calc(100% - 32px); margin: 148px 16px 44px; padding: 91px 22px 28px; min-height: calc(100svh - 192px); border-radius: 17px; }
  .editor-container::before { top: 25px; left: 21px; font-size: 23px; letter-spacing: .09em; }
  .editor-container::after { top: 60px; left: 22px; font-size: 10px; letter-spacing: .18em; }
  #menubar { top: 86px; right: 16px; left: auto; }
  #menubar > .toolbar-right { padding: 3px; gap: 1px; }
  .toolbar-right .menu-item { padding: 0 11px; font-size: 15px; }
  #length { padding: 0 6px; font-size: 12px; }
  #formatbar { top: 89px; left: 16px; max-width: calc(100vw - 32px); padding: 3px; }
  body.format #formatbar { top: 143px; left: 16px; right: 16px; width: auto; }
  body.format .editor-container { margin-top: 304px; }
  #formatbar .ql-formats { max-width: 100%; }
  #formatbar.ql-snow.ql-toolbar button, #formatbar.ql-snow.ql-toolbar .ql-picker { min-width: 38px; width: 38px; }
  #doc-title { left: 13px; top: 20px; max-width: calc(100% - 30px); font-size: 16px; }
  #placeholder { left: 22px; top: 91px; max-width: calc(100% - 44px); font-size: 16px; }
  #placeholder::first-line { font-size: 19px; }
  #editor .ql-editor { font-size: 17px; min-height: calc(100svh - 335px); }
  #md-contents { width: min(520px, calc(100vw - 58px)); max-width: calc(100vw - 58px); left: -2px; padding: 14px; }
  #md-contents .inputrow { flex-direction: column; gap: 4px; }
  #md-contents label { font-size: 13px; line-height: 24px; }
  #md-contents #md-include { margin: 6px 0; flex-basis: 18px; }
  body.preview .editor-container { width: calc(100% - 32px); margin-left: 16px; margin-right: 16px; }
  html:has(.editor-container)::after { height: 250px; opacity: .6; }
}
@media (prefers-reduced-motion: reduce) {
  html:has(.editor-container)::before,
  html:has(.editor-container)::after { animation: none; }
}
