/* ================= menubar ================= */
#menubar {
  height: var(--menubar-h);
  flex: none;
  display: flex;
  align-items: center;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  padding: 0 10px;
  gap: 2px;
  position: relative;
  z-index: 40;
}

#logo {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  margin-right: 6px;
  color: var(--accent);
}
#logo svg.i { width: 16px; height: 16px; }

#docName {
  margin-left: 10px;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  color: var(--text-1);
  font: 500 var(--fs-sm)/1.4 var(--font-ui);
  cursor: text;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#docName:hover { background: var(--bg-3); }
#docName input {
  background: var(--bg-2);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  color: var(--text-1);
  font: 500 var(--fs-sm)/1.3 var(--font-ui);
  padding: 1px 5px;
  width: 170px;
  outline: 0;
}

#saveState {
  color: var(--text-3);
  font: 400 var(--fs-xs)/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 8px;
  min-width: 46px;
}

#toolstrip {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
  padding: 2px;
  background: var(--bg-0);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
}

#menubar .right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}

#zoomLabel {
  min-width: 50px;
  text-align: center;
  color: var(--text-2);
  font: 500 var(--fs-xs)/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  padding: 6px 2px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
#zoomLabel:hover { background: var(--bg-3); color: var(--text-1); }

/* ================= app body ================= */
#app { flex: 1; display: flex; min-height: 0; }
body { display: flex; flex-direction: column; }

.panel {
  flex: none;
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#left { width: var(--panel-l-w); border-right: 1px solid var(--border); }
#right { width: var(--panel-r-w); border-left: 1px solid var(--border); overflow-y: auto; }

body.present #left,
body.present #right,
body.present #menubar,
body.present #statusbar { display: none; }

.p-head {
  padding: 12px 14px 6px;
  font: 600 var(--fs-xs)/1.3 var(--font-ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.p-head .aux { margin-left: auto; display: flex; gap: 2px; }

.sec { padding: 4px 14px 14px; border-bottom: 1px solid var(--border); }
.sec > .p-head { padding: 8px 0 2px; }

/* ================= stage ================= */
#stage { flex: 1; position: relative; min-width: 0; background: var(--bg-0); }
#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#presentHint {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(8, 9, 10, 0.88);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  padding: 4px 12px;
  font: 400 var(--fs-xs)/1.6 var(--font-mono);
  display: none;
  pointer-events: none;
}
body.present #presentHint { display: block; }

body.dragover #stage::after {
  content: "Drop images to import";
  position: absolute;
  inset: 10px;
  border: 1px dashed var(--accent);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: rgba(91, 149, 245, 0.05);
  font: 500 var(--fs-md)/1 var(--font-ui);
  pointer-events: none;
}

/* ================= statusbar ================= */
#statusbar {
  height: var(--statusbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  padding: 0 14px;
  color: var(--text-3);
  font: 400 var(--fs-xs)/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
