
/* ============================================================
   EDITOR  (>= 768px only; phone is view-only)
   ============================================================ */
#viewCreate{
  display:flex;
  flex-direction:column;
  height:100%;
  min-height:0;
}
#viewCreate > .wrap{
  flex:1 1 auto;
  min-height:0;
  min-width:0;
  width:100%;
  max-width:none;
  margin:0;
  padding:var(--s-3) var(--s-4);
  display:flex;
  flex-direction:column;
}
.editor{
  flex:1 1 auto;
  min-height:0;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:var(--s-2);
}

.editor-top-row{
  flex:0 0 auto;
  display:flex;
  align-items:stretch;
  gap:var(--s-3);
  min-width:0;
}
.editor-title-input{
  flex:1 1 auto;
  min-width:0;
  padding:10px 14px;
  font-size:16px;font-weight:600;letter-spacing:-.01em;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  color:var(--text);
  transition:border-color var(--t-1);
  -webkit-appearance:none;appearance:none;
}
.editor-title-input:focus{border-color:var(--accent);outline:none}
.editor-title-input::placeholder{color:var(--text-3);font-weight:400}

.btn-primary{
  display:inline-flex;align-items:center;gap:var(--s-2);
  padding:10px var(--s-5);
  font-size:14px;font-weight:600;
  background:var(--accent);color:#fff;
  border-radius:var(--r-sm);
  border:1px solid var(--accent);
  transition:background var(--t-1), border-color var(--t-1), opacity var(--t-1);
  flex:0 0 auto;white-space:nowrap;
}
.btn-primary:hover:not(:disabled){background:var(--accent-hover);border-color:var(--accent-hover)}
.btn-primary:disabled{opacity:.4;cursor:not-allowed}
.btn-primary svg{width:15px;height:15px;display:block;flex:0 0 auto}

.editor-slug-row{
  flex:0 0 auto;
  display:flex;align-items:center;gap:6px;
  font-size:12.5px;
  font-family:var(--font-mono);
  color:var(--text-3);
  padding:0 var(--s-1);
  min-height:16px;
  line-height:1.4;
  overflow:hidden;
  min-width:0;
}
.editor-slug-row svg{
  width:13px;height:13px;display:block;flex:0 0 auto;color:var(--text-3);
}
.editor-slug-row .slug-prefix{color:var(--text-3);flex:0 0 auto}
.editor-slug-row .slug-value{
  color:var(--accent);font-weight:600;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;
}
.editor-slug-row.placeholder .slug-value{color:var(--text-3);font-weight:400}

.editor-toolbar{
  flex:0 0 auto;
  display:flex;align-items:center;gap:2px;
  padding:5px 6px;
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  background:var(--surface-2);
  overflow-x:auto;overflow-y:hidden;
  min-width:0;
}
.tb-btn{
  flex:0 0 auto;
  width:32px;height:32px;
  display:inline-flex;align-items:center;justify-content:center;
  border-radius:var(--r-sm);
  color:var(--text-2);
  font-size:11.5px;font-weight:700;letter-spacing:.02em;
  transition:background var(--t-1), color var(--t-1);
}
.tb-btn:hover{background:var(--hover);color:var(--text)}
.tb-btn:active{background:var(--accent-soft);color:var(--accent)}
.tb-btn svg{width:16px;height:16px;display:block}
.tb-sep{flex:0 0 auto;width:1px;height:20px;background:var(--border);margin:0 var(--s-1)}

.editor-tabs{
  display:none;
  flex:0 0 auto;
  padding:3px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  gap:2px;
}
.editor-tab{
  flex:1 1 auto;
  padding:7px var(--s-3);
  font-size:12.5px;font-weight:600;
  color:var(--text-2);
  border-radius:var(--r-xs);
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  transition:background var(--t-1), color var(--t-1);
}
.editor-tab svg{width:14px;height:14px;display:block;flex:0 0 auto}
.editor-tab.active{background:var(--surface);color:var(--text)}

