
#draft-panel {
  position: absolute; top: 0; bottom: 0;
  margin-top: var(--panel-top-gap); margin-bottom: var(--panel-bot-gap);
  width: var(--draft-w);
  background: var(--panel-bg); color: var(--panel-text-color);
  z-index: 20; display: flex; flex-direction: column; overflow: hidden;
  padding: 0 8px;
  box-shadow: var(--panel-shadow);
  cursor: grab;
  touch-action: pan-y;
  border-left: 0px solid var(--panel-peek-color);
  border-right: 0px solid var(--panel-peek-color);
  transition:
    left              var(--lay-dur) var(--lay-ease),
    width             var(--lay-dur) var(--lay-ease),
    margin-top        var(--lay-dur) var(--lay-ease),
    margin-bottom     var(--lay-dur) var(--lay-ease),
    border-radius     var(--lay-dur) var(--lay-ease),
    border-color        var(--lay-dur) var(--lay-ease),
    border-left-width  var(--lay-dur) var(--lay-ease),
    border-right-width var(--lay-dur) var(--lay-ease),
    box-shadow         var(--lay-dur) var(--lay-ease),
    transform          var(--lay-dur) var(--lay-ease);
}
#draft-panel:active { cursor: grabbing; }

#outline-panel.is-resizing,
#draft-panel.is-resizing { transition: none !important; }

body.layout-no-anim #outline-panel,
body.layout-no-anim #draft-panel { transition: none !important; }

#outline-panel.is-dragging,
#draft-panel.is-dragging {
  box-shadow: 0 24px 64px rgba(0,0,0,0.14), 0 10px 28px rgba(0,0,0,0.08) !important;
  z-index: 30 !important;
  cursor: grabbing !important;
}

#draft-header { cursor: default; }
#draft-content { cursor: grab; }
#draft-content:active { cursor: grabbing; }
#draft-header {
  padding: 12px 6px; border-bottom: 1px solid #ddd;
  flex-shrink: 0; font-weight: 600; font-size: 15px; color: #222;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
#draft-header-actions { display: flex; gap: 4px; flex-shrink: 0; }
#draft-header-actions button {
  padding: 3px 8px; font-size: 11px; font-weight: 500; border-radius: 4px;
  border: 1px solid #ddd; background: #fff; color: #667;
  cursor: pointer; white-space: nowrap;
}
#draft-header-actions button:hover { background: #f0f0ec; border-color: #ccc; }

#draft-content {
  flex: 1; overflow-y: auto;
  overflow-x: hidden;
  display: flex; flex-direction: row; align-items: flex-start;
}
#draft-linenos-col {
  flex-shrink: 0; width: 44px;
  padding-top: 8px;
  display: flex; flex-direction: column; align-items: flex-end;
  background: #f0f0ec; border-right: 1px solid #e8e8e8;
  user-select: none;
}
.draft-lineno-group {
  align-self: stretch;
  display: flex; flex-direction: column; align-items: flex-end;
  cursor: pointer;
  transition: background 0.12s ease;
}
.draft-lineno-group.lineno-dragging { opacity: 0.4; }
.draft-block.block-dragging { opacity: 0.5; }
.draft-lineno {
  height: 23px; line-height: 23px;
  font-size: 11px; color: #bbb;
  font-family: 'Consolas', monospace;
  padding-right: 6px;
  display: flex; align-items: flex-start; justify-content: flex-end;
  white-space: nowrap; flex-shrink: 0;
}
.draft-sep-gap {
  height: 10px;
  flex-shrink: 0;
  align-self: stretch;
  position: relative;
}
.draft-sep-gap::before {
  content: '';
  position: absolute; top: 5px; left: 0; right: 0;
  height: 1px;
  background-image: repeating-linear-gradient(to right, #dde 0 12px, transparent 12px 18px);
  pointer-events: none;
}
#draft-editor {
  flex: 1;
  min-width: 0; overflow-x: hidden;
  outline: none;
  padding: 8px 10px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 13px; color: #222; line-height: 23px;
  word-wrap: break-word; white-space: pre-wrap;
  tab-size: 4;
  caret-color: #222;
  cursor: text;
}
.draft-block {
  position: relative;
  margin-left: -10px; margin-right: -10px;
  padding-left: 10px; padding-right: 10px;
  transition: background 0.12s ease;
  --node-content-pad: 10px;
}
.draft-block + .draft-block { margin-top: 10px; }
.draft-block + .draft-block::before {
  content: '';
  position: absolute; top: -5px; left: 0; right: 0;
  height: 1px;
  background-image: repeating-linear-gradient(to right, #dde 0 12px, transparent 12px 18px);
  pointer-events: none;
}
.draft-block.is-active { background: #eef3ff; }
#draft-editor .md-h1, #draft-editor .md-h2, #draft-editor .md-h3,
#draft-editor .md-h4, #draft-editor .md-h5, #draft-editor .md-h6 { font-weight: 700; }
#draft-editor .md-h1 { font-size: 2.6em; line-height: 54px; }
#draft-editor .md-h2 { font-size: 2.2em; line-height: 46px; }
#draft-editor .md-h3 { font-size: 1.8em; line-height: 38px; }
#draft-editor .md-h4 { font-size: 1.5em; line-height: 31px; }
#draft-editor .md-h5 { font-size: 1.3em; line-height: 27px; }
#draft-editor .md-h6 { font-size: 1.1em; color: #555; }
.draft-image-block { z-index: auto; }
.draft-block.linked-highlight { background: #fff6ea; }

.draft-empty {
  padding: 24px 16px; color: #aaa; font-size: 13px; font-style: italic; text-align: center;
}