.editor-main{
  flex:1 1 auto;
  min-height:280px;
  min-width:0;
  display:flex;
  overflow:hidden;
  border:1px solid var(--editor-border);
  border-radius:var(--r-sm);
  background:var(--editor-bg);
  isolation:isolate;
}

.editor-gutter{
  flex:0 0 auto;
  width:48px;
  padding:14px 0;
  background:var(--editor-gutter);
  border-right:1px solid var(--editor-border);
  font-family:var(--font-mono);
  font-size:13.5px;
  line-height:var(--line-code);
  color:var(--text-3);
  text-align:right;
  overflow:hidden;
  user-select:none;
  -webkit-user-select:none;
}
.editor-gutter-inner{padding-right:12px;will-change:transform}
.editor-gutter-inner .ln{display:block;height:var(--line-code);line-height:var(--line-code)}
.editor-gutter-inner .ln.active{color:var(--accent);font-weight:700}

.editor-source{
  flex:1 1 50%;
  min-width:0;
  height:100%;
  padding:14px var(--s-4);
  font-family:var(--font-mono);
  font-size:13.5px;
  line-height:var(--line-code);
  background:var(--editor-bg);
  border:0;
  color:var(--text);
  resize:none;
  overflow-y:auto;
  overflow-x:auto;
  white-space:pre;
  word-wrap:normal;
  outline:none;
  tab-size:2;
  -webkit-appearance:none;appearance:none;
}
.editor-source::placeholder{color:var(--text-3)}

.editor-preview{
  flex:1 1 50%;
  min-width:0;
  height:100%;
  overflow-y:auto;
  background:var(--bg);
  color:var(--text);
  border-left:1px solid var(--editor-border);
}
.preview-page{max-width:900px;margin:0 auto;padding:var(--s-7) var(--s-6) 60px}

.editor-statusbar{
  flex:0 0 auto;
  display:flex;align-items:center;justify-content:space-between;
  gap:var(--s-3);
  padding:6px var(--s-3);
  background:var(--statusbar-bg);
  color:var(--statusbar-fg);
  border-radius:var(--r-sm);
  font-family:var(--font-mono);
  font-size:12px;
  font-variant-numeric:tabular-nums;
  min-width:0;
}
.editor-statusbar .sb-side{display:inline-flex;align-items:center;gap:14px;min-width:0}
.editor-statusbar .sb-item{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.editor-statusbar .sb-item svg{width:12px;height:12px;display:block;opacity:.9}
.editor-statusbar .sb-warn{color:#fbbf24;font-weight:700}
.editor-statusbar .sb-limit{color:#fca5a5;font-weight:700}

/* Preview content — matches the live post view 1:1 */
.editor-preview .post-header{margin-bottom:var(--s-6)}
.editor-preview .post-title{
  font-size:34px;font-weight:700;line-height:1.2;letter-spacing:-.025em;
  margin:0 0 14px;overflow-wrap:anywhere;
}
.editor-preview .post-meta{
  font-size:13px;color:var(--text-3);
  display:flex;align-items:center;gap:var(--s-2);flex-wrap:wrap;
}
.editor-preview .post-meta .dot{opacity:.5}
.editor-preview .post-meta-item{display:inline-flex;align-items:center;gap:5px;color:var(--text-3)}
.editor-preview .post-meta-item svg{width:12px;height:12px}
.editor-preview .article{font-size:17px;line-height:1.72}
.preview-empty{color:var(--text-3);font-style:italic;font-size:15px}

/* Tablet: tabs instead of split */
@media (min-width: 768px) and (max-width: 1023px){
  .editor-tabs{display:flex}
  .editor-main{display:block;position:relative}
  .editor-gutter{display:none}
  .editor-source,
  .editor-preview{
    position:absolute;inset:0;
    flex:none;
    border-left:0;
  }
  .editor-main.show-preview .editor-source{display:none}
  .editor-main:not(.show-preview) .editor-preview{display:none}
  .editor-main:not(.show-preview) .editor-source{display:block}
  .editor-source{padding:14px var(--s-4)}
}
